Skip to content

Playwright: update @playwright/test to version 1.52.0 #69932

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

Closed

Conversation

yogeshbhutkar
Copy link
Contributor

@yogeshbhutkar yogeshbhutkar commented Apr 18, 2025

What?

This PR updates the @playwright/test package to version 1.52.0

What's new?

https://playwright.dev/docs/release-notes#version-152

Breaking Changes (Source: Playwright version 1.52.0 release notes)

  • Glob URL patterns in methods like page.route() do not support ? and [] anymore. We recommend using regular expressions instead.
  • Method route.continue() does not allow to override the Cookie header anymore. If a Cookie header is provided, it will be ignored, and the cookie will be loaded from the browser's cookie store. To set custom cookies, use browserContext.addCookies().
  • macOS 13 is now deprecated and will no longer receive WebKit updates. Please upgrade to a more recent macOS version to continue benefiting from the latest WebKit improvements.

Testing Instructions

  • Run an e2e test locally. New browsers should be downloaded, and the test should run successfully.
  • Confirm that the CI checks are all passing.

P.S. This PR also temporarily fixes the failing storybook smoke test (until the next playwright update occurs), which I believe would be caused by mismatching versions of @playwright/tests, inclusive of the peerDependencies.

Comment on lines +381 to +390
await page
.getByRole( 'document', { name: 'Block: Paragraph' } )
.first()
.click();

// Use Shift+click to select a range.
await page.keyboard.down( 'Shift' );
await page.keyboard.press( 'ArrowDown' );
await page.keyboard.press( 'ArrowDown' );
await page.keyboard.up( 'Shift' );
Copy link
Contributor Author

@yogeshbhutkar yogeshbhutkar Apr 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whenever I try selecting all blocks using primary+a, the block toolbar briefly appears and then disappears before the next UI update occurs. The current change fixes it.

Interestingly, I haven’t been able to reproduce this behavior in manual testing. I'd appreciate any insights or thoughts on what might be causing this and how to go about fixing the same.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very strange, I was able to reproduce this issue as well.

e94efec6a98ea17a80a5d2d6a65fbb0e.mp4

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found a consistent way to reproduce it, but gave up on tracking down the actual problem 😅. I'm not sure if it's worth it since I don't think it would happen in real-world scenarios.

Steps

  1. Ensure editor is non-iframed, by installing a block with apiVersions: 2.
  2. Add multiple blocks and select them for grouping.
  3. Change the default grouping block while blocks are selected - setGroupingBlockName.
  4. Notice that after clicking on Group action blocks get deselected and nothing happens.
  5. If you repeat the steps, everything works correctly. So it probably has something to do with already rendered toolbar 🤷

P.S. Everything works correctly with the iframed editor. This is how I fixed the failing e2e test in #70503.

Screencast

CleanShot.2025-07-30.at.14.54.57.mp4

@yogeshbhutkar yogeshbhutkar marked this pull request as ready for review April 18, 2025 12:46
Copy link

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Type-related labels to choose from: [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Technical Prototype, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core, Gutenberg Plugin.
  • Labels found: .

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

Copy link

github-actions bot commented Apr 18, 2025

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: yogeshbhutkar <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: Mamaduka <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@t-hamano t-hamano added the [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. label Apr 18, 2025
@@ -306,7 +306,7 @@ test.describe( 'Multi-block selection (@firefox, @webkit)', () => {

await page
.getByRole( 'document', { name: 'Block: Paragraph' } )
.click( { modifiers: [ 'Shift' ] } );
.dblclick( { modifiers: [ 'Shift' ] } );
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interestingly, the e2e tests here seem to only pass when I use dblclick 🤔.

Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

I suspect that the fact that two E2E tests failed is due to different versions of Chromium:

  • Playwright 1.51: 134.0.6998.35
  • Playwright 1.52: 136.0.7103.25

Changing the E2E tests themselves may mask the error, so it may be better to temporarily disable the storybook smoke test until we know the exact cause.

@Mamaduka
Copy link
Member

Changing the E2E tests themselves may mask the error, so it may be better to temporarily disable the storybook smoke test until we know the exact cause.

I agree. It appears that both tests requiring change are related to multi-selection. If the feature doesn't work with the latest Chrome version, we need to investigate the issue.

@t-hamano
Copy link
Contributor

I've merged #69943, which skips the Storybook smoke test. However, it would be a good idea to leave this PR open to investigate any issues that may arise in the latest browsers.

@Mamaduka
Copy link
Member

Mamaduka commented Jul 2, 2025

@yogeshbhutkar, with your permission, I will close this PR. I'll continue work in #70503 and try to debug the failing tests.

@Mamaduka Mamaduka closed this Jul 2, 2025
@yogeshbhutkar yogeshbhutkar deleted the upgrade-playwright-1.52.0 branch July 3, 2025 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants