forked from mate-academy/layout_hello-world
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request mate-academy#199 from mate-academy/backstopConfig
Connected module with backstopConfig file.
- Loading branch information
Showing
2 changed files
with
20 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters