File tree Expand file tree Collapse file tree 4 files changed +25
-6
lines changed
Expand file tree Collapse file tree 4 files changed +25
-6
lines changed Original file line number Diff line number Diff line change @@ -12,4 +12,5 @@ html-report
1212/typings
1313.grunt
1414npm-debug.log
15- visual-test
15+ visual-test /
16+ example-test /
Original file line number Diff line number Diff line change @@ -74,9 +74,9 @@ $ npm install intern @theintern/visual-plugin --save-dev
7474
7575Ok! You want to see all the great things visual regression testing can do and
7676how to do it! See some real test code by looking in the
77- [ tests/visual ] ( ./tests/visual ) directory.
77+ [ tests/example ] ( ./tests/example ) directory.
7878
79- To run our visual regression tests:
79+ To run the example tests:
8080
81811 . Clone this project
82821 . Install package dependencies
@@ -85,9 +85,14 @@ To run our visual regression tests:
8585 ```
86861. Run the tests
8787 ```
88- npm test
88+ npm test config=@example
8989 ```
9090
91+ If you want to see what an error looks like, modify the HTML file used by the
92+ tests, in `_tests/tests/support/pages/basic.html`. For example, change the
93+ paragraph text, or change the background color from pink to green. Then re-run
94+ the test. It will fail, and a report will be generated in `visual-tests/report`.
95+
9196## API and architecture
9297
9398This plugin has three main exports:
Original file line number Diff line number Diff line change 5555 ],
5656 "tunnel" : " browserstack" ,
5757 "maxConcurrency" : 1
58+ },
59+
60+ "example" : {
61+ "environments" : " chrome" ,
62+ "functionalSuites" : " _tests/tests/example/**/*.js" ,
63+ "coverage" : [],
64+ "reporters" : " runner" ,
65+ "plugins" : {
66+ "script" : " _tests/src" ,
67+ "options" : {
68+ "directory" : " example-test"
69+ }
70+ }
5871 }
5972 }
6073}
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ registerSuite('example tests', {
1414 url : basicPageUrl ,
1515 width : 640 ,
1616 height : 480 ,
17- missingBaseline : 'ignore '
17+ missingBaseline : 'snapshot '
1818 } ) ,
1919
2020 'custom visual test' ( ) {
@@ -24,7 +24,7 @@ registerSuite('example tests', {
2424 . takeScreenshot ( )
2525 . then (
2626 assertVisuals ( this , {
27- missingBaseline : 'ignore '
27+ missingBaseline : 'snapshot '
2828 } )
2929 ) ;
3030 }
You can’t perform that action at this time.
0 commit comments