This commit is contained in:
Simon Knott 2024-07-23 15:15:35 +02:00
parent d23ea26947
commit a41e566c9e
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC

View file

@ -220,6 +220,37 @@ test('should watch new file', async ({ runUITest, writeFiles }) => {
`);
});
test('should run added test in watched file', async ({ runUITest, writeFiles }) => {
const { page } = await runUITest({
'a.test.ts': `
import { test } from '@playwright/test';
test('foo', () => {});
`,
});
await page.getByText('a.test.ts').click();
await page.getByRole('listitem').filter({ hasText: 'a.test.ts' }).getByTitle('Watch').click();
await expect.poll(dumpTestTree(page)).toBe(`
a.test.ts 👁 <=
foo
`);
await writeFiles({
'a.test.ts': `
import { test } from '@playwright/test';
test('foo', () => {});
test('bar', () => {});
`,
});
await expect.poll(dumpTestTree(page)).toBe(`
a.test.ts 👁 <=
foo
bar
`);
});
test('should queue watches', async ({ runUITest, writeFiles, createLatch }) => {
const latch = createLatch();
const { page } = await runUITest({