From 7f01f3cb208eb0dfe24cfe2b5f7bff4b226ec812 Mon Sep 17 00:00:00 2001 From: Otto Richter Date: Fri, 7 Feb 2025 09:24:53 +0000 Subject: [PATCH] [skip ci] Fix flaky clipboard test (#6827) The visual playwright tests for clipboard copy are flaky. The screenshot races against the modification of the tooltip, which makes the screenshots flap between "Copy to clipboard" and "Copied!". I fixed this in the second test and apparently forgot to copy it back to the first one. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6827 Reviewed-by: Gusted Co-authored-by: Otto Richter Co-committed-by: Otto Richter --- tests/e2e/clipboard-copy.test.e2e.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/e2e/clipboard-copy.test.e2e.ts b/tests/e2e/clipboard-copy.test.e2e.ts index 2ae0e0dfff..2517d07463 100644 --- a/tests/e2e/clipboard-copy.test.e2e.ts +++ b/tests/e2e/clipboard-copy.test.e2e.ts @@ -19,6 +19,7 @@ test('copy src file path to clipboard', async ({page}, workerInfo) => { await page.click('[data-clipboard-text]'); const clipboardText = await page.evaluate(() => navigator.clipboard.readText()); expect(clipboardText).toContain('README.md'); + await expect(page.getByText('Copied')).toBeVisible(); await save_visual(page); });