-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcypress.config.ts
53 lines (52 loc) · 1.69 KB
/
cypress.config.ts
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
import { defineConfig } from 'cypress'
const cypressSplit = require('cypress-split')
module.exports = defineConfig({
e2e: {
chromeWebSecurity: false,
experimentalInteractiveRunEvents: true,
reporter: 'cypress-multi-reporters',
retries: {
runMode: 1,
},
trashAssetsBeforeRuns: false,
video: false,
watchForFileChanges: false,
baseUrl: 'https://www.saucedemo.com/',
reporterOptions: {
reporterEnabled: 'mochawesome, mocha-junit-reporter',
mochawesomeReporterOptions: {
useInlineDiffs: true,
embeddedScreenshots: true,
reportDir: 'cypress/results',
reportFilename: '[name].html',
overwrite: true,
html: false,
json: true,
code: false
},
},
specPattern: 'cypress/e2e/**/*.{spec,cy}.{js,jsx,ts,tsx}',
//https://blog.hao.dev/fixing-cypress-errors-part-1-chromium-out-of-memory-crashes
numTestsKeptInMemory: 1,
env: {
showLogs: true,
numTestsKeptInMemory: 1,
},
setupNodeEvents(on, config) {
on('before:browser:launch', (browser, launchOptions) => {
if (browser.name === 'chrome' && browser.isHeadless) {
launchOptions.args.push('--disable-gpu');
launchOptions.args.push('--disable-gpu-sandbox');
launchOptions.args.push("--incognito");
//https://blog.hao.dev/fixing-cypress-errors-part-1-chromium-out-of-memory-crashes
launchOptions.args.push('--disable-dev-shm-usage');
}
return launchOptions
});
require('cypress-failed-log/on')(on);
require('@bahmutov/cy-grep/src/plugin')(config);
// IMPORTANT: return the config object
return config;
}
}
})