Update capabilities.spec.ts

Signed-off-by: Max Schmitt <max@schmitt.mx>
This commit is contained in:
Max Schmitt 2024-08-01 14:32:12 +02:00 committed by GitHub
parent 5784c2d17e
commit 56f15567e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -147,7 +147,7 @@ it('should not crash on showDirectoryPicker', async ({ page, server, browserName
const dir = await (window as any).showDirectoryPicker(); const dir = await (window as any).showDirectoryPicker();
return dir.name; return dir.name;
// In headless it throws (aborted), in headed it stalls (Test ended) and waits for the picker to be accepted. // In headless it throws (aborted), in headed it stalls (Test ended) and waits for the picker to be accepted.
}).catch(e => expect(e.message).toMatch(/((DOMException|AbortError): The user aborted a request|Test ended)/)); }).catch(e => expect(e.message).toMatch(/((DOMException|AbortError): .*The user aborted a request|Test ended)/));
// The dialog will not be accepted, so we just wait for some time to // The dialog will not be accepted, so we just wait for some time to
// to give the browser a chance to crash. // to give the browser a chance to crash.
await page.waitForTimeout(3_000); await page.waitForTimeout(3_000);