Adapter to run cucumberjs tests via cypress test runner
npm install @qavajs/cypress-runner-adapter
const { defineConfig } = require('cypress');
const cucumber = require('@qavajs/cypress-runner-adapter/adapter');
module.exports = defineConfig({
e2e: {
specPattern: 'cypress/feature/**/*.feature',
supportFile: 'cypress/support/e2e.js',
setupNodeEvents(on, config) {
on('file:preprocessor', cucumber)
},
},
});
support/e2e.js
is entry point with step definition;
import { When, setWorldConstructor } from '@qavajs/cypress-runner-adapter';
class World {
}
setWorldConstructor(World);
When('open {string} url', function (url) {
cy.visit(url);
});