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

Screenshot Tests #35

Open
justinfagnani opened this issue Sep 12, 2020 · 3 comments
Open

Screenshot Tests #35

justinfagnani opened this issue Sep 12, 2020 · 3 comments

Comments

@justinfagnani
Copy link
Contributor

We need tests!

Testing this is complicated because of the service worker. Ideally we'd test the service worker under a number of the conditions that cause it to reload: initial visit, second visit, repeat visit with a stale worker, interacting with a page after the worker has been shut down, etc. The Workbox team might have some resources to help drive these scenarios.

We also need basic interaction tests: edit a file, see the change. And we need some visual regression tests.

We should probably look at using Web Test Runner, and use whatever it recommends for visual snapshot testing, if it does.

@justinfagnani
Copy link
Contributor Author

The Workbox team pointed me to this for an example: https://github.com/GoogleChromeLabs/sw-appcache-behavior/blob/master/tests/test-suite.js

@aomarks aomarks self-assigned this Oct 7, 2020
@aomarks aomarks added Type: Enhancement New feature or request and removed Type: Enhancement New feature or request labels Oct 7, 2020
@aomarks aomarks added the Type: Enhancement New feature or request label Oct 13, 2020
@aomarks aomarks changed the title Tests Screenshot Tests Oct 28, 2020
@e111077
Copy link
Member

e111077 commented Mar 30, 2021

This came into my twitter feed yesterday

https://www.npmjs.com/package/@web/test-runner-visual-regression

@43081j
Copy link

43081j commented Apr 2, 2021

Keep in mind they use pixelmatch internally, which can have trouble with font smoothing differences across different OSes. Most libraries will have the same problem, looks-same tries to handle this by some clever algorithms but still trips up on it sometimes.

Just something to take into account I guess. The one true solution is to always generate them in CI so they are consistent i think, knowing that people who clone the repo are likely to get slightly different screenshots.

@aomarks aomarks removed their assignment Jun 16, 2022
@aomarks aomarks removed the Type: Enhancement New feature or request label Jun 16, 2022
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

No branches or pull requests

4 participants