-
Notifications
You must be signed in to change notification settings - Fork 2
/
cypress.config.js
52 lines (36 loc) · 1.53 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
const { defineConfig } = require( 'cypress' )
module.exports = defineConfig( {
defaultCommandTimeout: 60000,
requestTimeout: 60000,
video: process.env.CYPRESS_API_URL ? false : true,
videoCompression: false,
screenscreenshotOnRunFailureshots: true,
chromeWebSecurity: false,
watchForFileChanges: false,
projectId: 'irrelevant',
e2e: {
// testIsolation
// supportFile
// Experimental flag that restores the old "run all" button, may have bugs
experimentalRunAllSpecs: true,
setupNodeEvents( on, config ) {
// Set up failfast
require( "cypress-fail-fast/plugin" )( on, config )
// Load environment variables
let envFile = '.env'
// // If in offline dev, use development env
// if( process.env.NODE_ENV == 'development' ) envFile = '.env.development'
// // If in CI use .env since the workflows write to that file on run
// if( process.env.CI ) envFile = '.env'
const dotenvConfig = {
path: `${ __dirname }/${ envFile }`
}
console.log( `Runing cypress with ${ process.env.NODE_ENV }, director ${ process.env.CYPRESS_API_URL }, and ${ envFile }` )
require( 'dotenv' ).config( dotenvConfig )
config.env.REACT_APP_publicUrl = process.env.REACT_APP_publicUrl
return config
},
specPattern: "cypress/e2e/**/*.{js,jsx,ts,tsx}",
baseUrl: "http://localhost:3000",
}
} )