#59517 closed enhancement (fixed)
Migrate Puppeteer tests to Playwright
Reported by: | swissspidy | Owned by: | swissspidy |
---|---|---|---|
Milestone: | 6.4 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description
As announced in https://make.wordpress.org/core/2022/03/23/migrating-wordpress-e2e-tests-to-playwright, Gutenberg contributors have made great progress in updating the setup to a point where it has become very easy to migrate all browser-based tests to Playwright, and all existing tests in core can now be safely converted as well.
Migrating the tests to Playwright not only is in accordance with the plan outlined in that post, it also helps address the intermittent timeout failures we're constantly seeing in core.
Because of that, and since changes to tests and build tools can happen during beta periods as well, I am marking this with the 6.4 milestone.
Change History (18)
This ticket was mentioned in PR #5333 on WordPress/wordpress-develop by @swissspidy.
12 months ago
#1
- Keywords has-patch has-unit-tests added
This ticket was mentioned in Slack in #core-test by brianhenryie. View the logs.
11 months ago
This ticket was mentioned in Slack in #core-performance by joemcgill. View the logs.
11 months ago
#4
@
11 months ago
- Owner set to swissspidy
- Resolution set to fixed
- Status changed from assigned to closed
In 56926:
@swissspidy commented on PR #5333:
11 months ago
#6
Committed in https://core.trac.wordpress.org/changeset/56926 🎉
Thanks y'all!
#10
@
11 months ago
Note:
after [56926], for all the ones who previously ran the Core visual regression tests locally, all the existing files in the tests/visual-regression/specs/__image_snapshots__/
directory will be reported by git as 'Untracked files'. This is because of the changes to the .gitignore
file.
If you don't need those snapshot images any longer, you can safely delete them and after next tests run they will be generated in the new path tests/visual-regression/specs/__snapshots__/
.
@swissspidy I'd suggest to consider to keep the old path in the .gitignore
file, just to avoid unnecessary headache for contributors.
#11
@
11 months ago
We discussed that on the PR but decided it's not worth it as it will only affect very few contributors and deleting files is quickly done. This change has also been called out in a make/core post.
#13
@
11 months ago
- Resolution fixed deleted
- Status changed from closed to reopened
It looks like [56926] removed the PUPPETEER_SKIP_DOWNLOAD
env variable from a few workflow files:
.github/workflows/coding-standards.yml .github/workflows/end-to-end-tests.yml .github/workflows/performance.yml .github/workflows/phpunit-tests-run.yml .github/workflows/test-coverage.yml .github/workflows/test-npm.yml
I noticed a recent test failure (from 12 hours ago) that seems to be related to this:
npm ERR! code 1 npm ERR! path /home/runner/work/wordpress-develop/wordpress-develop/node_modules/puppeteer npm ERR! command failed npm ERR! command sh -c -- node install.js npm ERR! ERROR: Failed to set up Chromium r1108766! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download. npm ERR! Error: read ECONNRESET npm ERR! at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20) { npm ERR! errno: -104, npm ERR! code: 'ECONNRESET', npm ERR! syscall: 'read' npm ERR! }
Looking at package-lock.json
, it appears that puppeteer
is still a dependency of some packages, specifically grunt-contrib-qunit
.
Should the PUPPETEER_SKIP_DOWNLOAD
env variable perhaps be reinstated for now, to avoid downloading Chromium in the workflows that don't need it?
#14
@
11 months ago
Ugh, I didn't realize those tests use Puppeteer. I just opened #59644 for migrating them to something more maintainable.
In the meantime I will reinstate those env vars. Thanks!
As per https://make.wordpress.org/core/2022/03/23/migrating-wordpress-e2e-tests-to-playwright/, this migrates all Puppeteer usage in core to Playwright.
To-do
Trac ticket: https://core.trac.wordpress.org/ticket/59517