test(ui-e2e): fix flaky repo wiki test (#7833)

The Webkit environment in CI for some reason has issues with the ratio, so decrease the ratio a bit for Webkit.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7833
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Beowulf <beowulf@beocode.eu>
Co-committed-by: Beowulf <beowulf@beocode.eu>
This commit is contained in:
Beowulf 2025-05-10 17:11:24 +00:00 committed by Gusted
parent a696ad132c
commit a50b467d9f

View file

@ -21,8 +21,10 @@ for (const searchTerm of ['space', 'consectetur']) {
// workaround: HTMX listens on keyup events, playwright's fill only triggers the input event
// so we manually "type" the last letter
await page.getByPlaceholder('Search wiki').dispatchEvent('keyup');
// timeout is necessary because HTMX search could be slow
await expect(page.locator('#wiki-search a[href]')).toBeInViewport({ratio: 1});
await expect(page.locator('#wiki-search a[href]')).toBeInViewport({
ratio: workerInfo.project.name === 'webkit' ? 0.9 : 1,
});
await save_visual(page);
});
}