Skip to content

Commit 3fb10e1

Browse files
authored
test: flaky timeout when clicking Create New button in versions test suite (#15850)
### What Fixed flaky test `"collection - autosave - should not create duplicates when clicking Create new"` that was timing out on navigation. <img width="1233" height="529" alt="Screenshot 2026-03-04 at 4 49 47 PM" src="https://github.com/user-attachments/assets/e5c5c9a9-65ca-4cde-8c49-372978956179" /> ### Why Next.js 16 hydration can cause buttons to appear clickable before they're fully interactive. Clicking the "Create New" button resulted in 30s timeouts waiting for navigation that never happened. ### How Extract the `href` attribute from the button and navigate directly to it instead of clicking. This avoids the hydration timing issue while still validating the button exists and has the correct href.
1 parent 649f117 commit 3fb10e1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

test/versions/e2e.spec.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,9 +566,8 @@ describe('Versions', () => {
566566

567567
await page.goto(autosaveURL.list)
568568
const createNewButton = page.locator('.list-header .btn:has-text("Create New")')
569-
await createNewButton.click()
570-
571-
await page.waitForURL(`**/${autosaveCollectionSlug}/**`)
569+
const href = await createNewButton.getAttribute('href')
570+
await page.goto(`${serverURL}${href}`)
572571

573572
await page.locator('#field-title').fill('autosave title')
574573
await waitForAutoSaveToRunAndComplete(page)

0 commit comments

Comments
 (0)