Closed
Description
About
Currently, the project uses Chromatic which uses the project's storybook to generate snapshots. This setup currently has several limitations or challenges that we're running:
- We are currently hitting the snapshot limit for the free tier
- The current tier is 5,000 snapshots/month
- The next tier would be 35,000 snapshots/month at $149
- This setup only captures a story in the default theme
- We would like to capture snapshots at different component states which may not be represented through controls or require specific interactions
- We would also like to run axe against these kinds of scenarios, when applicable
- The review workflow runs outside of GitHub and unfortunately does not work for Pull Requests from forks
Approach
We are looking into using Playwright as an alternative for our Visual Regression Testing setup, along with using it as a way to report on Automated Accessibility Testing from axe. This approach will allow snapshots in the following situations:
- For stories in storybook
- For specific control values in storybook stories
- Across different themes
- Between various interactions or states
- Across breakpoints
- (If needed) Across different browsers
This approach will also include running and reporting axe results, in particular with custom rules that mirror dotcom's.
Checklist
- Install and configure Playwright in the project
- Add initial exploration for test structure and approach to snapshots and running axe
- Add visual regression testing and automated accessibility checking to the ci workflow
- Generate initial coverage for stories in storybook
- ActionList
- ActionMenu
- Autocomplete
- Avatar
- AvatarPair
- AvatarStack
- Breadcrumbs
- Button
- ButtonGroup
- Checkbox test(e2e): add Checkbox, FilteredActionList, and Token e2e tests #2802
- CheckboxGroup
- CounterLabel
- Dialog
- FilteredActionList test(e2e): add Checkbox, FilteredActionList, and Token e2e tests #2802
- FilteredSearch
- FilterList
- Flash
- FormControl
- Header
- Heading
- IconButton
- Label
- LabelGroup
- Link
- LinkButton
- NavList
- Overlay
- Pagehead
- PageLayout
- Pagination
- PointerBox
- Popover
- ProgressBar
- RelativeTime
- Radio
- RadioGroup
- SegmentedControl
- Select
- SelectPanel
- Spinner
- SplitPageLayout
- StateLabel
- SubNav
- ToggleSwitch
- TabNav
- Textarea
- Text
- TextInput
- TextInputWithTokens
- Timeline
- Token test(e2e): add Checkbox, FilteredActionList, and Token e2e tests #2802
- Tooltip
- Truncate
- UnderlineNav
- Dialog
- InlineAutocomplete
- TreeView
- PageHeader
- UnderlineNav
- Document the e2e workflow for visual regression testing for contributors
- Methodology
- Approach in CI
- Approval workflow
- Updating snapshots workflow
- Running locally
- Hiding elements
- Test flakiness, how to reliably interact and test with React 18
- Document the
@vrt
and@aat
tags for VRT and axe accordingly
What's next
- Add
matrix
test to components - Add interaction states, like focus or open