forked from adobe/spectrum-css-workflow-icons
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvrt-rsp.js
62 lines (57 loc) · 1.59 KB
/
vrt-rsp.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Shared scenario configuration
const { readdirSync } = require('fs');
const { basename } = require('path');
const ext = 'rsp';
const selectors = readdirSync('./vrt-react/src/react-spectrum-workflow/dist').filter(item => !['index.js', 'util.js'].includes(item)).map(item => `.A4u${basename(item, '.js')}`);
selectors.push('.icon-total-num-row');
const [...rest] = process.argv.slice(3);
let host = 'localhost';
rest.forEach(argv => {
if (argv === '--moby') {
host = 'host.docker.internal';
}
});
module.exports = {
id: 'rsp-icon-package',
viewports: [
{
label: 'desktop',
width: 800,
height: 600
}
],
scenarios: [
{
label: 'icons',
url: `http://${host}:3000`,
selectors,
selectorExpansion: true,
expect: 0,
delay: 1000,
misMatchThreshold: 0.1,
requireSameDimensions: true
}
],
paths: {
bitmaps_reference: `bitmap_references/${ext}`,
bitmaps_test: `bitmap_tests/${ext}`,
html_report: `reports/html_report_${ext}`,
ci_report: `reports/ci_report_${ext}`
},
report: ['browser'],
engine: 'playwright',
engineOptions: {
browser: 'chromium'
},
asyncCaptureLimit: 2,
asyncCompareLimit: 50,
debug: false,
debugWindow: false,
imageMagick: false,
staticDiverged: false,
resembleOutputOptions: {
errorType: "movement"
},
fileNameTemplate: '{selectorLabel}',
dockerCommandTemplate: 'docker run --rm -it --mount type=bind,source="{cwd}",target=/src --network host docker-adobe-spectrum-release.dr.corp.adobe.com/backstopjs-spectrum-playwright:{version} {backstopCommand} {args}'
};