tests: increase checkAccessibility timeout to 2s (#9137)

Because the flakiness of this check seems to be also present in Firefox, this is an attempt at reducing the flakiness, as an alternative to #9118.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9137
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
Co-authored-by: Antonin Delpeuch <antonin@delpeuch.eu>
Co-committed-by: Antonin Delpeuch <antonin@delpeuch.eu>
This commit is contained in:
Antonin Delpeuch 2025-09-02 16:08:58 +02:00 committed by Gusted
commit 8f4ebab023

View file

@ -22,19 +22,19 @@ export async function accessibilityCheck({page}: {page: Page}, includes: string[
// Have observed failures during this scanning which are understood to be caused by CSS transitions, either applied to
// whatever last action occurred on the page before `accessibilityCheck` was called, or during the transition from
// dark to light. As there are a variety of transitions in Forgejo's CSS files (primarily in fomantic) with ease
// elements between 0.1 and 0.3 seconds, we give the accessibility scanner up to 1s to settle into success for each
// elements between 0.1 and 0.3 seconds, we give the accessibility scanner up to 2s to settle into success for each
// scan.
await expect(async () => {
const accessibilityScanResults = await accessibilityScanner.analyze();
expect(accessibilityScanResults.violations).toEqual([]);
}).toPass({timeout: 1000});
}).toPass({timeout: 2000});
await page.emulateMedia({colorScheme: 'dark'});
await expect(async () => {
const accessibilityScanResults = await accessibilityScanner.analyze();
expect(accessibilityScanResults.violations).toEqual([]);
}).toPass({timeout: 1000});
}).toPass({timeout: 2000});
await page.emulateMedia({colorScheme: 'light'});
}