Integrate Visual Component Testing Into Your CI
Get continuous visual test automation by integrating Visual Component tests directly into your continuous integration (CI) build.
Screener will automatically run tests, and pass or fail your builds depending on visual regressions found.
Setup Steps
- After Screener is installed into your project, add the following command to your CI pipeline script:
npm run test-storybook
- Set the
baseBranch
option in yourscreener.config.js
file to the name of your base branch (learn why):
// screener.config.js
module.exports = {
...
baseBranch: 'master'
}
Additional Options
- Integrate into your GitHub PR workflow.
- We recommend securing your API Key by storing it as an environment variable (i.e., store it in an environment variable called
SCREENER_API_KEY
, then reference it in yourscreener.config.js
file withprocess.env.SCREENER_API_KEY
).
Examples
Screener will automatically pull the build number and branch name from the following CI tools:
- Jenkins
- CircleCI
- Travis CI
- GitHub Actions
- Bitbucket Pipelines
- Buildkite
- Visual Studio Team Services
- Codeship
- GitLab CI
- Drone
- Semaphore
- CircleCI
- Travis CI
- Bitbucket
- GitHub
- Other
.circleci/config.yml
version: 2
jobs:
build:
steps:
- checkout
- run: npm install
# Run Screener visual component tests
- run: npm run test-storybook
.travis.yml
install:
- npm install
script:
- npm test
# Run Screener visual component tests
- npm run test-storybook
bitbucket-pipelines.yml
pipelines:
default:
- step:
script:
- npm install
- npm test
# Run Screener visual component tests
- npm run test-storybook
.github/workflows/github-actions.yml
on: [push]
jobs:
default:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- run: npm install
- run: npm run test-storybook
General Example
npm install
# Run Screener visual component tests
npm run test-storybook
If you need help integrating Screener into your CI, or would like to see an example not listed here, contact our Support Team.