forked from salesforce-ux/design-system
-
Notifications
You must be signed in to change notification settings - Fork 0
/
applitools.config.js
61 lines (56 loc) · 2.11 KB
/
applitools.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
49
50
51
52
53
54
55
56
57
58
59
60
61
const branch = require('git-branch');
const resolution = { width: 1024, height: 768 };
const currentBranch = branch.sync();
// these variable are involved in the `CI_VRT_` workflows: `full` and `chrome`
// when this config is consumed by those workflows,
// VRT_MODE is passed as an env var with either value
const vrtMode = process.env.VRT_MODE;
const VRT_MODE_CHROME = "chrome";
const VRT_MODE_FULL = "full";
const browsersToTest = () => {
const browserTests = [
{ width: resolution.width, height: resolution.height, name: 'chrome' },
{ width: resolution.width, height: resolution.height, name: 'firefox' },
{ width: resolution.width, height: resolution.height, name: 'safari' },
{ width: resolution.width, height: resolution.height, name: 'edgechromium' }
]
// if VRT_MODE is not specified
return vrtMode === undefined
// return full browser list
? browserTests
// or return a filtered list based on the value of VRT_MODE
: browserTests.filter(test => {
return vrtMode === VRT_MODE_FULL || (vrtMode === VRT_MODE_CHROME && test.name === VRT_MODE_CHROME)
})
}
module.exports = {
apiKey: process.env.APPLITOOLS_API_KEY,
appName: 'SLDS',
matchLevel: 'Strict',
ignoreDisplacements: true,
properties: [{ name: 'Group', value: 'desktop' }],
batchName: process.env.CI ? undefined : '',
branchName: process.env.CI
? undefined
: `localRun/${process.env.LOGNAME}/${currentBranch}`,
parentBranchName: process.env.CI ? undefined : `localRun/${currentBranch}`,
showLogs: process.env.CI || false,
showStorybookOutput: process.env.CI || false,
// saveDebugData: false,
exitcode: false,
testConcurrency: 100,
serverUrl: 'https://salesforceuxeyesapi.applitools.com',
testBlueprintPattern: '.*',
testNamePattern: '^(?:.+|) ?Sink',
include: function({ kind, name }) {
return (
new RegExp(this.testBlueprintPattern, 'gi').test(kind) &&
new RegExp(this.testNamePattern, 'gi').test(name)
);
},
puppeteerOptions: process.env.CIRCLECI
? { executablePath: '/usr/bin/google-chrome' }
: undefined,
waitBeforeScreenshot: 1000,
browser: browsersToTest()
};