-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbackstop.config.js
49 lines (45 loc) · 1.05 KB
/
backstop.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
const fs = require('fs')
let allScenarios = []
function loadScenarios (dirname) {
const files = fs.readdirSync(dirname)
files.forEach ((file) => {
const content = JSON.parse(fs.readFileSync(dirname + file, 'utf-8'))
if (Array.isArray(content)) {
content.forEach((scenario) => {
allScenarios.push(scenario)
})
} else {
allScenarios.push(content)
}
})
}
loadScenarios('backstop_data/scenarios/')
module.exports = {
'viewports': [
{
'name': 'PC',
'width': 1920,
'height': 1080
},
{
'name': 'Mobile',
'width': 375,
'height': 667
}
],
'scenarios': allScenarios,
'paths': {
'bitmaps_reference': 'backstop_data/bitmaps_reference',
'bitmaps_test': 'backstop_data/bitmaps_test',
'casper_scripts': 'backstop_data/casper_scripts',
'html_report': 'backstop_data/html_report',
'ci_report': 'backstop_data/ci_report'
},
'casperFlags': [],
'engine': 'phantomjs',
'report': [
'browser'
],
'onBeforeScript': 'onBefore.js',
'debug': false
}