Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
63dff61b
Unverified
Commit
63dff61b
authored
Mar 16, 2026
by
Sebastian "Sebbie" Silbermann
Committed by
GitHub
Mar 16, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[test] More `instant-navs-devtools` deflaking (#91345)
parent
5dd48e35
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
13 deletions
+28
-13
instant-navs-devtools.test.ts
...p-dir/instant-navs-devtools/instant-navs-devtools.test.ts
+28
-13
No files found.
test/development/app-dir/instant-navs-devtools/instant-navs-devtools.test.ts
View file @
63dff61b
...
@@ -3,7 +3,7 @@ import { retry, toggleDevToolsIndicatorPopover } from 'next-test-utils'
...
@@ -3,7 +3,7 @@ import { retry, toggleDevToolsIndicatorPopover } from 'next-test-utils'
import
{
Playwright
}
from
'next-webdriver'
import
{
Playwright
}
from
'next-webdriver'
describe
(
'instant-nav-panel'
,
()
=>
{
describe
(
'instant-nav-panel'
,
()
=>
{
const
{
next
}
=
nextTestSetup
({
const
{
isNextDev
,
isTurbopack
,
next
}
=
nextTestSetup
({
files
:
__dirname
,
files
:
__dirname
,
})
})
...
@@ -14,12 +14,19 @@ describe('instant-nav-panel', () => {
...
@@ -14,12 +14,19 @@ describe('instant-nav-panel', () => {
await
new
Promise
((
resolve
)
=>
await
new
Promise
((
resolve
)
=>
setTimeout
(
setTimeout
(
resolve
,
resolve
,
// MENU_DURATION_MS
// MENU_DURATION_MS
+ some flakiness buffer
200
200
+
50
)
)
)
)
}
}
async
function
waitForInstantModeCookie
(
browser
:
Playwright
):
Promise
<
void
>
{
await
retry
(
async
()
=>
{
const
cookie
=
await
browser
.
eval
(()
=>
document
.
cookie
)
expect
(
cookie
).
toMatch
(
/next-instant-navigation-testing=
[^
;
]
+/
)
})
}
async
function
clearInstantModeCookie
(
browser
:
Playwright
)
{
async
function
clearInstantModeCookie
(
browser
:
Playwright
)
{
await
browser
.
eval
(()
=>
{
await
browser
.
eval
(()
=>
{
document
.
cookie
=
'next-instant-navigation-testing=; path=/; max-age=0'
document
.
cookie
=
'next-instant-navigation-testing=; path=/; max-age=0'
...
@@ -32,6 +39,7 @@ describe('instant-nav-panel', () => {
...
@@ -32,6 +39,7 @@ describe('instant-nav-panel', () => {
async
function
clickStartClientNav
(
browser
:
Playwright
)
{
async
function
clickStartClientNav
(
browser
:
Playwright
)
{
await
browser
.
elementByCssInstant
(
'[data-instant-nav-client]'
).
click
()
await
browser
.
elementByCssInstant
(
'[data-instant-nav-client]'
).
click
()
await
waitForInstantModeCookie
(
browser
)
}
}
async
function
getInstantNavPanelText
(
browser
:
Playwright
):
Promise
<
string
>
{
async
function
getInstantNavPanelText
(
browser
:
Playwright
):
Promise
<
string
>
{
...
@@ -84,6 +92,11 @@ describe('instant-nav-panel', () => {
...
@@ -84,6 +92,11 @@ describe('instant-nav-panel', () => {
})
})
it
(
'should show client nav state after clicking Start and navigating'
,
async
()
=>
{
it
(
'should show client nav state after clicking Start and navigating'
,
async
()
=>
{
const
targetPage
=
'/target-page/my-post?search=foo'
if
(
isNextDev
&&
!
isTurbopack
)
{
// warmup target page compilation before clicking Start, to avoid extra flakiness.
void
next
.
render
(
targetPage
).
catch
(()
=>
{})
}
const
browser
=
await
next
.
browser
(
'/'
)
const
browser
=
await
next
.
browser
(
'/'
)
await
clearInstantModeCookie
(
browser
)
await
clearInstantModeCookie
(
browser
)
await
browser
.
waitForElementByCss
(
'[data-testid="home-title"]'
)
await
browser
.
waitForElementByCss
(
'[data-testid="home-title"]'
)
...
@@ -94,10 +107,7 @@ describe('instant-nav-panel', () => {
...
@@ -94,10 +107,7 @@ describe('instant-nav-panel', () => {
await
clickStartClientNav
(
browser
)
await
clickStartClientNav
(
browser
)
// Cookie should now be set
// Cookie should now be set
await
retry
(
async
()
=>
{
await
waitForInstantModeCookie
(
browser
)
const
cookie
=
await
browser
.
eval
(()
=>
document
.
cookie
)
expect
(
cookie
).
toContain
(
'next-instant-navigation-testing='
)
})
// Panel should show client-nav-waiting state
// Panel should show client-nav-waiting state
await
retry
(
async
()
=>
{
await
retry
(
async
()
=>
{
...
@@ -107,9 +117,9 @@ describe('instant-nav-panel', () => {
...
@@ -107,9 +117,9 @@ describe('instant-nav-panel', () => {
})
})
// Navigate to target page via SPA (use eval to bypass overlay pointer interception)
// Navigate to target page via SPA (use eval to bypass overlay pointer interception)
await
browser
.
eval
(()
=>
{
await
browser
.
eval
((
page
)
=>
{
document
.
querySelector
<
HTMLAnchorElement
>
(
'#link-to-target'
)
!
.
click
()
document
.
querySelector
<
HTMLAnchorElement
>
(
`[href="
${
page
}
"]`
)
!
.
click
()
})
}
,
targetPage
)
// Panel should transition to client-nav state
// Panel should transition to client-nav state
await
retry
(
async
()
=>
{
await
retry
(
async
()
=>
{
...
@@ -124,6 +134,11 @@ describe('instant-nav-panel', () => {
...
@@ -124,6 +134,11 @@ describe('instant-nav-panel', () => {
})
})
it
(
'should show loading skeleton during SPA navigation after clicking Start'
,
async
()
=>
{
it
(
'should show loading skeleton during SPA navigation after clicking Start'
,
async
()
=>
{
const
targetPage
=
'/target-page/my-post?search=foo'
if
(
isNextDev
&&
!
isTurbopack
)
{
// warmup target page compilation before clicking Start, to avoid extra flakiness.
void
next
.
render
(
targetPage
).
catch
(()
=>
{})
}
const
browser
=
await
next
.
browser
(
'/'
)
const
browser
=
await
next
.
browser
(
'/'
)
await
clearInstantModeCookie
(
browser
)
await
clearInstantModeCookie
(
browser
)
await
browser
.
waitForElementByCss
(
'[data-testid="home-title"]'
)
await
browser
.
waitForElementByCss
(
'[data-testid="home-title"]'
)
...
@@ -134,9 +149,9 @@ describe('instant-nav-panel', () => {
...
@@ -134,9 +149,9 @@ describe('instant-nav-panel', () => {
await
clickStartClientNav
(
browser
)
await
clickStartClientNav
(
browser
)
// Navigate to target page via SPA (use eval to bypass overlay pointer interception)
// Navigate to target page via SPA (use eval to bypass overlay pointer interception)
await
browser
.
eval
(()
=>
{
await
browser
.
eval
((
page
)
=>
{
document
.
querySelector
<
HTMLAnchorElement
>
(
'#link-to-target'
)
!
.
click
()
document
.
querySelector
<
HTMLAnchorElement
>
(
`[href="
${
page
}
"]`
)
!
.
click
()
})
}
,
targetPage
)
// The data fetching skeleton should be visible (dynamic content is locked).
// The data fetching skeleton should be visible (dynamic content is locked).
// Use a longer timeout because dev mode needs to compile the target page.
// Use a longer timeout because dev mode needs to compile the target page.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment