File tree Expand file tree Collapse file tree 16 files changed +211
-167
lines changed
Expand file tree Collapse file tree 16 files changed +211
-167
lines changed Original file line number Diff line number Diff line change 1+ version : 2
2+ jobs :
3+ build :
4+ docker :
5+ - image : circleci/node:7
6+ steps :
7+ - checkout
8+ - restore_cache :
9+ key : dependency-cache-{{ checksum "package.json" }}
10+ - run :
11+ name : install-packages
12+ command : npm install
13+ - save_cache :
14+ key : dependency-cache-{{ checksum "package.json" }}
15+ paths :
16+ - .node_modules
17+ - run :
18+ name : test
19+ command : npm test
20+
21+ workflows :
22+ version : 2
23+ build_and_test :
24+ jobs :
25+ - build
Original file line number Diff line number Diff line change 1+ ### Methods
2+
3+ | Method| Arguments| description|
4+ | ------| ---------| -----------|
5+ | ` update ` | [ TestOptions] ( https://github.com/NimaSoroush/differencify#testoptions ) | Creates reference screenshots|
6+ | ` test ` | [ TestOptions] ( https://github.com/NimaSoroush/differencify#testoptions ) | Validate your changes by testing against reference screenshots|
7+ | ` cleanup ` | no argument| Closes all leftover browser instances|
Original file line number Diff line number Diff line change 1+ ## [ 0.0.11] - 2017-07-21
2+ ### Added
3+ - Added cleanup functionality
4+ - Added circleci to project
5+
16## [ 0.0.10] - 2017-07-07
27### Added
38- Added chromy.screenshot()
Original file line number Diff line number Diff line change @@ -6,18 +6,20 @@ Regression Testing suite!
66</p >
77<br >
88
9+ Status: [ ![ CircleCI] ( https://circleci.com/gh/NimaSoroush/differencify/tree/master.svg?style=svg )] ( https://circleci.com/gh/NimaSoroush/differencify/tree/master )
10+
911## About
1012
1113Differencify is library for visual regression testing by comparing your locall changes with reference screenshots of your website.
1214
1315## Requirements
1416- Node > 6
15- - Chrome > 59 or [ Chrome Canary] ( https://confluence.skyscannertools.net/display/DW/Shared+Cache+Client )
17+ - Chrome > 59 or [ Chrome Canary] ( https://www.google.co.uk/chrome/browser/canary.html )
1618
1719## Installation
1820Install the module:
1921``` bash
20- npm install --save-dev differencify
22+ npm install differencify
2123```
2224## Usage
2325``` js
@@ -39,6 +41,10 @@ async () => {
3941}
4042```
4143
44+ ### API
45+
46+ See [ API.md] ( API.md ) for full list of API calls
47+
4248### GlobalOptions
4349
4450| Parameter| type| required| description| default|
Original file line number Diff line number Diff line change 1- export default {
1+ exports . default = {
22 screenshots : './screenshots' ,
33 debug : false ,
44 visible : true ,
Original file line number Diff line number Diff line change 1- export default {
1+ exports . default = {
22 name : 'default' ,
33 resolution : {
44 width : 1366 ,
Original file line number Diff line number Diff line change 11const Differencify = require ( 'differencify' ) ;
2- const globalConfig = require ( './configs/global-config' ) ;
3- const testConfig = require ( './configs/test-config' ) ;
2+ const globalConfig = require ( './configs/global-config' ) . default ;
3+ const testConfig = require ( './configs/test-config' ) . default ;
44
55const differencify = new Differencify ( globalConfig ) ;
66
7- differencify . test ( testConfig ) . then ( ( r ) => {
8- console . log ( r ) ;
7+ differencify . test ( testConfig ) . then ( ( result ) => {
8+ console . log ( result ) ; // true or false
9+ differencify . cleanup ( ) ;
910} ) ;
Original file line number Diff line number Diff line change 11const Differencify = require ( 'differencify' ) ;
2- const globalConfig = require ( './configs/global-config' ) ;
3- const testConfig = require ( './configs/test-config' ) ;
2+ const globalConfig = require ( './configs/global-config' ) . default ;
3+ const testConfig = require ( './configs/test-config' ) . default ;
44
55const differencify = new Differencify ( globalConfig ) ;
66
7- differencify . update ( testConfig ) . then ( ( r ) => {
8- console . log ( r ) ;
7+ differencify . update ( testConfig ) . then ( ( result ) => {
8+ console . log ( result ) ; // true or false
9+ differencify . cleanup ( ) ;
910} ) ;
Original file line number Diff line number Diff line change @@ -2,11 +2,14 @@ import Differencify from 'differencify';
22import globalConfig from './configs/global-config' ;
33import testConfig from './configs/test-config' ;
44
5- const differencify = new Differencify ( globalConfig ) ;
5+ const differencify = new Differencify ( globalConfig . default ) ;
66
77describe ( 'My website' , ( ) => {
8+ afterAll ( ( ) => {
9+ differencify . cleanup ( ) ;
10+ } ) ;
811 it ( 'validate visual regression test' , async ( ) => {
9- const result = await differencify . test ( testConfig ) ;
12+ const result = await differencify . test ( testConfig . default ) ;
1013 expect ( result ) . toEqual ( true ) ;
1114 } , 30000 ) ;
1215} ) ;
Original file line number Diff line number Diff line change 11{
22 "name" : " differencify" ,
3- "version" : " 0.0.10 " ,
3+ "version" : " 0.0.11 " ,
44 "description" : " Perceptual diffing tool" ,
55 "main" : " dist/index.js" ,
66 "scripts" : {
3333 "babel-preset-env" : " ^1.5.2" ,
3434 "babel-preset-es2015" : " ^6.24.1" ,
3535 "babel-preset-jest" : " ^20.0.3" ,
36- "eslint" : " ^3.10.2 " ,
36+ "eslint" : " ^3.19.0 " ,
3737 "eslint-config-airbnb" : " ^13.0.0" ,
3838 "eslint-plugin-import" : " ^2.2.0" ,
3939 "eslint-plugin-jsx-a11y" : " ^2.2.3" ,
You can’t perform that action at this time.
0 commit comments