mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-13 02:41:50 +08:00
Add API error monitoring tests and error context snapshots for various browsers
- Created error context snapshots for Firefox, WebKit, and Chromium to capture UI state during API error monitoring. - Implemented e2e tests for API error detection, including console errors, failed API requests, and proxy errors. - Added functionality to ignore specific API patterns in monitoring assertions. - Ensured tests validate the monitoring system's ability to detect and report errors effectively.
This commit is contained in:
@@ -9,13 +9,36 @@ import {
|
||||
verifyI18nState,
|
||||
verifyPersistenceAfterReload,
|
||||
navigateAndVerifyLanguage,
|
||||
setupEnhancedMonitoring,
|
||||
} from './helpers/i18n-helpers';
|
||||
|
||||
test.describe('[Navigation] - i18n E2E Tests', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
// Setup enhanced error monitoring to catch API/proxy errors
|
||||
const monitoring = setupEnhancedMonitoring(page);
|
||||
|
||||
// Store monitoring on page for afterEach access
|
||||
(page as any).__monitoring = monitoring;
|
||||
|
||||
await page.goto('/', { waitUntil: 'networkidle' });
|
||||
});
|
||||
|
||||
test.afterEach(async ({ page }) => {
|
||||
// Assert no console errors or API failures after each test
|
||||
const monitoring = (page as any).__monitoring as EnhancedMonitoring;
|
||||
if (monitoring) {
|
||||
try {
|
||||
// Allow ignoring known backend dependency issues
|
||||
monitoring.assertClean({
|
||||
ignoreAPIPatterns: ['/api/data'], // Known: backend may not be running
|
||||
allowWarnings: true // Don't fail on warnings
|
||||
});
|
||||
} finally {
|
||||
monitoring.stop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* NAV-01: Verify navigation links are translated
|
||||
* Priority: P0
|
||||
|
||||
Reference in New Issue
Block a user