forked from ManageIQ/manageiq-ui-classic
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcypress.config.js
More file actions
49 lines (46 loc) · 1.59 KB
/
cypress.config.js
File metadata and controls
49 lines (46 loc) · 1.59 KB
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
/* eslint-disable no-undef */
const { defineConfig } = require('cypress');
const fs = require('fs');
module.exports = defineConfig({
e2e: {
baseUrl: 'http://localhost:3000',
viewportHeight: 800,
viewportWidth: 1800,
numTestsKeptInMemory: 0,
videoCompression: false,
// See: https://docs.cypress.io/app/references/experiments#Experimental-Flake-Detection-Features
retries: {
experimentalStrategy: 'detect-flake-and-pass-on-threshold',
experimentalOptions: {
maxRetries: 9,
passesRequired: 1,
},
openMode: false,
runMode: true,
},
// eslint-disable-next-line no-unused-vars
setupNodeEvents(on, config) {
on('after:spec', (spec, results) => {
// Delete the video on CI if the spec passed and no tests retried
if (process.env.CI && results && results.video && fs.existsSync(results.video)) {
// Do we have failures for any retry attempts?
const failures = results.tests.some((test) =>
test.attempts.some((attempt) => attempt.state === 'failed')
);
if (!failures) {
fs.unlinkSync(results.video);
}
}
});
on('before:browser:launch', (browser = {}, launchOptions) => {
console.log('Launching browser:', browser.name);
console.log('Input args:', launchOptions.args);
if (browser.name === 'chrome') {
launchOptions.args.push('--disable-features=AutofillServerCommunication');
}
console.log('Actual args:', launchOptions.args);
return launchOptions;
});
},
},
});