Skip to content

test: fix flaky partials opt-out tests by adding waitForNavigation()#3862

Open
SisyphusZheng wants to merge 1 commit into
freshframework:mainfrom
SisyphusZheng:fix/flaky-partials-tests
Open

test: fix flaky partials opt-out tests by adding waitForNavigation()#3862
SisyphusZheng wants to merge 1 commit into
freshframework:mainfrom
SisyphusZheng:fix/flaky-partials-tests

Conversation

@SisyphusZheng

@SisyphusZheng SisyphusZheng commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Two tests in partials_test.tsx were marked ignore: true due to flakiness.

Root Cause

Both tests click links with f-client-nav={false}, triggering full-page navigations. Neither waited for the navigation to complete:

// Broken (flaky) — click races with navigation
await page.locator(.update).click();
await page.locator(.done).wait();

The third test (opt out of partial navigation in island) uses the correct pattern and is NOT flaky:

// Correct — navigation is awaited
await Promise.all([
    page.waitForNavigation(),
    page.locator(.update).click(),
]);

Fix

Apply the same Promise.all([waitForNavigation(), click]) pattern to both flaky tests and remove the ignore: true markers.

Closes #3858

Two tests ('opt out of partial navigation' and 'opt out of partial navigation freshframework#2') were marked \ignore: true\ due to flakiness. Both tests click links with \-client-nav={false}\ which trigger full-page navigations, but neither waited for the navigation to complete before asserting on the new page.

The third test ('opt out of partial navigation in island') uses \Promise.all([page.waitForNavigation(), click])\ and is NOT flaky — confirming the root cause.

Fix: wrap both clicks in \Promise.all([page.waitForNavigation(), click()])\ and remove the \ignore: true\ markers.

Closes freshframework#3858
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: fix flaky partials tests missing waitForNavigation()

1 participant