-
-
Notifications
You must be signed in to change notification settings - Fork 53
/
cypress.config.js
31 lines (26 loc) · 1000 Bytes
/
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
const { defineConfig } = require('cypress');
const cypressOnFix = require('cypress-on-fix');
const createBundler = require('@bahmutov/cypress-esbuild-preprocessor');
const { addCucumberPreprocessorPlugin } = require('@badeball/cypress-cucumber-preprocessor');
const { createEsbuildPlugin } = require('@badeball/cypress-cucumber-preprocessor/esbuild');
module.exports = defineConfig({
reporter: 'cypress-mochawesome-reporter',
video: true,
retries: 1,
e2e: {
specPattern: 'cypress/e2e/**/*.feature',
async setupNodeEvents(on, config) {
// "cypress-on-fix" is required because "cypress-mochawesome-reporter" and "cypress-cucumber-preprocessor" use the same hooks
on = cypressOnFix(on);
require('cypress-mochawesome-reporter/plugin')(on);
await addCucumberPreprocessorPlugin(on, config);
on(
'file:preprocessor',
createBundler({
plugins: [createEsbuildPlugin(config)],
})
);
return config;
},
},
});