Skip to content

Commit 51f24e2

Browse files
Avoid login issue in deployment E2E tests (#2065)
## Motivation for the change, related issues The deployment E2E tests are currently broken. WP admin email verification for an old WP 6.5 build appears to be causing a login failure error during the deployment tests. An example of a failing screenshot comparison due to failed login is [here](https://github.com/WordPress/wordpress-playground/actions/runs/12232536614/job/34118248072#step:7:446). ## Implementation details This PR disables login to avoid problems with admin email verification on an old, pre-installed WP build. With this change, we are able to re-enable more deployment e2e tests. ## Testing Instructions (or ideally a Blueprint) - CI
1 parent 28a744d commit 51f24e2

File tree

4 files changed

+25
-8
lines changed

4 files changed

+25
-8
lines changed

packages/playground/website/playwright/e2e/deployment.spec.ts

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,16 @@ import { test, expect } from '../playground-fixtures.ts';
44
import { startVersionSwitchingServer as startServer } from '../version-switching-server.ts';
55

66
const port = 7999;
7-
const url = `http://localhost:${port}`;
7+
const url = new URL(`http://localhost:${port}`);
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 boot 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');
817

918
const maxDiffPixels = 4000;
1019

@@ -45,24 +54,26 @@ for (const cachingEnabled of [true, false]) {
4554
* The PR for fixing this issue is here:
4655
* https://github.com/WordPress/wordpress-playground/pull/2065
4756
*/
48-
test.skip(`When a new website version is deployed, it should be loaded upon a regular page refresh (with HTTP caching ${
57+
test(`When a new website version is deployed, it should be loaded upon a regular page refresh (with HTTP caching ${
4958
cachingEnabled ? 'enabled' : 'disabled'
5059
})`, async ({ website, page, wordpress }) => {
5160
server!.setHttpCacheEnabled(cachingEnabled);
5261

53-
await page.goto(url);
62+
await page.goto(url.href);
5463
await website.waitForNestedIframes();
5564
await expect(page).toHaveScreenshot('website-old.png', {
5665
maxDiffPixels,
5766
});
5867

5968
server!.switchToNewVersion();
60-
await page.goto(url);
69+
await page.goto(url.href);
6170
await website.waitForNestedIframes();
6271
await expect(
6372
website.page.getByLabel('Open Site Manager')
6473
).toBeVisible();
65-
await expect(wordpress.locator('body')).toContainText('Edit site');
74+
await expect(wordpress.locator('body')).toContainText(
75+
'My WordPress Website'
76+
);
6677
});
6778
}
6879

@@ -79,7 +90,9 @@ test.skip(
7990
server!.setHttpCacheEnabled(true);
8091
server!.switchToMidVersion();
8192

82-
await page.goto(`${url}/?wp=6.5`);
93+
const urlWithWordPress65 = new URL(url);
94+
urlWithWordPress65.searchParams.set('wp', '6.5');
95+
await page.goto(urlWithWordPress65.href);
8396
await website.waitForNestedIframes();
8497

8598
// Switching to the new app version does not trigger a page reload,
@@ -136,12 +149,16 @@ test('offline mode – the app should load even when the server goes offline', a
136149
await website.waitForNestedIframes();
137150

138151
await expect(website.page.getByLabel('Open Site Manager')).toBeVisible();
139-
expect(wordpress.locator('body')).toContainText('Edit site');
152+
await expect(wordpress.locator('body')).toContainText(
153+
'My WordPress Website'
154+
);
140155

141156
server!.kill();
142157
await page.reload();
143158
await website.waitForNestedIframes();
144159

145160
await expect(website.page.getByLabel('Open Site Manager')).toBeVisible();
146-
expect(wordpress.locator('body')).toContainText('Edit site');
161+
await expect(wordpress.locator('body')).toContainText(
162+
'My WordPress Website'
163+
);
147164
});
99.4 KB
Loading
51.5 KB
Loading
46.5 KB
Loading

0 commit comments

Comments
 (0)