fix(test-runner): default @playwright/test timeout to 0 (#7312)

All actions for the `@playwright/test` actions inside test should
have default 0 timeout. This way they will never clash with the
test timeout.
This commit is contained in:
Andrey Lushnikov 2021-06-24 23:28:01 -07:00 committed by GitHub
parent b963dbbe3c
commit 1157f622f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,6 +39,7 @@ export const test = _baseTest.extend<PlaywrightTestArgs & PlaywrightTestOptions,
throw new Error(`Unexpected browserName "${browserName}", must be one of "chromium", "firefox" or "webkit"`);
const options: LaunchOptions = {
handleSIGINT: false,
timeout: 0,
...launchOptions,
};
if (headless !== undefined)
@ -140,6 +141,7 @@ export const test = _baseTest.extend<PlaywrightTestArgs & PlaywrightTestOptions,
options.viewport = viewport;
const context = await browser.newContext(options);
context.setDefaultTimeout(0);
const allPages: Page[] = [];
context.on('page', page => allPages.push(page));