Reputation: 637
When I try to run my cucumber tests with Cypress using the @badeball/cypress-cucumber-preprocessor, I get this weird error:
This is indicating that the error is coming from my duckduckgo.feature
file which is as follows:
Scenario Outline: Steps will run conditionally if tagged
When user visits <site>
Then <site> search bar will display
@google
Examples:
| site |
| google.com |
@duckduckgo
Examples:
| site |
| duckduckgo.com |
Here is my cypress.config.js
file:
const { defineConfig } = require("cypress");
const preprocessor = require("@badeball/cypress-cucumber-preprocessor");
const browserify = require("@badeball/cypress-cucumber-preprocessor/browserify");
async function setupNodeEvents(on, config) {
await preprocessor.addCucumberPreprocessorPlugin(on, config);
on("file:preprocessor", browserify.default(config));
return config;
}
module.exports = defineConfig({
e2e: {
specPattern: "**/*.feature",
setupNodeEvents,
},
});
Seems like Cypress isn't recognizing my step definitions or my test but I'm not sure why. Everything was working perfectly until a few days ago. I've tried using other bundlers but with no luck. Kind of just pluggin in random things and praying at this point. Can anyone decipher this error?
Here is the repo if you want to tinker around with it.
Upvotes: 2
Views: 456
Reputation: 627
You should start your Feature file with "Feature:" + name of feature. I recommend you using one of Feature formatter which will format feature files according to standards (Feature Syntax Highlight and Snippets, feature-file, BDD - Feature-Editor etc.)
Upvotes: 5