-
Notifications
You must be signed in to change notification settings - Fork 69
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
npm script to update e2e-pw screenshots / snapshots #9544
base: develop
Are you sure you want to change the base?
Conversation
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: 0 B Total Size: 1.33 MB ℹ️ View Unchanged
|
@shendy-a8c @Jinksi can you work together to log an issue for the bug / pain point affecting us here. We need to align on the problem before we merge a solution/fix (e.g. this PR), and that issue will be helpful context if we need to revisit the npm script in future. Thank you 🙌 |
@shendy-a8c Unfortunately (or fortunately), I've found the "fix" for the issue, which is really my user-error and subsequent misdirection in the The command required to update snapshots is incorrectly stated in the readme as: -npm run test:e2e-pw --update-snapshots
+npm run test:e2e-pw -- --update-snapshots Since we're running an So we should be able to simply update the README rather than add a new script in this PR (sorry!).
-- `npm run test:e2e-pw --update-snapshots` updates snapshots.
+- `npm run test:e2e-pw -- --update-snapshots` updates snapshots. This can be combined with a keyword to update a specific set of snapshots, e.g. `npm run test:e2e-pw -- --update-snapshots deposits`. Note I've opened #9563 to address this |
@shendy-a8c this is not ideal, and I can reproduce it. We have set a manual
|
@haszari @shendy-a8c I've opened #9562 for this issue, after digging into the cause above. |
# Conflicts: # tests/e2e-pw/README.md
@Jinksi IMO, there's still value to add it as npm script just like unit test's command to update snapshot I have updated the script by adding the dashes dbdb95f.
|
Fixes #9596.
Changes proposed in this Pull Request
There is already one to update snapshot for unit tests:
npm run test:update-snapshots
.However, I couldn't find one for Playwright e2e tests, so I added one:
npm run test:e2e-pw-update-snapshots
.ps: the test fails the screenshot comparison if you make huge UI change (maybe to the point where the screenshot dimension should be different) but if it's just a text change, it passes, which unexpected for me, but it's out of the scope of this PR.
Testing instructions
npm run build:client
.npm run test:e2e-pw merchant-admin-deposits
which will run this test.npm run test:e2e-pw-update-snapshots
to update the screenshot. Deleting it first is essential. Otherwise, the screenshot won't get updated. I got the hint from this comment. @Jinksi believes it's a bug though.npm run test:e2e-pw merchant-admin-deposits
again and confirm it passes this time.npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge