forked from craftcms/spoke-and-chain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypress.config.example.js
47 lines (43 loc) · 1.32 KB
/
cypress.config.example.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
const {defineConfig} = require('cypress');
const {lighthouse, pa11y, prepareAudit} = require("cypress-audit");
module.exports = defineConfig({
e2e: {
baseUrl: 'https://spokeandchain.ddev.site/',
scrollBehavior: 'nearest',
setupNodeEvents(on, config) {
on('before:browser:launch', (browser = {}, launchOptions) => {
// `args` is an array of all the arguments that will
// be passed to browsers when it launches
prepareAudit(launchOptions);
if (browser.family === 'chromium' && browser.name !== 'electron') {
// auto open devtools
launchOptions.args.push('--ignore-certificate-errors')
// whatever you return here becomes the launchOptions
return launchOptions
}
})
on("task", {
lighthouse: lighthouse(), // calling the function is important
pa11y: pa11y(), // calling the function is important
});
}
},
env: {
'CP_TRIGGER': 'admin',
'CP_LOGIN': '[email protected]',
'CP_PASSWORD': '__replace__',
'ENABLE_LIGHTHOUSE': true,
'LIGHTHOUSE_OPTIONS': {
'performance': 0,
'accessibility': 90,
'best-practices': 0,
'seo': 0,
'pwa': 0
},
'ENABLE_PA11Y': false,
'PA11Y_OPTIONS': {
'runners': ['htmlcs'],
'standard': 'WCAG2AA'
}
}
});