Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid login issue in deployment E2E tests #2065

Merged
merged 43 commits into from
Jan 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
119ad29
Avoid login issue in deployment E2E tests
brandonpayton Dec 10, 2024
1f4f74f
Pivot to a workaround that keeps login enabled
brandonpayton Dec 10, 2024
2bdbab5
Fix issue with page not reloading
brandonpayton Dec 10, 2024
a8629c7
Temp debug: Take screenshot of browser after locator timeout
brandonpayton Dec 11, 2024
6776594
Revert "Temp debug: Take screenshot of browser after locator timeout"
brandonpayton Dec 11, 2024
92ebfe2
Configure Playwright to take screenshots on failure
brandonpayton Dec 11, 2024
456aa11
Try using query params instead of hash for Blueprint
brandonpayton Dec 11, 2024
169bb33
Merge branch 'trunk' into fix-deployment-e2e-tests
adamziel Dec 11, 2024
259ecf2
Merge branch 'trunk' into fix-deployment-e2e-tests
adamziel Dec 18, 2024
0e9a5b4
Add small comment about lazy init of WXR reader (#2102)
brandonpayton Dec 18, 2024
72f3513
Refresh WordPress Nightly
Dec 19, 2024
4a9ad81
[Website] GitHub export modal: Correctly compute the root path when e…
adamziel Dec 19, 2024
2962af0
[Data Liberation] Add HTML to Blocks converter (#2095)
adamziel Dec 19, 2024
8faadbe
[Blueprints] Prevent plugin activation error if plugin redirects duri…
bgrgicak Dec 19, 2024
5f0bb04
Refresh WordPress Nightly
Dec 20, 2024
5045ebd
Refresh SQLite integration plugin
Dec 20, 2024
374a48f
Refresh WordPress Nightly
Dec 21, 2024
99a2a4b
Refresh SQLite integration plugin
Dec 21, 2024
83f2ac6
Refresh WordPress Nightly
Dec 22, 2024
eaea361
Refresh WordPress Nightly
Dec 23, 2024
3c3b11f
v1.0.18
Dec 23, 2024
3e3b496
chore: update changelog
Dec 23, 2024
c9ac4a5
Refresh WordPress Nightly
Dec 24, 2024
e00607a
Refresh WordPress Nightly
Dec 25, 2024
c01a979
Refresh WordPress Nightly
Dec 26, 2024
26fa7ab
Refresh WordPress Nightly
Dec 27, 2024
7d9fe0a
Refresh WordPress Nightly
Dec 28, 2024
599ffc5
Refresh WordPress Nightly
Dec 29, 2024
21c2bb9
Refresh WordPress Nightly
Dec 30, 2024
4b71712
v1.0.19
Dec 30, 2024
86f20bf
chore: update changelog
Dec 30, 2024
eba4bd5
Refresh WordPress Nightly
Dec 31, 2024
4953251
Temporarily enable always-on screenshots so we can grab new screensho…
brandonpayton Dec 31, 2024
2aa1f3d
Re-enable deployment e2e tests with login disabled
brandonpayton Dec 31, 2024
1c2fea4
Merge branch 'trunk' into fix-deployment-e2e-tests
brandonpayton Dec 31, 2024
d8ac5ca
Be explicit about PHP version to avoid conflict with old Playground b…
brandonpayton Jan 1, 2025
5654edc
See if shorthand param without blueprint avoids trying to use PHP 8.3…
brandonpayton Jan 1, 2025
8286f82
Fix an error and revert some unnecessary changes
brandonpayton Jan 1, 2025
01d4d19
Revert change to playwright config
brandonpayton Jan 1, 2025
318a671
Update deployment test snapshot images
brandonpayton Jan 1, 2025
18384c9
Correct comment typo
brandonpayton Jan 1, 2025
67b4e4b
Adjust expected webkit screenshot
brandonpayton Jan 1, 2025
5abd883
nit: consistently convert URL to string
brandonpayton Jan 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions packages/playground/website/playwright/e2e/deployment.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@ import { test, expect } from '../playground-fixtures.ts';
import { startVersionSwitchingServer as startServer } from '../version-switching-server.ts';

const port = 7999;
const url = `http://localhost:${port}`;
const url = new URL(`http://localhost:${port}`);
// Disable login because an old WP build used in this test
// blocks auto-login. This is because it has an admin user
// with an expired email verification window. If we do not
// disable auto-login, the old Playground build encounters
// a boot error.
url.searchParams.set('login', 'no');
// Specify the theme so we can assert against expected default content.
// This theme is also what the reference screenshots are based on.
url.searchParams.set('theme', 'twentytwentyfour');

const maxDiffPixels = 4000;

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

await page.goto(url);
await page.goto(url.href);
await website.waitForNestedIframes();
await expect(page).toHaveScreenshot('website-old.png', {
maxDiffPixels,
});

server!.switchToNewVersion();
await page.goto(url);
await page.goto(url.href);
await website.waitForNestedIframes();
await expect(
website.page.getByLabel('Open Site Manager')
).toBeVisible();
await expect(wordpress.locator('body')).toContainText('Edit site');
await expect(wordpress.locator('body')).toContainText(
'My WordPress Website'
);
});
}

Expand All @@ -79,7 +90,9 @@ test.skip(
server!.setHttpCacheEnabled(true);
server!.switchToMidVersion();

await page.goto(`${url}/?wp=6.5`);
const urlWithWordPress65 = new URL(url);
urlWithWordPress65.searchParams.set('wp', '6.5');
await page.goto(urlWithWordPress65.href);
await website.waitForNestedIframes();

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

await expect(website.page.getByLabel('Open Site Manager')).toBeVisible();
expect(wordpress.locator('body')).toContainText('Edit site');
await expect(wordpress.locator('body')).toContainText(
'My WordPress Website'
);

server!.kill();
await page.reload();
await website.waitForNestedIframes();

await expect(website.page.getByLabel('Open Site Manager')).toBeVisible();
expect(wordpress.locator('body')).toContainText('Edit site');
await expect(wordpress.locator('body')).toContainText(
'My WordPress Website'
);
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading