Percy is a service that recognizes UI changes between pull requests. Read more about it here
- Ask wg-operations to add the project to Percy.
- Visit this link.
- Fill in the name with
[project-name]
and select the github repository of the project.
- Add the PERCY_TOKEN and PERCY_PROJECT env variables to the CI.
They can be found under
https://percy.io/renuo/[project-name]/settings
. - Also add PERCY_TARGET_BRANCH and set it to
develop
. Like that Percy always compares the screenshots to the develop branch.
- Add the gem
percy-capybara
to the test group in the Gemfile and runbundle install
. - Follow the setup instructions here
- If the application uses the gem
vcr
, follow the instructions here.
Create a snapshot in any capybara spec by adding the following line:
Percy::Capybara.snapshot(page, name: 'name of your snapshot')
Usually it's enough to add one screenshot for each view. In special cases you may want to add more screenshots.
For Percy to render all characters correctly, every page that has a screenshot needs to have
the header <meta charset="utf-8">
.