From 55df07fd60a912139142b1edf209bae4b7c6ead4 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Mon, 20 Mar 2023 21:43:51 +0100 Subject: [PATCH] test: force crash tests on new worker and keep launchOptions (#21818) Fixes https://github.com/microsoft/playwright/issues/21810 --- tests/library/page-event-crash.spec.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/library/page-event-crash.spec.ts b/tests/library/page-event-crash.spec.ts index f9f20588f1..0d3b000bb2 100644 --- a/tests/library/page-event-crash.spec.ts +++ b/tests/library/page-event-crash.spec.ts @@ -17,7 +17,7 @@ import { contextTest as testBase, expect } from '../config/browserTest'; -const test = testBase.extend<{ crash: () => void }>({ +const test = testBase.extend<{ crash: () => void }, { dummy: string }>({ crash: async ({ page, toImpl, browserName }, run) => { run(() => { if (browserName === 'chromium') @@ -27,12 +27,11 @@ const test = testBase.extend<{ crash: () => void }>({ else if (browserName === 'firefox') toImpl(page)._delegate._session.send('Page.crash', {}).catch(e => {}); }); - } + }, + // Force a separate worker to avoid messing up with other tests. + dummy: ['', { scope: 'worker' }], }); -// Force a separate worker to avoid messing up with other tests. -test.use({ launchOptions: {} }); - test('should emit crash event when page crashes', async ({ page, crash }) => { await page.setContent(`
This page should crash
`); crash();