-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcypress.config.js
45 lines (38 loc) · 1.66 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
42
43
44
45
const { defineConfig } = require("cypress");
const { addCucumberPreprocessorPlugin,} = require("@badeball/cypress-cucumber-preprocessor");
const { preprocessor,} = require("@badeball/cypress-cucumber-preprocessor/browserify");
module.exports = defineConfig({
defaultCommandTimeout:6000,
//run npm i --save-dev cypress-mochawesome-reporter as prerequisite from terminal
//npm install -g mochawesome-report-generator
//also add in e2e.js file import the report
//npm i --save-dev mochawesome-report-generator
//yarn add -D mochawesome-report-generator
reporter: 'cypress-mochawesome-reporter',//calling reporter
env:{
url: "https://rahulshettyacademy.com"
},
retries:{
runMode:1, //retry if failed test
},
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
require('cypress-mochawesome-reporter/plugin')(on);//listener
//preprosesor for cucumber
async function setupNodeEvents(on, config) {
// This is required for the preprocessor to be able to generate JSON reports after each run, and more,
await addCucumberPreprocessorPlugin(on, config);
on("file:preprocessor", preprocessor(config));
// Make sure to return the config object as it might have been modified by the plugin.
return config;
}
},
specPattern: 'cypress/e2e-tests/*.cy.{js,jsx,ts,tsx}',
//specPattern: 'cypress/integration/examples/*.js',
screenshotsFolder:'cypress/failures/screenshots',
experimentalOriginDependencies: true
},
});
//add cucumber by https://github.com/badeball/cypress-cucumber-preprocessor
//npm install @badeball/cypress-cucumber-preprocessor