From 1e9668f8bd2bdd402df57163c097797c0a7ccc83 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Mon, 10 Apr 2023 14:15:06 -0700 Subject: [PATCH] test: download link with data url (#22312) References #21892 --- tests/library/download.spec.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/library/download.spec.ts b/tests/library/download.spec.ts index 8bfe003142..d6193f3031 100644 --- a/tests/library/download.spec.ts +++ b/tests/library/download.spec.ts @@ -705,6 +705,16 @@ it('should convert navigation to a resource with unsupported mime type into down await page.close(); }); +it('should download links with data url', async ({ page, isWindows, browserName }) => { + it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/21892' }); + it.fixme(browserName === 'webkit' && isWindows); + await page.setContent('Download!'); + const donwloadPromise = page.waitForEvent('download'); + await page.getByText('Download').click(); + const download = await donwloadPromise; + expect(download.suggestedFilename()).toBe('SomeFile.txt'); +}); + async function assertDownloadToPDF(download: Download, filePath: string) { expect(download.suggestedFilename()).toBe(path.basename(filePath)); const stream = await download.createReadStream();