forked from RedHatInsights/edge-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypress.config.js
41 lines (35 loc) · 971 Bytes
/
cypress.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
const { defineConfig } = require("cypress");
// eslint-disable-next-line no-unused-vars
const fs = require("fs-extra");
const path = require("path");
function getConfigurationByFile(file) {
const pathToConfigFile = path.resolve("cypress/config", `${file}.env.json`);
// check if file exists
if (!fs.existsSync(pathToConfigFile)) {
throw new Error(`Config file ${pathToConfigFile} does not exist`);
}
return fs.readJson(pathToConfigFile);
}
module.exports = defineConfig({
retries: {
runMode: 3,
openMode: 0,
},
chromeWebSecurity: false,
pageLoadTimeout: 120000,
defaultCommandTimeout:10000,
videoUploadOnPasses: false,
e2e: {
setupNodeEvents(on, config) {
// accept a configFile value or use local by default
const file = config.env.configFile || "local";
return getConfigurationByFile(file);
},
},
component: {
devServer: {
framework: "react",
bundler: "webpack",
},
},
});