Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

test: unflake "should close the context without awaiting the failed download" (#9094)

Dmitry Gozman1bebbc31b21e
diff --git a/tests/download.spec.ts b/tests/download.spec.ts
index a2318fcb6c..39a22f5f59 100644
--- a/tests/download.spec.ts
+++ b/tests/download.spec.ts
@@ -406,7 +406,10 @@ it.describe('download event', () => {
page.context().close(),
]);
expect(downloadPath).toBe(null);
- expect(saveError.message).toContain('File not found on disk. Check download.failure() for details.');
+ expect([
+ 'download.saveAs: File not found on disk. Check download.failure() for details.',
+ 'download.saveAs: canceled',
+ ]).toContain(saveError.message);
});
it('should close the context without awaiting the download', async ({browser, server, browserName, platform}, testInfo) => {