Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

feat(test-runner): log aria snapshot failures during error context capture (#41626)

Pradap Pandiyan76554c4284b1
diff --git a/packages/playwright/src/index.ts b/packages/playwright/src/index.ts
index d9be54325e..34f9d6deda 100644
--- a/packages/playwright/src/index.ts
+++ b/packages/playwright/src/index.ts
@@ -24,6 +24,7 @@ import { escapeHTML } from '@isomorphic/stringUtils';
import { jsonStringifyForceASCII } from '@utils/ascii';
import { createGuid } from '@utils/crypto';
import { debugMode } from '@utils/debug';
+import { debugLogger } from '@utils/debugLogger';
import { currentZone } from '@utils/zones';
import { buildErrorContext } from './errorContext';
import { config, testType } from './common';
@@ -740,7 +741,9 @@ class ArtifactsRecorder {
await page._wrapApiCall(async () => {
this._pageSnapshot = await page.ariaSnapshot({ mode: 'ai', timeout: 5000 });
}, { internal: true });
- } catch {}
+ } catch (error) {
+ debugLogger.log('error', `failed to capture aria snapshot: ${error}`);
+ }
}
async didCreateRequestContext(context: APIRequestContextImpl) {