From 80b2ae267668a0af4b8e59fcec46c332431dc62d Mon Sep 17 00:00:00 2001 From: Richard R Date: Mon, 16 Feb 2026 01:50:43 -0700 Subject: [PATCH] test: improve test reliability and adjust timeouts Increase timeouts for export and navigation tests to 60 seconds to prevent flakiness. Remove brittle assertions checking for visible overlays in setup helpers to ensure more stable test execution. --- tests/export.spec.ts | 1 + tests/helpers.ts | 2 -- tests/navigation.spec.ts | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/export.spec.ts b/tests/export.spec.ts index 20c4dc7..9df454d 100644 --- a/tests/export.spec.ts +++ b/tests/export.spec.ts @@ -374,6 +374,7 @@ test('resets all MP3 audiobook PDF pages', async ({ page }, testInfo) => { }); test('regenerates a single MP3 audiobook PDF page and exports full audiobook', async ({ page }, testInfo) => { + test.setTimeout(60_000); await setupTest(page, testInfo); await uploadAndDisplay(page, 'sample.pdf'); diff --git a/tests/helpers.ts b/tests/helpers.ts index dc28392..e2ad12f 100644 --- a/tests/helpers.ts +++ b/tests/helpers.ts @@ -201,7 +201,6 @@ export async function setupTest(page: Page, testInfo?: TestInfo) { // HeadlessUI keeps dialogs in the DOM during leave transitions; "hidden" is enough // (we mainly need to ensure it no longer blocks pointer events). await page.getByRole('dialog', { name: /privacy/i }).waitFor({ state: 'hidden', timeout: 15000 }); - await expect(page.locator('.overlay-dim:visible')).toHaveCount(0); } catch { // ignore } @@ -221,7 +220,6 @@ export async function setupTest(page: Page, testInfo?: TestInfo) { // Click the "done" button to dismiss the welcome message await saveBtn.click(); await page.getByRole('dialog', { name: 'Settings' }).waitFor({ state: 'hidden', timeout: 15000 }); - await expect(page.locator('.overlay-dim:visible')).toHaveCount(0); } /** diff --git a/tests/navigation.spec.ts b/tests/navigation.spec.ts index 9bff884..bbd2113 100644 --- a/tests/navigation.spec.ts +++ b/tests/navigation.spec.ts @@ -65,6 +65,7 @@ test.describe('PDF view modes and Navigator', () => { }); test('switches Single/Dual/Scroll modes and uses Navigator to change page', async ({ page }) => { + test.setTimeout(60_000); // Open PDF viewer await uploadAndDisplay(page, 'sample.pdf'); await expect(page.locator('.react-pdf__Document')).toBeVisible({ timeout: 15000 });