Skip to content

Visual Regression Testing #2781

Closed
Closed
@joshblack

Description

@joshblack

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
  • 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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions