-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcypress.config.js
34 lines (27 loc) · 1.07 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
const { defineConfig } = require('cypress'); // eslint-disable-line no-undef
const fse = require('fs-extra'); // eslint-disable-line no-undef
const path = require('path'); // eslint-disable-line no-undef
const TYPE_ALL = 'all';
function getConfigurationByFile(file) {
const pathToConfigFile = path.resolve('cypress', `${file}.json`);
return fse.readJson(pathToConfigFile);
}
module.exports = defineConfig({
e2e: {
/**
* TODO: This one is configured only for local E2E testing (1337 port is used as default CSR Client local Hosting)
* Should be reconsidered after real Application deployment + hosting in real world.
*/
baseUrl: 'http://localhost:1337',
port: 3005,
setupNodeEvents(on, config) {
const type = config.env.configType || TYPE_ALL;
if (type === TYPE_ALL) {
return {};
}
const fileName = `cypress.config.${type}`;
const overrideConfig = getConfigurationByFile(fileName);
return overrideConfig;
},
},
});