Skip to content

Commit

Permalink
Merge pull request mate-academy#199 from mate-academy/backstopConfig
Browse files Browse the repository at this point in the history
Connected module with backstopConfig file.
  • Loading branch information
ost-ptk authored Jul 24, 2019
2 parents 955dc36 + 4c5ddc5 commit e014608
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 46 deletions.
65 changes: 19 additions & 46 deletions config/backstop/backstopConfig.js
Original file line number Diff line number Diff line change
@@ -1,52 +1,25 @@
'use strict';

// https://github.com/garris/BackstopJS#advanced-scenarios
const basicScenario = {
label: 'test', // name of the test
url: 'http://localhost:8080/index.html',
referenceUrl: 'https://mate-academy.github.io/layout_solutions/hello-world/',
readyEvent: '',
readySelector: '',
delay: 1000,
hideSelectors: ['[data-qa-hidden]'],
removeSelectors: ['[data-qa-remove]'],
hoverSelector: '',
clickSelector: '',
postInteractionWait: 0,
selectors: '',
selectorExpansion: true,
expect: 0,
misMatchThreshold: 1, // 1% of 100%
requireSameDimensions: true,
};

module.exports = {
id: 'test',
viewports: [
{
name: 'custom-size',
width: 200,
height: 50,
},
],
const backstop = require('@mate-academy/backstop-config');

const { basicScenario } = backstop;

const config = {
...backstop,
viewports: [{
name: 'custom-size',
width: 200,
height: 50,
}],
scenarios: [
{ ...basicScenario },
// define here scenarios for testing
],
paths: {
bitmaps_reference: 'backstop_data/bitmaps_reference',
bitmaps_test: 'backstop_data/bitmaps_test',
engine_scripts: 'backstop_data/engine_scripts',
html_report: 'backstop_data/html_report',
ci_report: 'backstop_data/ci_report',
},
report: ['browser'],
engine: 'puppeteer',
engineOptions: {
args: ['--no-sandbox'],
},
asyncCaptureLimit: 5,
asyncCompareLimit: 50,
debug: false,
debugWindow: false,
{
...basicScenario,
label: 'Elementary test',
referenceUrl:
'https://mate-academy.github.io/layout_solutions/hello-world/',
}],
};

module.exports = config;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@mate-academy/eslint-config": "*",
"@mate-academy/htmllint-config": "*",
"@mate-academy/stylelint-config": "*",
"@mate-academy/backstop-config": "*",
"backstopjs": "^4.0.3",
"eslint": "^5.16.0",
"eslint-plugin-node": "^8.0.1",
Expand Down

0 comments on commit e014608

Please sign in to comment.