When I am trying to run cypress it does detect the feature files but fails to get the step definitions file and below is the error I get to see.
Sharing below my config:
- package json file snippet
{...
"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": true,
}
}
- cypress.json
{
...
"testFiles": "**/*.{feature,features}"
}
- plugins/index.js
const cucumber = require('cypress-cucumber-preprocessor').default
module.exports = (on, config) => {
on('file:preprocessor', cucumber())
}
Also sharing my test files:
Feature file (google/check-title.feature)
Feature: The Google
I want to open google page
@focus
Scenario: Opening a social network page
Given I open Google page
Then I see "Google" in the title
step-definition file (google/check-title/check-title.js)
import { Given, Then } from 'cypress-cucumber-preprocessor/steps';
const url = 'https://google.com';
Given('I open Google page', () => {
cy.visit(url);
});
Then(`I see {string} in the title`, (title) => {
cy.title().should('include', title);
});