chore(ui): ensure that --ignore-snapshots is respected (#32875)

Closes https://github.com/microsoft/playwright/issues/32868.

The actual fix was already delivered in
https://github.com/microsoft/playwright/pull/32798/files#diff-98ff2ff92b08ca7e8b274abb3ba6b2eec9bab332e340d062cc18ad1dfe505bf2R299,
this PR adds a test to ensure we don't regress.
This commit is contained in:
Simon Knott 2024-09-30 15:12:37 +02:00 committed by GitHub
parent b78103ba50
commit c67a7335ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 21 additions and 1 deletions

View File

@ -502,4 +502,24 @@ test('should respect --tsconfig option', {
`);
await expect(page.getByTestId('status-line')).toHaveText('1/1 passed (100%)');
});
});
test('should respect --ignore-snapshots option', {
annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/32868' }
}, async ({ runUITest }) => {
const { page } = await runUITest({
'a.test.ts': `
import { test, expect } from '@playwright/test';
test('snapshot', () => {
expect('foo').toMatchSnapshot(); // fails because no snapshot is present
});
`,
}, undefined, { additionalArgs: ['--ignore-snapshots'] });
await page.getByTitle('Run all').click();
await expect.poll(dumpTestTree(page)).toBe(`
a.test.ts
snapshot
`);
});