test(test-runner): unflake override-timeout.spec.ts (#7869)

This commit is contained in:
Joel Einbinder 2021-07-29 15:34:46 -05:00 committed by GitHub
parent 82d2ec0b2d
commit 626dd23ce1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,12 +19,12 @@ import { test, expect } from './playwright-test-fixtures';
test('should consider dynamically set value', async ({ runInlineTest }) => { test('should consider dynamically set value', async ({ runInlineTest }) => {
const result = await runInlineTest({ const result = await runInlineTest({
'playwright.config.js': ` 'playwright.config.js': `
module.exports = { timeout: 100 }; module.exports = { timeout: 2000 };
`, `,
'a.test.js': ` 'a.test.js': `
const { test } = pwt; const { test } = pwt;
test('pass', ({}, testInfo) => { test('pass', ({}, testInfo) => {
expect(testInfo.timeout).toBe(100); expect(testInfo.timeout).toBe(2000);
}) })
` `
}); });
@ -36,8 +36,8 @@ test('should allow different timeouts', async ({ runInlineTest }) => {
const result = await runInlineTest({ const result = await runInlineTest({
'playwright.config.js': ` 'playwright.config.js': `
module.exports = { projects: [ module.exports = { projects: [
{ timeout: 200 }, { timeout: 2000 },
{ timeout: 100 }, { timeout: 4000 },
] }; ] };
`, `,
'a.test.js': ` 'a.test.js': `
@ -49,14 +49,14 @@ test('should allow different timeouts', async ({ runInlineTest }) => {
}); });
expect(result.exitCode).toBe(0); expect(result.exitCode).toBe(0);
expect(result.passed).toBe(2); expect(result.passed).toBe(2);
expect(result.output).toContain('timeout:100'); expect(result.output).toContain('timeout:2000');
expect(result.output).toContain('timeout:200'); expect(result.output).toContain('timeout:4000');
}); });
test('should prioritize value set via command line', async ({ runInlineTest }) => { test('should prioritize value set via command line', async ({ runInlineTest }) => {
const result = await runInlineTest({ const result = await runInlineTest({
'playwright.config.js': ` 'playwright.config.js': `
module.exports = { timeout: 100 }; module.exports = { timeout: 2000 };
`, `,
'a.test.js': ` 'a.test.js': `
const { test } = pwt; const { test } = pwt;