-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcypress.config.js
64 lines (60 loc) · 1.31 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const _ = require('lodash');
const { defineConfig } = require('cypress');
// @ts-ignore
const wp = require('@cypress/webpack-preprocessor');
const options = {
webpackOptions: {
resolve: {
extensions: ['.ts', '.tsx', '.js']
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
options: { transpileOnly: true }
}
]
}
}
};
let conf;
try {
conf = require('./src/extensions/cypress/cypress.json') || {};
} catch (e) {
console.log('No cypress.json file found, using default configuration');
conf = {};
}
module.exports = defineConfig(
_.mergeWith(
{
e2e: {
testIsolation: true,
baseUrl: 'http://localhost:9001',
supportFile: 'cypress/support/e2e.{js,jsx,ts,tsx}',
setupNodeEvents(on, config) {
on('file:preprocessor', wp(options));
},
specPattern: ['cypress/e2e/**/*.cy.ts']
},
env: {
CYPRESS_WS_URL:
process.env.CYPRESS_WS_URL || process.env.REACT_APP_API_URL
},
retries: {
runMode: 2
},
experimentalMemoryManagement: true,
numTestsKeptInMemory: 20,
video: false,
chromeWebSecurity: false,
viewportWidth: 1200,
viewportHeight: 800,
defaultCommandTimeout: 30000,
modifyObstructiveCode: false
},
conf,
(objValue, srcValue) =>
_.isArray(objValue) ? objValue.concat(srcValue) : undefined
)
);