Skip to content

Instantly share code, notes, and snippets.

@VesterDe
Created April 5, 2018 13:30
Show Gist options
  • Save VesterDe/8fd7e8152e7330802b32c30f75c42945 to your computer and use it in GitHub Desktop.
Save VesterDe/8fd7e8152e7330802b32c30f75c42945 to your computer and use it in GitHub Desktop.
let fs = require('fs');
var credentials;
if(fs.existsSync('credentials.json')){
credentials = JSON.parse(fs.readFileSync('credentials.json', 'utf8'));
}
else{
credentials = {};
}
var httpUser = process.env.basicHttpUser || credentials['devDomainUser'];
var httpPass = process.env.basicHttpPass || credentials['devDomainPass'];
const singleUrlDefaults = {
"hideSelectors": [],
"removeSelectors": [],
"selectors": [],
"readyEvent": null,
"delay": 500,
"onReadyScript": null,
"onBeforeScript": null,
"httpUser": httpUser,
"httpPass": httpPass
}
const scenarios = [
{
"label": "EN Home",
"url": /*removed*/
},
];
function getScenarios(scenarios){
return scenarios.map(el => {
return Object.assign(
{},
singleUrlDefaults,
el,
)
});
}
module.exports = {
"id": 'DEV',
"viewports": [
{
"name": "phone",
"width": 320,
"height": 480
}, {
"name": "tablet_v",
"width": 568,
"height": 1024
}, {
"name": "tablet_h",
"width": 1024,
"height": 768
}
],
"scenarios": getScenarios(scenarios),
"paths": {
"bitmaps_reference": "backstop_data/bitmaps_reference",
"bitmaps_test": "backstop_data/bitmaps_test",
"compare_data": "backstop_data/bitmaps_test/compare.json",
"engine_scripts": "backstop_data/engine_scripts/casper"
},
"engine": "casperjs",
"report": ["CI"],
"cliExitOnFail": false,
"asyncCaptureLimit": 5,
"asyncCompareLimit": 5,
"debug": false,
"onBeforeScript": 'onBefore.js',
"onReadyScript": 'onReady.js'
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment