- Add Only
- Cucumber (Gherkin) Full Support
- Cypress Helper
Open Cypress IDE
npx cypress open
Run test and record
npx cypress run --record --key <record-keys>
Run spesific tag
npx cypress -e TAGS='@case=CaseId'
Run spesific spec
npx cypress run --spec <spec-file-path> --browser chrome
For new test project
Install Cypress in the test project root
npm install cypress --save-dev
Install the @badeball/cypress-cucumber-preprocessor using the command
npm install -D @badeball/cypress-cucumber-preprocessor
and install one more dependencies ‘@bahmutov/cypress-esbuild-preprocessor’ using the commands
npm install -D @bahmutov/cypress-esbuild-preprocessor
Then create cypress.config.js for cucumber preprocessor
const { defineConfig } = require("cypress");
const createBundler = require("@bahmutov/cypress-esbuild-preprocessor");
const addCucumberPreprocessorPlugin =
require("@badeball/cypress-cucumber-preprocessor").addCucumberPreprocessorPlugin;
const createEsbuildPlugin =
require("@badeball/cypress-cucumber-preprocessor/esbuild").createEsbuildPlugin;
module.exports = defineConfig({
e2e: {
async setupNodeEvents(on, config) {
const bundler = createBundler({
plugins: [createEsbuildPlugin(config)],
});
on("file:preprocessor", bundler);
await addCucumberPreprocessorPlugin(on, config);
return config;
},
specPattern: [
"cypress/e2e/features/*.feature",
"cypress/e2e/features/*/*.feature"],
}
});