File tree 4 files changed +34
-2
lines changed 4 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,7 @@ jobs:
111
111
- name : Install Nextjs in app-pages-router
112
112
working-directory : examples/app-pages-router
113
113
run : pnpm add next@${{ needs.check_next_version.outputs.previousNextVersion }}
114
+ # We do not install the latest canary of Next in the experimental app.
114
115
115
116
- name : Get Playwright version
116
117
id : playwright-version
@@ -157,6 +158,8 @@ jobs:
157
158
echo "PAGES_ROUTER_URL=$PAGES_ROUTER_URL" >> $GITHUB_ENV
158
159
APP_PAGES_ROUTER_URL=$(jq -r '.["e2e-example-AppPagesRouter"].url' .sst/outputs.json)
159
160
echo "APP_PAGES_ROUTER_URL=$APP_PAGES_ROUTER_URL" >> $GITHUB_ENV
161
+ EXPERIMENTAL_APP_URL=$(jq -r '.["e2e-example-Experimental"].url' .sst/outputs.json)
162
+ echo "EXPERIMENTAL_APP_URL=$EXPERIMENTAL_APP_URL" >> $GITHUB_ENV
160
163
161
164
- name : Run e2e Test
162
165
run : npm run e2e:test
Original file line number Diff line number Diff line change 4
4
"private" : true ,
5
5
"scripts" : {
6
6
"openbuild" : " node ../../packages/open-next/dist/index.js build" ,
7
- "dev" : " next dev --turbopack" ,
7
+ "dev" : " next dev --turbopack --port 3004 " ,
8
8
"build" : " next build" ,
9
- "start" : " next start" ,
9
+ "start" : " next start --port 3004 " ,
10
10
"lint" : " next lint" ,
11
11
"clean" : " rm -rf .turbo node_modules .next .open-next"
12
12
},
Original file line number Diff line number Diff line change @@ -23,5 +23,12 @@ export default defineConfig({
23
23
baseURL : process . env . APP_PAGES_ROUTER_URL || "http://localhost:3003" ,
24
24
} ,
25
25
} ,
26
+ {
27
+ name : "experimental" ,
28
+ testMatch : [ "tests/experimental/*.test.ts" ] ,
29
+ use : {
30
+ baseURL : process . env . EXPERIMENTAL_APP_URL || "http://localhost:3004" ,
31
+ } ,
32
+ } ,
26
33
] ,
27
34
} ) ;
Original file line number Diff line number Diff line change
1
+ import { expect , test } from "@playwright/test" ;
2
+
3
+ test ( "PPR should show loading first" , async ( { page } ) => {
4
+ await page . goto ( "/" ) ;
5
+ await page . getByRole ( "link" , { name : "Incremental PPR" } ) . click ( ) ;
6
+ await page . waitForURL ( "/ppr" ) ;
7
+ const loading = page . getByText ( "Loading..." ) ;
8
+ await expect ( loading ) . toBeVisible ( ) ;
9
+ const el = page . getByText ( "Dynamic Component" ) ;
10
+ await expect ( el ) . toBeVisible ( ) ;
11
+ } ) ;
12
+
13
+ test ( "PPR rsc prefetch request should be cached" , async ( { request } ) => {
14
+ const resp = await request . get ( "/ppr" , {
15
+ headers : { rsc : "1" , "next-router-prefetch" : "1" } ,
16
+ } ) ;
17
+ expect ( resp . status ( ) ) . toEqual ( 200 ) ;
18
+ const headers = resp . headers ( ) ;
19
+ expect ( headers [ "x-nextjs-postponed" ] ) . toEqual ( "1" ) ;
20
+ expect ( headers [ "x-nextjs-cache" ] ) . toEqual ( "HIT" ) ;
21
+ expect ( headers [ "cache-control" ] ) . toEqual ( "s-maxage=31536000" ) ;
22
+ } ) ;
You can’t perform that action at this time.
0 commit comments