Skip to content

Latest commit

 

History

History
29 lines (18 loc) · 1.18 KB

README.md

File metadata and controls

29 lines (18 loc) · 1.18 KB

Storybook Playwright Tests

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.

How to run

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

How to write tests

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.