-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypress.config.js
47 lines (43 loc) · 1.3 KB
/
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
42
43
44
45
46
47
const { defineConfig } = require("cypress");
const fs = require('fs-extra');
const path = require('path');
function getConfigurationByFile(file) {
const pathToConfigFile = path.resolve('config', `${file}.json`)
console.log(pathToConfigFile)
if(!fs.existsSync(pathToConfigFile)) {
console.log('No custom config file found.' + pathToConfigFile)
return {}
}
return fs.readJson(pathToConfigFile)
}
module.exports = defineConfig({
projectId: "wztwmc",
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
const file = config.env.configFile || ''
return getConfigurationByFile(file)
},
specPattern: "cypress/e2e/**/*.{js,jsx,ts,tsx,feature}",
// excludeSpecPattern: "cypress/e2e/other/*.js",
defaultCommandTimeout: 10000,
screenshotOnRunFailure: true,
trashAssetsBeforeRuns: true,
video: false,
reporter: 'cypress-multi-reporters',
reporterOptions: {
configFile: 'reporter-config.json',
},
retries:{
runMode: 0,
openMode: 1
},
env: {
// set environment variables
hideXHRInCommandLog: "true",
first_name: "Jean",
webdriveruniversityBaseUrl: "https://www.webdriveruniversity.com/",
automationTestStoreBaseUrl: "https://www.automationteststore.com/"
},
}
});