use crash helper

This commit is contained in:
Simon Knott 2024-07-31 16:13:52 +02:00
parent 6edd10df6d
commit cc78c53093
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC

View file

@ -80,10 +80,10 @@ test('should be able to close context when page crashes', async ({ isAndroid, is
await page.context().close(); 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' }); test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/31907' });
const expectPromise = expect(page.getByText('child')).toBeVisible(); const expectPromise = expect(page.getByText('child')).toBeVisible();
await page.goto('chrome://crash').catch(e => {}); crash();
await expect(expectPromise).rejects.toThrowError(); await expect(expectPromise).rejects.toThrowError();
}); });