Skip to content

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

chore: change pageSnapshot extension to `.snapshot.yml` (#34930)

Simon Knotta04a93c1fd0e
diff --git a/packages/playwright/src/index.ts b/packages/playwright/src/index.ts
index e8afe5a74a..68b29bf3d6 100644
--- a/packages/playwright/src/index.ts
+++ b/packages/playwright/src/index.ts
@@ -628,7 +628,7 @@ class ArtifactsRecorder {
await page.screenshot({ ...screenshotOptions, timeout: 5000, path, caret: 'initial' });
});
- this._pageSnapshotRecorder = new SnapshotRecorder(this, pageSnapshot, 'pageSnapshot', 'text/plain', '.ariasnapshot', async (page, path) => {
+ this._pageSnapshotRecorder = new SnapshotRecorder(this, pageSnapshot, 'pageSnapshot', 'text/plain', '.snapshot.yml', async (page, path) => {
const ariaSnapshot = await page.locator('body').ariaSnapshot({ timeout: 5000 });
await fs.promises.writeFile(path, ariaSnapshot);
});
diff --git a/tests/playwright-test/playwright.artifacts.spec.ts b/tests/playwright-test/playwright.artifacts.spec.ts
index 5a8a6fcbef..d54fe5265c 100644
--- a/tests/playwright-test/playwright.artifacts.spec.ts
+++ b/tests/playwright-test/playwright.artifacts.spec.ts
@@ -435,29 +435,29 @@ test('should work with pageSnapshot: on', async ({ runInlineTest }, testInfo) =>
expect(listFiles(testInfo.outputPath('test-results'))).toEqual([
'.last-run.json',
'artifacts-failing',
- ' test-failed-1.ariasnapshot',
+ ' test-failed-1.snapshot.yml',
'artifacts-own-context-failing',
- ' test-failed-1.ariasnapshot',
+ ' test-failed-1.snapshot.yml',
'artifacts-own-context-passing',
- ' test-finished-1.ariasnapshot',
+ ' test-finished-1.snapshot.yml',
'artifacts-passing',
- ' test-finished-1.ariasnapshot',
+ ' test-finished-1.snapshot.yml',
'artifacts-persistent-failing',
- ' test-failed-1.ariasnapshot',
+ ' test-failed-1.snapshot.yml',
'artifacts-persistent-passing',
- ' test-finished-1.ariasnapshot',
+ ' test-finished-1.snapshot.yml',
'artifacts-shared-shared-failing',
- ' test-failed-1.ariasnapshot',
- ' test-failed-2.ariasnapshot',
+ ' test-failed-1.snapshot.yml',
+ ' test-failed-2.snapshot.yml',
'artifacts-shared-shared-passing',
- ' test-finished-1.ariasnapshot',
- ' test-finished-2.ariasnapshot',
+ ' test-finished-1.snapshot.yml',
+ ' test-finished-2.snapshot.yml',
'artifacts-two-contexts',
- ' test-finished-1.ariasnapshot',
- ' test-finished-2.ariasnapshot',
+ ' test-finished-1.snapshot.yml',
+ ' test-finished-2.snapshot.yml',
'artifacts-two-contexts-failing',
- ' test-failed-1.ariasnapshot',
- ' test-failed-2.ariasnapshot',
+ ' test-failed-1.snapshot.yml',
+ ' test-failed-2.snapshot.yml',
]);
});
@@ -475,16 +475,16 @@ test('should work with pageSnapshot: only-on-failure', async ({ runInlineTest },
expect(listFiles(testInfo.outputPath('test-results'))).toEqual([
'.last-run.json',
'artifacts-failing',
- ' test-failed-1.ariasnapshot',
+ ' test-failed-1.snapshot.yml',
'artifacts-own-context-failing',
- ' test-failed-1.ariasnapshot',
+ ' test-failed-1.snapshot.yml',
'artifacts-persistent-failing',
- ' test-failed-1.ariasnapshot',
+ ' test-failed-1.snapshot.yml',
'artifacts-shared-shared-failing',
- ' test-failed-1.ariasnapshot',
- ' test-failed-2.ariasnapshot',
+ ' test-failed-1.snapshot.yml',
+ ' test-failed-2.snapshot.yml',
'artifacts-two-contexts-failing',
- ' test-failed-1.ariasnapshot',
- ' test-failed-2.ariasnapshot',
+ ' test-failed-1.snapshot.yml',
+ ' test-failed-2.snapshot.yml',
]);
});