This is currently set up for testing visual regressions in the components
package. The tests do not run on CI, and is meant as a testing tool for local development.
First, build and serve the E2E Storybook.
npm run storybook:e2e:dev
You are now ready to run the tests. The first run will generate the reference images, and subsequent runs will compare against them. (On the first run, you may be prompted to first install Playwright. If so, follow the instructions.)
npm run test:e2e:storybook
To update the reference images, pass the --update-snapshots
flag.
npm run test:e2e:storybook -- --update-snapshots
Any stories matching the glob patterns listed in the E2E Storybook config will be included in the special build. Note that these are exclusive fixtures for our tests, and are separate from the stories included in the main Storybook build to be published online.
The Playwright test files live in the specs
folder. See the E2E Tests README for general best practices.