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

test: refactor to use toHaveScreenshot #1314

Merged
merged 3 commits into from
Dec 14, 2023
Merged

test: refactor to use toHaveScreenshot #1314

merged 3 commits into from
Dec 14, 2023

Conversation

liamdebeasi
Copy link
Contributor

@liamdebeasi liamdebeasi commented Dec 14, 2023

This PR updates the Playwright tests to use the newer toHaveScreenshot API instead of toMatchSnapshot. The newer API produces smaller file sizes and reduces the flakiness of tests.

I also fixed an issue with one of our CI scripts. Currently, if a single test runner does not have any screenshots to update (but others potentially do) that single test runner will fail because a .zip is not created. I fixed this by verifying that the zip is only created if the updated-screenshots directory is not empty.

@liamdebeasi liamdebeasi marked this pull request as ready for review December 14, 2023 20:14
@liamdebeasi liamdebeasi enabled auto-merge (squash) December 14, 2023 20:15
@liamdebeasi liamdebeasi requested review from a team and thetaPC and removed request for a team December 14, 2023 20:50
Copy link
Contributor

@thetaPC thetaPC left a comment

Choose a reason for hiding this comment

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

LGTM

@liamdebeasi liamdebeasi merged commit c7f561c into main Dec 14, 2023
6 checks passed
@liamdebeasi liamdebeasi deleted the tohavescreenshot branch December 14, 2023 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants