-
Notifications
You must be signed in to change notification settings - Fork 48
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
Set up Playwright screenshot testing #612
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
And added testing for `/blog/272`.
Also, slightly refactored `src\routes\(site)\about\officer-profile.svelte` to remove unused code.
And removed threshold of 0.1 since the default of 0.2 should be better. If not, we should bump it up to 0.3.
Added waitFor: 'network-idle' in an attempt to wait for the JS to load. Also removed tests for blog page since there is currently no way of running the Playwright tests with DEBUG_MODE_ENABLED sadly.
Replaced threshold with a starting `maxDiffPixelRatio: 0.1` and a lax threshold of `threshold: 1`.
HUGE 🧠 |
This kinda took way too long to test :/ BUT screenshot tests are cool and convenient.
- Mobile matches Samsung Galaxy S7 Edge - Tablet matches Samsung Galaxy Tab 10
652ec34
to
a3b9007
Compare
32e86e5
to
29a0712
Compare
29a0712
to
f7a74fd
Compare
This PR is intended to introduce a new feature as a trial run. If the new feature (Playwright screenshot testing) works out to be more of a hinderance than a convenience, then I will remove this feature sometime near the end of the Fall 2022 semester. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i did not look at it so therefore i see no issues with it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What we can do now
npm t
has now been upgraded to include parallelized Playwright tests and screenshot diff testing. To specifically test the Playwright tests and not the Vitest tests, you may runnpm run test:browser
. Make some changes on screenshot-tested pages and give it a try!Change log
/tests/test.ts
tests into each page of the/src/routes/
directory.projectsFromMatrix
helper to generate a matrix of screenshots to be taken per page.vitest.config.ts
to exclude Playwright tests from the Vitest testing./src/routes/screenshots/
./1st
page./about
page./blog
page./blog/:id
page./events
page./nodebuds
page./privacy
page./quiz
page./teams
page.Resolves #557.