Skip to content
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

Setup and introduce visual testing tools and CI #13035

Open
wants to merge 31 commits into
base: master
Choose a base branch
from

Conversation

cnotv
Copy link
Contributor

@cnotv cnotv commented Jan 9, 2025

Summary

Fixes #9057

This is an abstract of what I'll present in the demo.

Occurred changes and/or fixed issues

Introduced visual testing which will ensure components do not change styles. The whole process is an E2E test of Cypress running over Storybook.

Every component of our styleguide will be then tested.
Single abstracted views would need to be added in Storybook as sample pages.

Images generated for visual regressions are hosted in this project under ./visual/snapshots.

Technical notes summary

  • Created configuration:
    • cypress.visual.config.ts Cypress configuration to run over Storybook
    • ./visual containing all the code, tests, and images for the tests
  • Added commands
    • yarn visual for running the tests in CI; run yarn storybook prior this
    • yarn visual:open for developing mode with head to see the UI; run yarn storybook prior this
    • yarn visual:ci for executing concurrently Storybook and visual tests
  • Created new CI pipeline in GH
  • Added library @emerson-eps/cypress-image-snapshot, but considering replacing it with single libraries if we rewrite the code

Areas or cases that should be tested

Areas which could experience regressions

New pipeline Tests / visual-test should pass.
Command yarn visual should run the test (run Storybook first).

Screenshot/Video

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes

@cnotv cnotv requested review from nwmac, a-arias and rancher-max January 9, 2025 19:19
@rancher-ui-project-bot rancher-ui-project-bot bot added this to the v2.12.0 milestone Jan 9, 2025
@cnotv cnotv force-pushed the feature/10469-visual-regressions branch from f38b1ad to 48151c0 Compare January 9, 2025 19:25
@cnotv cnotv force-pushed the feature/10469-visual-regressions branch from 3031529 to b12912d Compare January 10, 2025 10:08
@cnotv cnotv force-pushed the feature/10469-visual-regressions branch from b12912d to e967888 Compare January 10, 2025 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setup and introduce visual testing tools and CI
1 participant