-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcypress.config.js
41 lines (36 loc) · 1.14 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
const { defineConfig } = require('cypress');
const createBundler = require('@bahmutov/cypress-esbuild-preprocessor');
const { addCucumberPreprocessorPlugin, afterRunHandler } = require('@badeball/cypress-cucumber-preprocessor');
const createEsbuildPlugin = require('@badeball/cypress-cucumber-preprocessor/esbuild');
const fs = require('fs');
const setupNodeEvents = async (on, config) => {
await addCucumberPreprocessorPlugin(on, config);
on(
'file:preprocessor',
createBundler({
plugins: [createEsbuildPlugin.default(config)],
}),
);
on('after:run', async (results) => {
if (results) {
await afterRunHandler(config);
fs.writeFile("cypress/.run/results.json", JSON.stringify(results));
}
});
return config;
};
module.exports = defineConfig({
env: {
HOST: 'http://localhost:8080'
},
e2e: {
specPattern: './**/*.feature',
video: false,
setupNodeEvents,
experimentalInteractiveRunEvents: true,
downloadsFolder: './cypress/.run/downloads',
fixturesFolder: './cypress/.run/fixtures',
screenshotsFolder: './cypress/.run/screenshots',
videosFolder: './cypress/.run/videos'
}
});