/
cypress.config.ts
46 lines (42 loc) · 1.23 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
import {defineConfig} from 'cypress';
import {addCucumberPreprocessorPlugin} from "@badeball/cypress-cucumber-preprocessor";
import {createEsbuildPlugin} from "@badeball/cypress-cucumber-preprocessor/esbuild";
const createBundler = require('@bahmutov/cypress-esbuild-preprocessor');
export default defineConfig({
retries: {
runMode: 1,
openMode: 0,
},
video: false,
videoCompression: 33,
defaultCommandTimeout: 5000,
chromeWebSecurity: false,
watchForFileChanges: false,
viewportWidth: 1280,
viewportHeight: 720,
execTimeout: 60000,
pageLoadTimeout: 60000,
requestTimeout: 15000,
responseTimeout: 15000,
reporter: 'mochawesome',
reporterOptions: {
reportDir: 'cypress/results',
overwrite: false,
html: false,
json: true,
},
e2e: {
setupNodeEvents,
specPattern: 'cypress/e2e/features/*.feature',
},
});
async function setupNodeEvents(
on: Cypress.PluginEvents,
config: Cypress.PluginConfigOptions
): Promise<Cypress.PluginConfigOptions> {
await addCucumberPreprocessorPlugin(on, config);
on('file:preprocessor', createBundler({
plugins: [createEsbuildPlugin(config)],
}));
return config;
}