Skip to content
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

Feat/update-snapshots #17

Merged
merged 8 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@ Upon a pull request being closed, the Tesults branch target is deleted via the s

### Lighthouse
I'm using the [Google Lighthouse](https://developers.google.com/web/tools/lighthouse) NPM package for performance and additional accessibility testing. The test setup and execution is a bit unique tests so I've separated them into their own spec file, they use a unique config file, and they are uploaded to Tesults separately from the other tests. [See the directory here](https://github.com/angelo-loria/playwright-boilerplate/tree/main/tests/lighthouse). I've added a specific script in the [package.json](https://github.com/angelo-loria/playwright-boilerplate/blob/main/package.json) file for executing these tests with their specific config file and running the [tesults-lighthouse.js](https://github.com/angelo-loria/playwright-boilerplate/blob/main/.scripts/tesults-lighthouse.js) script afterwards. The script uses the Tesults npm package to upload the results to Tesults to a specific target that's set up with the results interpretation feature to display the individual Lighthouse scores for each page. [It looks pretty slick](https://www.tesults.com/angelo-loria/acme-store-demo/lighthouse). Tesults is hosting the Lighthouse HTML reports and they're uploaded as artifacts to Github Actions as well. [Here's what one of those reports looks like.](https://www.tesults.com/results/files/pdl30/48242328-a7eb-4ab4-8065-3a3686634e5c-1701748288944-1701750294894-0/0/about.html)

### Visual Testing
The visual tests are done using Playwright's [toHaveScreenshot()](https://playwright.dev/docs/test-snapshots). I did have to come up with a way to regenerate them via Actions, which you can see in the [workflows directory](https://github.com/angelo-loria/playwright-boilerplate/blob/main/.github/workflows/update-snapshot.yml). This workflow uses Playwright's `--update-snapshots` CLI command to generate the new snapshots and then commits them to the branch via `stefanzweifel/git-auto-commit-action`.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading