-
Notifications
You must be signed in to change notification settings - Fork 115
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
Using playwright to generate snapshots #1589
Conversation
|
|
import {componentPreviews} from './helpers' | ||
|
||
test.beforeEach(async ({page}, testInfo) => { | ||
testInfo.snapshotSuffix = '' |
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.
Have you had any trouble with the snapshots on macOS and ubuntu with this change? Would definitely simplify stuff if we didn't have to use docker 👀
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 wasn't worried about it too much, in a codespace it's the same environment as CI. And if someone did run it on macos and checked it in, the ci would override them with new screenshots since we check in any changes the ci job detects.
snapshotDir: path.join(__dirname, '.playwright', 'screenshots'), | ||
|
||
/* Run tests in files in parallel */ | ||
fullyParallel: true, |
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.
Such a good option 🔥 Did not realize that it's parallel on test files by default
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.
So good 🔥
Description
This is a retry of the code removed in #1555. However it uses a different system playwright.
Following the lead of @joshblack in primer/react#2520 I'm setting up playwright to run our lookbook server and take screenshots of our previews.
Currently it takes a screenshot of the
default
preview, then tabs to focus the first focuable element on the page and takes another screenshot.I'd hope to add these extra features in follow up PRs.
Integration
No
Merge checklist