-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypress.config.js
32 lines (29 loc) · 1.01 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
const { defineConfig } = require('cypress');
require('dotenv').config();
module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
on('after:run', async (results) => {
function newParser(title) {
const splittedTitle = title.split(':');
const testCaseIds = splittedTitle[0]
.split(',')
.map((element) => element = element.trim().substring(1));
return testCaseIds;
}
const TestrailIntegration = require('cypress-testrail-integration');
const testrailIntegration = new TestrailIntegration(
process.env.TESTRAIL_USERNAME,
process.env.TESTRAIL_PASSWORD,
process.env.TESTRAIL_HOSTNAME,
process.env.TESTRAIL_PROJECT_ID,
// testRunName = 'New Test Run',
// parser = newParser
);
await testrailIntegration.addResultsToTestRailTestRun(results);
});
return config;
},
specPattern: 'cypress/e2e/**/*.spec.{js, jsx, ts, tsx}',
},
});