Create new github action to manually generate linux playwright snapshots
Modify participant CI github action to output playwright test results if playwright test fails
Context for reviewers
Testing instructions, background context, more in-depth details of the implementation, and anything else you'd like to call out or ask reviewers. Explain how the changes were verified.
This PR introduces a new Github Action that lets you update Playwright snapshots in a linux environment. Because Playwright is running headless browsers, that means that there are minute differences between snapshots created on macOS (our dev environment) vs linux (the environment that we run all our github actions on). The new github action will generate new or update existing snapshots and then commit them back to the feature branch. The new github action will not allow you to run this workflow on main.
The workflow for making new playwright tests will be:
Write your code and write your playwright test (e.g. .spec.ts)
Commit and push your feature branch to github
Go to Actions, select the "Playwright snapshots" action in the left sidebar
Click the "Run workflow" dropdown and select the app you want to update (i.e. participant or staff)
Run the workflow to generate the snapshots and commit to your branch
On your local environment, pull down the new commit git pull origin <feature-branch>
Create your PR in github
This PR also adds the ability to view the test results from failed Playwright CI jobs. You can now download the diff pngs so you can see what Playwright sees.
Testing
Screenshots, GIF demos, code examples or output to help show the changes working as expected. ProTip: you can drag and drop or paste images into this textbox.
It's not possible to run a newly created Github Action as a manual workflow on a branch. So, I modified an existing Github Action to test the "generate linux playwright snapshots" functionality.
Ticket
https://wicmtdp.atlassian.net/browse/PRP-238
Changes
Context for reviewers
This PR introduces a new Github Action that lets you update Playwright snapshots in a linux environment. Because Playwright is running headless browsers, that means that there are minute differences between snapshots created on macOS (our dev environment) vs linux (the environment that we run all our github actions on). The new github action will generate new or update existing snapshots and then commit them back to the feature branch. The new github action will not allow you to run this workflow on
main
.The workflow for making new playwright tests will be:
git pull origin <feature-branch>
This PR also adds the ability to view the test results from failed Playwright CI jobs. You can now download the diff pngs so you can see what Playwright sees.
Testing
It's not possible to run a newly created Github Action as a manual workflow on a branch. So, I modified an existing Github Action to test the "generate linux playwright snapshots" functionality.
Here's an example of the failed Playwright test artifacts:
Here's an example of what a passing Playwright CI job looks like (note that there are no test artifacts):