From 281469ebd1f3355dd92c16d88933edaac483cf86 Mon Sep 17 00:00:00 2001 From: 0ko <0ko@noreply.codeberg.org> Date: Tue, 10 Dec 2024 19:51:39 +0500 Subject: [PATCH] fix(e2e): clipboard read permission for Chromium --- playwright.config.ts | 2 ++ tests/e2e/clipboard-copy.test.e2e.ts | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index 0994c55045..d8a0e3ecf0 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -65,6 +65,7 @@ export default { /* Project-specific settings. */ use: { ...devices['Desktop Chrome'], + permissions: ['clipboard-read', 'clipboard-write'], }, }, @@ -87,6 +88,7 @@ export default { name: 'Mobile Chrome', use: { ...devices['Pixel 5'], + permissions: ['clipboard-read', 'clipboard-write'], }, }, { diff --git a/tests/e2e/clipboard-copy.test.e2e.ts b/tests/e2e/clipboard-copy.test.e2e.ts index 5d59f5b13c..70a3425868 100644 --- a/tests/e2e/clipboard-copy.test.e2e.ts +++ b/tests/e2e/clipboard-copy.test.e2e.ts @@ -10,11 +10,9 @@ import {expect} from '@playwright/test'; import {test} from './utils_e2e.ts'; -test.use({ - permissions: ['clipboard-write'], -}); +test('copy src file path to clipboard', async ({page}, workerInfo) => { + test.skip(['Mobile Safari', 'webkit'].includes(workerInfo.project.name), 'Apple clipboard API addon - starting at just $499!'); -test('copy src file path to clipboard', async ({page}) => { const response = await page.goto('/user2/repo1/src/branch/master/README.md'); expect(response?.status()).toBe(200); @@ -23,7 +21,9 @@ test('copy src file path to clipboard', async ({page}) => { expect(clipboardText).toContain('README.md'); }); -test('copy diff file path to clipboard', async ({page}) => { +test('copy diff file path to clipboard', async ({page}, workerInfo) => { + test.skip(['Mobile Safari', 'webkit'].includes(workerInfo.project.name), 'Apple clipboard API addon - starting at just $499!'); + const response = await page.goto('/user2/repo1/src/commit/65f1bf27bc3bf70f64657658635e66094edbcb4d/README.md'); expect(response?.status()).toBe(200);