Upgrade Playwright to v1.60#78632
Conversation
jsnajdr
left a comment
There was a problem hiding this comment.
Good idea, should cause no trouble. The other day I did an upgrade from 1.58 to 1.59 locally, in an attempt to find a bug, but never committed it as a PR.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: +118 B (0%) Total Size: 7.51 MB 📦 View Changed
|
c5ae24e to
b1221cd
Compare
d247f19 to
524f7a5
Compare
|
It looks like previews end up with stale windows in the latest Chrome and DIP enabled. Pushed some test code for confirmations. Here's the finding from Claude's debug sessions: Summary
Playwright 1.60 ships Chrome for Testing 148 (1.58 used 145). The failing e2e tests aren't a test-infra issue — they're surfacing a Chromium 148 regression in Proven by toggling the
Proven by toggling the
|
|
I guess we can wait until the next release and see if the issue is fixed in the next Chrome upgrade cc @adamsilverstein, just in case you've seen any similar reports. |
524f7a5 to
d102b08
Compare
d102b08 to
6433751
Compare
| }, | ||
| "peerDependencies": { | ||
| "@playwright/test": "^1.58.2", | ||
| "@playwright/test": "^1.61.0", |
There was a problem hiding this comment.
Peer dependency should usually be the lowest supported version.
Also, IMHO, this peer dep here should be made optional, otherwise it breaks in strict peer deps mode for consumers.
There was a problem hiding this comment.
What's your recommendation?
There was a problem hiding this comment.
Leave this unchanged and add the updated version as a dev dependency, as the package uses it but doesn't declare it and it receives the dependency from hoisting.
There was a problem hiding this comment.
Add this to peerDependenciesMeta below
"@playwright/test": {
"optional": true
},There was a problem hiding this comment.
Looking at the Git history, we've been bumping these versions alongside others. I don't remember exactly, but I think there were some version mismatches in the past on wordpress-develop.
P.S. I'm not against making those changes, mostly was double-checking previous updates.
There was a problem hiding this comment.
Yes, but it's better to go with best practices.
There was a problem hiding this comment.
From my perspective, the peer dependency should be as wide as we can possibly allow based on what we actually need to use from this package or are fearful could break in how we use in future versions, even * or >=1. As best I can tell, that's whatever version provides a /cli export that accepts as 'test' argument and config flags and returns a 0 or non-0 status code, which is probably... all of them, forever? (i.e. *) We could add an upper bound like <= 2 or ^1 if we worry about those expectations breaking in a future major version.
The advantage being that this is a lot less annoying for downstream consumers. Why should someone have to bump their @playwright/test when upgrading @wordpress/scripts, if we're not actually doing anything in @wordpress/scripts that needs that newer version?
That's not to say we don't want to be using the same, consistent version across Gutenberg and/or wordpress-develop, but that's a project-level concern. We are our own consumer. So defining devDependencies with the higher version number makes sense so that we are using the one, newer version that has the new feature we want to use.
|
Heads up: Following #79221, we will need to update the dependency in root package.json as well. |
|
It looks like Chrome and DIP issues still exist even after the recent Chromium version bump in Playwright - #78632 (comment). That's a blocker for this update, until those issues are tested and resolved manually :( |
|
I'm afraid that the When opening a preview (in
The code that crashes is the The https://issues.chromium.org/issues/336222177 bug is not really that related. It's about |
|
Locally I'm able to fix the preview window error by adding these two lines before previewWindow.location = 'about:blank';
await new Promise( ( r ) => setTimeout( r, 100 ) );
writeInterstitialMessage( previewWindow.document );The point is to reset the preview window location to The 100ms wait is there to wait until the window really loads the new location. We can't add event listeners ( If only we could tidy up this patch and make it production-ready, it would also fix the issue. |
Catching up here... DIP shouldn't be active on previews, are you seeing it active there? If so, maybe we missed something or something changed? Are there steps to reproduce this manually? is this for previews in a new tab pr inline? |
DIP is active only on the main editor tab, on the preview tabs it's not active. But that's enough to put both tabs into different "agent clusters", and they become isolated from each other. Like if they were cross-origin.
Yes, it's very straighforward:
It's supposed to save the latest edits and update the existing preview tab with new content. But the actual result is that the tab still shows the old content, and in console there is a security error that the preview tab's |
Thanks for clarifying, this helps me understand the issue more clearly.
Ah - I didn't realize we were doing this kind of inter-tab communication for the preview window.
That fix makes sense, but feels a bit fragile. I wonder if we could catch the error if it occurs and retry, in case the tab takes longer to reset to about:blank? I don't quite understand how upgrading Playwright exposed this bug; regardless it feels like something we legitimately need to fix! Thanks for the ping. |
…atest-base # Conflicts: # package-lock.json # test/storybook-playwright/package.json
The root package.json still pinned @playwright/test at ^1.58.2 while the workspaces were bumped to ^1.61.0, failing 'lint:deps' (syncpack) which requires a single version across the repo.
oh, I see - its an issue with the new Chrome version. |
The Playwright 1.60 upgrade ships Chrome for Testing 148, which has a regression in the cross-origin isolated `isolate-and-credentialless` Document-Isolation-Policy runtime that Gutenberg sends on editor screens. Under it three suites fail although the product behaves correctly on shipping Chrome: client-side media processing silently falls back to the server (so format/rotation/sub-size assertions break), and the preload and Loading Patterns specs never reach a settled state so they time out. Gate these specs on the major Chromium version so they skip on 148+ until the browser regression is resolved, mirroring the existing 137+ gate used for Document-Isolation-Policy. See WordPress#78632.
|
I spent more time on this and discovered the underlying cause of the client side media failures issue wasn't quite what we expected. I opened a follow up issue just to fix this in #79377. The short version is:
The solution I came up with in #79378 should resolve the issue. I'm going to open a draft PR combining that with the Playwright update to verify CI goes green. |
I opened a draft combined PR in #79381 that include the Playwright upgrade, the preview timing fix and the wasm loading fix. If CI goes green it will validate the fixes resolve the issues. |
Revert the CSM e2e rework (un-skipping the suite on Chromium 148, realigning format/rotation expectations, and expanding EXIF-orientation coverage) that accumulated on this branch during CI debugging. The base AVIF decode test fails under the bundled Chrome for Testing 148/149 because of the cross-origin-isolated wasm-vips decode race tracked in WordPress#78632, which is a CI browser regression rather than anything this preview-fix PR changes. Restore the `chromiumVersion >= 148` skip gate so the CSM suite skips on the upgraded CI browser, keeping this PR scoped to the preview interstitial fix. The EXIF sub-size rotation coverage lives in WordPress#79384, which targets trunk.
The Playwright 1.60 upgrade ships Chrome for Testing 148, which has a regression in the cross-origin isolated `isolate-and-credentialless` Document-Isolation-Policy runtime that Gutenberg sends on editor screens. Under it three suites fail although the product behaves correctly on shipping Chrome: client-side media processing silently falls back to the server (so format/rotation/sub-size assertions break), and the preload and Loading Patterns specs never reach a settled state so they time out. Gate these specs on the major Chromium version so they skip on 148+ until the browser regression is resolved, mirroring the existing 137+ gate used for Document-Isolation-Policy. See WordPress#78632.
Revert the CSM e2e rework (un-skipping the suite on Chromium 148, realigning format/rotation expectations, and expanding EXIF-orientation coverage) that accumulated on this branch during CI debugging. The base AVIF decode test fails under the bundled Chrome for Testing 148/149 because of the cross-origin-isolated wasm-vips decode race tracked in WordPress#78632, which is a CI browser regression rather than anything this preview-fix PR changes. Restore the `chromiumVersion >= 148` skip gate so the CSM suite skips on the upgraded CI browser, keeping this PR scoped to the preview interstitial fix. The EXIF sub-size rotation coverage lives in WordPress#79384, which targets trunk.
Bring the playwright-upgrade base current with trunk (was 63 commits behind). Resolve test/e2e/package.json and package-lock.json conflicts: keep the @playwright/test 1.61.0 bump and trunk's new @flakiness/playwright dependency.
The Playwright 1.60 upgrade ships Chrome for Testing 148, which has a regression in the cross-origin isolated `isolate-and-credentialless` Document-Isolation-Policy runtime that Gutenberg sends on editor screens. Under it three suites fail although the product behaves correctly on shipping Chrome: client-side media processing silently falls back to the server (so format/rotation/sub-size assertions break), and the preload and Loading Patterns specs never reach a settled state so they time out. Gate these specs on the major Chromium version so they skip on 148+ until the browser regression is resolved, mirroring the existing 137+ gate used for Document-Isolation-Policy. See WordPress#78632.
Revert the CSM e2e rework (un-skipping the suite on Chromium 148, realigning format/rotation expectations, and expanding EXIF-orientation coverage) that accumulated on this branch during CI debugging. The base AVIF decode test fails under the bundled Chrome for Testing 148/149 because of the cross-origin-isolated wasm-vips decode race tracked in WordPress#78632, which is a CI browser regression rather than anything this preview-fix PR changes. Restore the `chromiumVersion >= 148` skip gate so the CSM suite skips on the upgraded CI browser, keeping this PR scoped to the preview interstitial fix. The EXIF sub-size rotation coverage lives in WordPress#79384, which targets trunk.
…enable client-side media e2e on Chromium 148+ (#79495) Co-authored-by: adamsilverstein <adamsilverstein@git.wordpress.org> Co-authored-by: jsnajdr <jsnajdr@git.wordpress.org>
|
Tests should go green after aade9a4 |
What?
Upgrade Playwright to v1.60.
What's new?
https://playwright.dev/docs/release-notes#version-160
I think new
page.locator('#dropzone').dropcould be useful for our tests. I'll start looking into migrations as a follow-up. The new description option could also be handy.Testing Instructions