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 34 commits into
base: master
Choose a base branch
from

Conversation

cnotv
Copy link
Member

@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

Pass

Kapture.2025-01-15.at.17.27.56.mp4

Fail

Kapture.2025-01-15.at.17.31.09.mp4

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 4 times, most recently from e967888 to 3a13190 Compare January 13, 2025 19:38
@cnotv
Copy link
Member Author

cnotv commented Jan 16, 2025

Waiting for #1292, #13103 and #13085 to proceed.

@cnotv
Copy link
Member Author

cnotv commented Jan 23, 2025

As we agreed to keep operations separated, I'm removing QA as reviewers and pick someone else from the dev side as far as the pipeline goes green.

@cnotv cnotv force-pushed the feature/10469-visual-regressions branch from a6e9c51 to 00d8b25 Compare January 23, 2025 17:37
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