Added visual regression test

This commit is contained in:
CJ Patoilo 2016-07-31 21:28:58 -03:00
parent 527db9dfaf
commit ba298be4ad
10 changed files with 46 additions and 2 deletions

View File

@ -47,11 +47,13 @@
},
"devDependencies": {
"autoprefixer": "^6.3.6",
"backstopjs": "^1.3.5",
"browser-sync": "^2.13.0",
"node-sass": "^3.7.0",
"npm-run-all": "^2.1.1",
"onchange": "^2.4.0",
"postcss-cli": "^2.5.2"
"postcss-cli": "^2.5.2",
"slimerjs": "^0.906.2"
},
"engines": {
"node": "^6.0.0"
@ -63,6 +65,7 @@
"build": "npm-run-all sass autoprefixer banner",
"watch": "onchange src -- npm run build",
"serve": "browser-sync start -s test --ss dist -f dist",
"start": "npm-run-all -p watch serve"
"start": "npm-run-all -p watch serve",
"test": "cd node_modules/backstopjs && npm run test -- --configPath=../../test/visual/backstop.config.js && cd ../../"
}
}

View File

@ -0,0 +1,33 @@
module.exports = {
viewports: [
{ name: 'phone_v', width: 320, height: 480 },
{ name: 'phone_h', width: 480, height: 320 },
{ name: 'tablet_v', width: 768, height: 1024 },
{ name: 'tablet_h', width: 1024, height: 768 },
{ name: 'laptop', width: 1280, height: 800 },
{ name: 'desktop', width: 1920, height: 1080 }
],
scenarios: [{
label: 'Milligram | A minimalist CSS framework.',
url: 'http://localhost:3000',
hideSelectors: [],
removeSelectors: ['.__bs_notify__'],
selectors: ['body'],
readyEvent: null,
delay: 500,
misMatchThreshold: 0.1,
onBeforeScript: 'onBefore.js',
onReadyScript: 'onReady.js'
}],
paths: {
bitmaps_reference: '../../test/visual/reference',
bitmaps_test: '.tmp',
casper_scripts: '../../test/visual/fixtures',
compare_data: '.tmp/compare.json'
},
engine: 'slimerjs',
report: ['browser'],
casperFlags: [],
debug: false,
port: 3002
}

View File

@ -0,0 +1,4 @@
module.exports = function(casper, scenario, vp) {
casper.echo('onBeforeEach.js', 'INFO');
casper.wait(50);
};

View File

@ -0,0 +1,4 @@
module.exports = function(casper, scenario, vp) {
casper.echo('onReady.js', 'INFO');
casper.wait(50);
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB