Skip to content
This repository was archived by the owner on Mar 5, 2022. It is now read-only.

Commit efa8689

Browse files
authored
Adding visual testing with Applitools example (#234)
1 parent 99a7443 commit efa8689

File tree

15 files changed

+1443
-0
lines changed

15 files changed

+1443
-0
lines changed

circle.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,19 @@ workflows:
9999
- store_artifacts:
100100
path: examples/visual-sudoku/cypress/snapshots
101101

102+
- cypress/run:
103+
name: Visual with Applitools
104+
executor: base-12-16-2
105+
requires:
106+
- Install
107+
# each example installs "cypress-react-unit-test" as a local dependency (symlink)
108+
install-command: npm install
109+
verify-command: echo 'Already verified'
110+
no-workspace: true
111+
working_directory: examples/visual-testing-with-applitools
112+
command: npm test
113+
store_artifacts: true
114+
102115
- cypress/run:
103116
name: Visual with Percy
104117
executor: base-12-16-2
@@ -169,6 +182,7 @@ workflows:
169182
- Visual Sudoku
170183
- Visual with Percy
171184
- Visual with Happo
185+
- Visual with Applitools
172186
install-command: echo 'Already installed'
173187
verify-command: echo 'Already verified'
174188
no-workspace: true
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# example: visual testing using Applitools
2+
3+
Shows how to use Applitools to visually check React charts made with [Victory](https://formidable.com/open-source/victory/) library.
4+
5+
![Screenshot](images/eyes.png)
6+
7+
See [src/Chart.spec.js](src/Chart.spec.js)
8+
9+
The `cy.eyes*` commands are ignored during local interactive run. On CI, the `cy.eyes*` send the snapshots to Applitools servers to be analyzed and compared against the baseline images.
10+
11+
![Test result](images/result.png)
12+
13+
For more information, see [Applitools tutorial](https://applitools.com/tutorials/cypress.html)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"fixturesFolder": false,
3+
"testFiles": "**/*spec.js",
4+
"viewportWidth": 1000,
5+
"viewportHeight": 1000,
6+
"experimentalComponentTesting": true,
7+
"componentFolder": "src",
8+
"video": false,
9+
"env": {
10+
"coverage": false
11+
}
12+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/// <reference types="cypress" />
2+
describe('integration spec', () => {
3+
it('works', () => {
4+
expect(1).to.equal(1)
5+
})
6+
})
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const preprocessor = require('../../../../plugins/react-scripts')
2+
module.exports = (on, config) => {
3+
preprocessor(on, config)
4+
// IMPORTANT to return the config object
5+
// with the any changed environment variables
6+
return config
7+
}
8+
require('@applitools/eyes-cypress')(module)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require('cypress-react-unit-test/dist/hooks')
2+
require('@applitools/eyes-cypress/commands')
404 KB
Loading
448 KB
Loading

0 commit comments

Comments
 (0)