test: fail faster if browser crashes (#12310)

This commit is contained in:
Nikolay Vitkov 2024-04-23 17:01:56 +02:00 committed by GitHub
parent a94fee9c66
commit be259de95f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -161,6 +161,7 @@ export const setupTestBrowserHooks = (): void => {
state.browser = await puppeteer.launch({
...processVariables.defaultBrowserOptions,
timeout: this.timeout() - 1_000,
protocolTimeout: this.timeout() * 2,
});
}
} catch (error) {
@ -207,6 +208,8 @@ export const getTestState = async (
if (!state.browser) {
throw new Error('Browser was not set-up in time!');
} else if (!state.browser.connected) {
throw new Error('Browser has disconnected!');
}
if (state.context) {