@@ -4,33 +4,16 @@ import { test, expect } from '../playground-fixtures.ts';
4
4
import { startVersionSwitchingServer as startServer } from '../version-switching-server.ts' ;
5
5
6
6
const port = 7999 ;
7
- const blueprint = {
8
- preferredVersions : {
9
- php : '8.0' ,
10
- wp : 'latest' ,
11
- } ,
12
- // Explicitly disable login because we have had trouble with
13
- // our older WP reference build refusing to login because the
14
- // admin email verification had expired.
15
- login : false ,
16
- steps : [
17
- {
18
- step : 'setSiteOptions' ,
19
- options : {
20
- // Set the admin email lifespan to the maximum value to prevent
21
- // the admin email from expiring and causing the login step to fail.
22
- // https://github.com/WordPress/wordpress-develop/blob/f008049c49195dbfa954631fecc7fbfff0cc8ca2/src/wp-login.php#L1379-L1388
23
- admin_email_lifespan : '2147483647' ,
24
- } ,
25
- } ,
26
- ] ,
27
- } ;
28
7
const url = new URL ( `http://localhost:${ port } ` ) ;
29
- // TODO: Say why
30
- url . searchParams . set (
31
- 'blueprint-url' ,
32
- `data:application/json;base64,${ btoa ( JSON . stringify ( blueprint ) ) } `
33
- ) ;
8
+ // Disable login because an old WP build used in this test
9
+ // blocks auto-login. This is because it has an admin user
10
+ // with an expired email verification window. If we do not
11
+ // disable auto-login, the old Playground build encounters
12
+ // a build error.
13
+ url . searchParams . set ( 'login' , 'no' ) ;
14
+ // Specify the theme so we can assert against expected default content.
15
+ // This theme is also what the reference screenshots are based on.
16
+ url . searchParams . set ( 'theme' , 'twentytwentyfour' ) ;
34
17
35
18
const maxDiffPixels = 4000 ;
36
19
@@ -81,7 +64,6 @@ for (const cachingEnabled of [true, false]) {
81
64
await expect ( page ) . toHaveScreenshot ( 'website-old.png' , {
82
65
maxDiffPixels,
83
66
} ) ;
84
- return ;
85
67
86
68
server ! . switchToNewVersion ( ) ;
87
69
// Reload the page instead of navigating to the URL again
@@ -92,7 +74,9 @@ for (const cachingEnabled of [true, false]) {
92
74
await expect (
93
75
website . page . getByLabel ( 'Open Site Manager' )
94
76
) . toBeVisible ( ) ;
95
- await expect ( wordpress . locator ( 'body' ) ) . toContainText ( 'Edit site' ) ;
77
+ await expect ( wordpress . locator ( 'body' ) ) . toContainText (
78
+ 'My WordPress Website'
79
+ ) ;
96
80
} ) ;
97
81
}
98
82
0 commit comments