From 1701df8fadf15a0595b5a9e1836b52bc048caf57 Mon Sep 17 00:00:00 2001 From: Fabian Engelniederhammer Date: Mon, 7 Oct 2024 16:28:48 +0200 Subject: [PATCH] tests(website): skip download tests in webkit webkit seems to ignore the content disposition header. It doesn't download the file, instead it displays it. resolves #2963 --- .../tests/pages/submission/template.spec.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/website/tests/pages/submission/template.spec.ts b/website/tests/pages/submission/template.spec.ts index 2f407d8cf..73725d02f 100644 --- a/website/tests/pages/submission/template.spec.ts +++ b/website/tests/pages/submission/template.spec.ts @@ -3,7 +3,13 @@ import type { Download } from '@playwright/test'; import { expect, test } from '../../e2e.fixture.ts'; test.describe('The submit page', () => { - test('should download the metadata file template for submission', async ({ submitPage, loginAsTestUser }) => { + test('should download the metadata file template for submission', async ({ + submitPage, + loginAsTestUser, + browserName, + }) => { + skipDownloadTestInWebkit(browserName); + const { groupId } = await loginAsTestUser(); await submitPage.goto(groupId); @@ -18,7 +24,10 @@ test.describe('The submit page', () => { revisePage, submitPage, loginAsTestUser, + browserName, }) => { + skipDownloadTestInWebkit(browserName); + const { groupId } = await loginAsTestUser(); await revisePage.goto(groupId); @@ -37,4 +46,12 @@ test.describe('The submit page', () => { readable.on('end', () => resolve(data)); }); } + + function skipDownloadTestInWebkit(browserName: 'chromium' | 'firefox' | 'webkit') { + test.skip( + browserName === 'webkit', + 'webkit seems to ignore the content disposition header.\n' + + "It doesn't download the file, instead it displays it.", + ); + } });