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

Added Visual Regression Testing via percy.io #18797

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ jobs:
script:
- npm run test-php && npm run test-unit-php-multisite

- name: Visual Regression Tests
install:
- npm ci
script:
- npm run storybook:snapshot"

- name: E2E tests (Admin) (1/4)
env: FORCE_REDUCED_MOTION=true PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=
script:
Expand Down
15 changes: 15 additions & 0 deletions docs/contributors/testing-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,21 @@ Sometimes we need to mock refs for some stories which use them. Check the follow
- [Using createNodeMock to mock refs](https://github.com/storybookjs/storybook/tree/master/addons/storyshots/storyshots-core#using-createnodemock-to-mock-refs) with StoryShots.

In that case, you might see test failures and `TypeError` reported by Jest in the lines which try to access a property from `ref.current`. If this happens, search for `initStoryshots` method call, which contains all necessary configurations to adjust.

### Visual Regression Testing

> [@percy/storybook](https://docs.percy.io/docs/storybook) adds automattic Visual Regression Testing for [Storybook](https://storybook.js.org/).

A Visual Regression Test compares a screenshot of the UI before a change is made with a screenshot of the UI after a change is made.

Subtle changes to HTML markup or CSS rules can result in significant visual changes to a UI, particularly when layout is affected. When changes to HTML markup or CSS rules are subtle it can be difficult to assess from a diff what impact the change might have on the visuals.

The Visual Regression Tests are setup to run across multiple browsers and can find visual flaws caused by browser inconsistencies.

The tests are automated saving time and effort for a human to review all the stories in all the browsers.

The visual regression tests run on CI and failing tests will need to be [reviewed](https://docs.percy.io/docs/github#section-step-3-run-and-review-builds) by a contributor.

## Native mobile testing

Part of the unit-tests suite is a set of Jest tests run exercise native-mobile codepaths, developed in React Native. Since those tests run on Node, they can be launched locally on your development machine without the need for specific native Android or iOS dev tools or SDKs. It also means that they can be debugged using typical dev tools. Read on for instructions how to debug.
Expand Down
273 changes: 273 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading