diff --git a/tests/library/page-event-crash.spec.ts b/tests/library/page-event-crash.spec.ts index 939eed8134..c4ed7d1b26 100644 --- a/tests/library/page-event-crash.spec.ts +++ b/tests/library/page-event-crash.spec.ts @@ -80,10 +80,10 @@ test('should be able to close context when page crashes', async ({ isAndroid, is await page.context().close(); }); -test('should not hang when page crashed', async ({ page }) => { +test('should not hang when page crashed', async ({ page, crash }) => { test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/31907' }); const expectPromise = expect(page.getByText('child')).toBeVisible(); - await page.goto('chrome://crash').catch(e => {}); + crash(); await expect(expectPromise).rejects.toThrowError(); }); \ No newline at end of file