test: improve a few test runner tests that time out (#15287)

This commit is contained in:
Dmitry Gozman 2022-06-30 17:03:01 -07:00 committed by GitHub
parent aced45347b
commit dc1d8dc3da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -122,6 +122,8 @@ const testFiles = {
`, `,
}; };
test.slow(true, 'Multiple browser launches in each test');
test('should work with screenshot: on', async ({ runInlineTest }, testInfo) => { test('should work with screenshot: on', async ({ runInlineTest }, testInfo) => {
const result = await runInlineTest({ const result = await runInlineTest({
...testFiles, ...testFiles,

View File

@ -67,8 +67,7 @@ test('should run in three browsers with --browser', async ({ runInlineTest }) =>
`, `,
'a.test.ts': ` 'a.test.ts': `
const { test } = pwt; const { test } = pwt;
test('pass', async ({ page, browserName }) => { test('pass', async ({ browserName }) => {
expect(page.viewportSize()).toEqual({ width: 800, height: 800 });
console.log('\\n%%browser=' + browserName); console.log('\\n%%browser=' + browserName);
}); });
`, `,
@ -90,8 +89,7 @@ test('should run in one browser with --browser', async ({ runInlineTest }) => {
`, `,
'a.test.ts': ` 'a.test.ts': `
const { test } = pwt; const { test } = pwt;
test('pass', async ({ page, browserName }) => { test('pass', async ({ browserName }) => {
expect(page.viewportSize()).toEqual({ width: 800, height: 800 });
console.log('\\n%%browser=' + browserName); console.log('\\n%%browser=' + browserName);
}); });
`, `,
@ -406,7 +404,7 @@ test('should not report waitForEventInfo as pending', async ({ runInlineTest },
await page.click('text=Missing'); await page.click('text=Missing');
}); });
`, `,
}, { workers: 1, timeout: 2000 }); }, { workers: 1, timeout: 5000 });
expect(result.exitCode).toBe(1); expect(result.exitCode).toBe(1);
expect(result.passed).toBe(0); expect(result.passed).toBe(0);