diff --git a/tests/playwright-test/playwright.artifacts.spec.ts b/tests/playwright-test/playwright.artifacts.spec.ts index 6032999268..5a8a6fcbef 100644 --- a/tests/playwright-test/playwright.artifacts.spec.ts +++ b/tests/playwright-test/playwright.artifacts.spec.ts @@ -128,7 +128,7 @@ test('should work with screenshot: on', async ({ runInlineTest }, testInfo) => { const result = await runInlineTest({ ...testFiles, 'playwright.config.ts': ` - module.exports = { use: { screenshot: 'on' } }; + module.exports = { use: { screenshot: 'on', pageSnapshot: 'off' } }; `, }, { workers: 1 }); @@ -168,7 +168,7 @@ test('should work with screenshot: only-on-failure', async ({ runInlineTest }, t const result = await runInlineTest({ ...testFiles, 'playwright.config.ts': ` - module.exports = { use: { screenshot: 'only-on-failure' } }; + module.exports = { use: { screenshot: 'only-on-failure', pageSnapshot: 'off' } }; `, }, { workers: 1 }); @@ -204,7 +204,7 @@ test('should work with screenshot: on-first-failure', async ({ runInlineTest }, 'playwright.config.ts': ` module.exports = { retries: 1, - use: { screenshot: 'on-first-failure' } + use: { screenshot: 'on-first-failure', pageSnapshot: 'off' } }; `, }, { workers: 1 }); @@ -231,7 +231,7 @@ test('should work with screenshot: only-on-failure & fullPage', async ({ runInli }); `, 'playwright.config.ts': ` - module.exports = { use: { screenshot: { mode: 'only-on-failure', fullPage: true } } }; + module.exports = { use: { screenshot: { mode: 'only-on-failure', fullPage: true }, pageSnapshot: 'off' } }; `, }, { workers: 1 }); expect(result.exitCode).toBe(1); @@ -252,7 +252,7 @@ test('should work with trace: on', async ({ runInlineTest }, testInfo) => { const result = await runInlineTest({ ...testFiles, 'playwright.config.ts': ` - module.exports = { use: { trace: 'on' } }; + module.exports = { use: { trace: 'on', pageSnapshot: 'off' } }; `, }, { workers: 1 }); @@ -288,7 +288,7 @@ test('should work with trace: retain-on-failure', async ({ runInlineTest }, test const result = await runInlineTest({ ...testFiles, 'playwright.config.ts': ` - module.exports = { use: { trace: 'retain-on-failure' } }; + module.exports = { use: { trace: 'retain-on-failure', pageSnapshot: 'off' } }; `, }, { workers: 1 }); @@ -314,7 +314,7 @@ test('should work with trace: on-first-retry', async ({ runInlineTest }, testInf const result = await runInlineTest({ ...testFiles, 'playwright.config.ts': ` - module.exports = { use: { trace: 'on-first-retry' } }; + module.exports = { use: { trace: 'on-first-retry', pageSnapshot: 'off' } }; `, }, { workers: 1, retries: 1 }); @@ -340,7 +340,7 @@ test('should work with trace: on-all-retries', async ({ runInlineTest }, testInf const result = await runInlineTest({ ...testFiles, 'playwright.config.ts': ` - module.exports = { use: { trace: 'on-all-retries' } }; + module.exports = { use: { trace: 'on-all-retries', pageSnapshot: 'off' } }; `, }, { workers: 1, retries: 2 }); @@ -376,7 +376,7 @@ test('should work with trace: retain-on-first-failure', async ({ runInlineTest } const result = await runInlineTest({ ...testFiles, 'playwright.config.ts': ` - module.exports = { use: { trace: 'retain-on-first-failure' } }; + module.exports = { use: { trace: 'retain-on-first-failure', pageSnapshot: 'off' } }; `, }, { workers: 1, retries: 2 }); diff --git a/tests/playwright-test/playwright.spec.ts b/tests/playwright-test/playwright.spec.ts index 8cd83c40b1..fdf050680f 100644 --- a/tests/playwright-test/playwright.spec.ts +++ b/tests/playwright-test/playwright.spec.ts @@ -485,7 +485,7 @@ test('should work with video: retain-on-failure', async ({ runInlineTest }) => { test('should work with video: on-first-retry', async ({ runInlineTest }) => { const result = await runInlineTest({ 'playwright.config.ts': ` - module.exports = { use: { video: 'on-first-retry' }, retries: 1, name: 'chromium' }; + module.exports = { use: { video: 'on-first-retry', pageSnapshot: 'off' }, retries: 1, name: 'chromium' }; `, 'a.test.ts': ` import { test, expect } from '@playwright/test'; diff --git a/tests/playwright-test/playwright.trace.spec.ts b/tests/playwright-test/playwright.trace.spec.ts index 88995c6f1c..c3dd479e2c 100644 --- a/tests/playwright-test/playwright.trace.spec.ts +++ b/tests/playwright-test/playwright.trace.spec.ts @@ -59,7 +59,7 @@ test('should stop tracing with trace: on-first-retry, when not retrying', async test('should record api trace', async ({ runInlineTest, server }, testInfo) => { const result = await runInlineTest({ 'playwright.config.ts': ` - module.exports = { use: { trace: 'on' } }; + module.exports = { use: { trace: 'on', pageSnapshot: 'off' } }; `, 'a.spec.ts': ` import { test, expect } from '@playwright/test'; @@ -290,7 +290,7 @@ test('should work in serial mode', async ({ runInlineTest }, testInfo) => { test('should not override trace file in afterAll', async ({ runInlineTest, server }, testInfo) => { const result = await runInlineTest({ 'playwright.config.ts': ` - module.exports = { use: { trace: 'retain-on-failure' } }; + module.exports = { use: { trace: 'retain-on-failure', , pageSnapshot: 'off' } }; `, 'a.spec.ts': ` import { test, expect } from '@playwright/test'; @@ -642,7 +642,7 @@ test('should expand expect.toPass', async ({ runInlineTest }, testInfo) => { test('should show non-expect error in trace', async ({ runInlineTest }, testInfo) => { const result = await runInlineTest({ 'playwright.config.ts': ` - module.exports = { use: { trace: { mode: 'on' } } }; + module.exports = { use: { trace: { mode: 'on', pageSnapshot: 'off' } } }; `, 'a.spec.ts': ` import { test, expect } from '@playwright/test'; @@ -850,7 +850,7 @@ test('should record nested steps, even after timeout', async ({ runInlineTest }, const result = await runInlineTest({ 'playwright.config.ts': ` module.exports = { - use: { trace: { mode: 'on' } }, + use: { trace: { mode: 'on', pageSnapshot: 'off' } }, timeout: 5000, }; `, @@ -1156,6 +1156,9 @@ test('should record trace for manually created context in a failed test', async test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/31541' }); const result = await runInlineTest({ + 'playwright.config.ts': ` + module.exports = { use: { pageSnapshot: 'off' } }; + `, 'a.spec.ts': ` import { test, expect } from '@playwright/test'; test('fail', async ({ browser }) => { @@ -1234,6 +1237,9 @@ test('should record trace after fixture teardown timeout', { annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/30718' }, }, async ({ runInlineTest }) => { const result = await runInlineTest({ + 'playwright.config.ts': ` + module.exports = { use: { pageSnapshot: 'off' } }; + `, 'a.spec.ts': ` import { test as base, expect } from '@playwright/test'; const test = base.extend({ diff --git a/tests/playwright-test/test-step.spec.ts b/tests/playwright-test/test-step.spec.ts index be72e51dd1..d35e9de57a 100644 --- a/tests/playwright-test/test-step.spec.ts +++ b/tests/playwright-test/test-step.spec.ts @@ -192,6 +192,9 @@ test('should not report nested after hooks', async ({ runInlineTest }) => { 'playwright.config.ts': ` module.exports = { reporter: './reporter', + use: { + pageSnapshot: 'off', + } }; `, 'a.test.ts': ` @@ -577,6 +580,9 @@ test('should not mark page.close as failed when page.click fails', async ({ runI 'playwright.config.ts': ` module.exports = { reporter: './reporter', + use: { + pageSnapshot: 'off', + } }; `, 'a.test.ts': ` @@ -1230,6 +1236,9 @@ test('should report api step failure', async ({ runInlineTest }) => { 'playwright.config.ts': ` module.exports = { reporter: './reporter', + use: { + pageSnapshot: 'off', + } }; `, 'a.test.ts': ` diff --git a/tests/playwright-test/to-have-screenshot.spec.ts b/tests/playwright-test/to-have-screenshot.spec.ts index 65e348cc52..2e1c3a4585 100644 --- a/tests/playwright-test/to-have-screenshot.spec.ts +++ b/tests/playwright-test/to-have-screenshot.spec.ts @@ -619,6 +619,9 @@ test('should write missing expectations locally twice and attach them', async ({ const result = await runInlineTest({ ...playwrightConfig({ snapshotPathTemplate: '__screenshots__/{testFilePath}/{arg}{ext}', + use: { + pageSnapshot: 'off', + }, }), 'a.spec.js': ` const { test, expect } = require('@playwright/test'); @@ -688,7 +691,12 @@ test('should attach missing expectations to right step', async ({ runInlineTest } module.exports = Reporter; `, - ...playwrightConfig({ reporter: [['dot'], ['./reporter']] }), + ...playwrightConfig({ + reporter: [['dot'], ['./reporter']], + use: { + pageSnapshot: 'off', + } + }), 'a.spec.js': ` const { test, expect } = require('@playwright/test'); test('is a test', async ({ page }) => { @@ -1118,6 +1126,9 @@ test('should attach expected/actual/diff when sizes are different', async ({ run const result = await runInlineTest({ ...playwrightConfig({ snapshotPathTemplate: '__screenshots__/{testFilePath}/{arg}{ext}', + use: { + pageSnapshot: 'off', + }, }), '__screenshots__/a.spec.js/snapshot.png': createImage(2, 2), 'a.spec.js': ` @@ -1376,6 +1387,9 @@ test('should trim+sanitize attachment names and paths', async ({ runInlineTest } const result = await runInlineTest({ ...playwrightConfig({ snapshotPathTemplate: '__screenshots__/{testFilePath}/{arg}{ext}', + use: { + pageSnapshot: 'off', + } }), 'a.spec.js': ` const { test, expect } = require('@playwright/test');