-
Notifications
You must be signed in to change notification settings - Fork 5
/
cypress.config.js
33 lines (29 loc) · 1.18 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
const { defineConfig } = require('cypress');
const preprocessor = require('@badeball/cypress-cucumber-preprocessor');
const browserify = require('@badeball/cypress-cucumber-preprocessor/browserify');
/**
* Setup the node events for the cucumber preprocessor.
* @param {object} events - Cypress.PluginEvents.
* @param {object} configuration - Cypress.PluginConfigOptions.
* @returns {Promise} Promise with config as it might have been
* modified by the plugin on success otherwise an error.
*/
async function setupNodeEvents(events, configuration) {
await preprocessor.addCucumberPreprocessorPlugin(events, configuration);
events('file:preprocessor', browserify.default(configuration));
// Make sure to return the config object as it might have been modified by the plugin.
return configuration;
}
module.exports = defineConfig({
e2e: {
baseUrl: 'http://localhost:8080',
specPattern: '**/*.feature',
supportFile: './cypress/support/e2e.js',
video: false,
screenshotOnRunFailure: false,
setupNodeEvents,
experimentalRunAllSpecs: true,
reporter: require.resolve('@badeball/cypress-cucumber-preprocessor/pretty-reporter'),
},
defaultCommandTimeout: 10000,
});