[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 <gusted@noreply.codeberg.org>
Co-authored-by: Otto Richter <otto@codeberg.org>
Co-committed-by: Otto Richter <otto@codeberg.org>
This commit is contained in:
Otto Richter 2025-02-07 09:24:53 +00:00 committed by Gusted
parent f90bf425ad
commit 7f01f3cb20

View file

@ -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);
});