-
Notifications
You must be signed in to change notification settings - Fork 15
/
cypress.config.ts
48 lines (44 loc) · 1.44 KB
/
cypress.config.ts
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
import { defineConfig } from 'cypress';
import { getDateTime } from './cypress/support/utils';
const { strDate, strTime } = getDateTime();
const getName = (url = '', parallel = '') => {
if (url.includes('skfp-')) {
return url.replace('https://', '').split('.')[0].split('-').splice(2, 4).join('-')+'/'+parallel;
} else {
return 'QA/'+parallel;
}
};
export default defineConfig({
projectId: '8q77r5',
chromeWebSecurity: true,
video: false,
screenshotOnRunFailure: true,
viewportWidth: 1920,
viewportHeight: 1080,
e2e: {
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.ts')(on, config);
},
baseUrl: 'https://portal-qa.kidsfirstdrc.org',
specPattern: 'cypress/e2e/**/*.cy.{js,jsx,ts,tsx}',
slowTestThreshold: 60000,
downloadsFolder: `cypress/downloads/${getName(process.env.CYPRESS_BASE_URL, process.env.CYPRESS_PARALLEL)}`,
screenshotsFolder: `cypress/screenshots/${getName(process.env.CYPRESS_BASE_URL, process.env.CYPRESS_PARALLEL)}`,
videosFolder: `cypress/videos/${getName(process.env.CYPRESS_BASE_URL, process.env.CYPRESS_PARALLEL)}`,
},
retries: {
runMode: 2,
openMode: 0,
},
reporter: 'junit',
reporterOptions: {
mochaFile:
'cypress/results/' +
`${getName(process.env.CYPRESS_BASE_URL, process.env.CYPRESS_PARALLEL)}/` +
strDate +
'_' +
strTime +
'-[hash].xml',
rootSuiteTitle: 'Tests Cypress',
},
});