Steps definitions are not executed
See original GitHub issueI used this project successfully about a onth ago, and today I can’t make it work anymore.
Whatever I do, I always get the error Error: Step implementation missing for: I am on the "/" page
.
Here is my feature : tests/e2e/specs/vue-cli-demo.feature
Feature: Vue cli demo
I want to see the demo created by 'vue-cli create' to test cypress with cucumber preprocessor
Scenario: Visualizing the home page
Given I am on the "/" page
Then I see the vue logo
# Scenario: Navigating to the about page
# Given I am on the "/" page
# When I click on the "about" link in the menu
# Then The current page is "/about"
# And The page title is "This is an about page"
And the steps : tests/e2e/support/step_definitions/common.js
/* global given, when, then */
console.log('Hello')
given('I am on the "/" page', () => {
cy.visit('/');
})
then('I see the vue logo', () => {
cy.get('img[src="../assets/logo.png"]')
})
The non-default paths are all correctly configured (I think)
I added a console.log in the compile
method of the index.js file of the project which prints the result of the function. I get this :
const {resolveAndRunStepDefinition, given, when, then} = require('cypress-cucumber-preprocessor/resolveStepDefinition');
const { createTestFromScenario } = require('cypress-cucumber-preprocessor/createTestFromScenario');
const { createTestsFromFeature } = require('cypress-cucumber-preprocessor/createTestsFromFeature');
{
/* global given, when, then */
console.log('Hello')
given('I am on the "/" page', () => {
cy.visit('/');
})
then('I see the vue logo', () => {
cy.get('img[src="../assets/logo.png"]')
})
}
const {Parser, Compiler} = require('gherkin');
const spec = `Feature: Vue cli demo
I want to see the demo created by 'vue-cli create' to test cypress with cucumber preprocessor
Scenario: Visualizing the home page
Given I am on the "/" page
Then I see the vue logo
# Scenario: Navigating to the about page
# Given I am on the "/" page
# When I click on the "about" link in the menu
# Then The current page is "/about"
# And The page title is "This is an about page"
`
const gherkinAst = new Parser().parse(spec);
createTestsFromFeature(gherkinAst);
This makes me believe that the plugin correctly finds my step definitions, but they are never executed (I don’t see the console.log(“Hello”) at the top)
Can you help me figure out what’s wrong ?
Issue Analytics
- State:
- Created 5 years ago
- Comments:17 (3 by maintainers)
Top Results From Across the Web
Step Definitions are not recognized while running cucumber ...
However when I try to run it from command prompt, after creating a runner class, the step definitions are not recognized.
Read more >Running Cucumber feature file doesn't generate step definitions
When a new step is implemented in a feature file. The step definitions is not generate for that step and it shows the...
Read more >Why is my Feature File failing to find the Step Definition?
Your java is defined as a folder and not package try defining it as package and calling java.uk.co... if you see the folder...
Read more >Step Definition - Cucumber - Tools QA
A Step Definition is a small piece of code with a pattern attached to it or in other words a Step Definition is...
Read more >FAQ - Cucumber Documentation
If Cucumber is telling you that your steps are undefined, when you have defined step definitions, this means that Cucumber cannot find your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
nice! Thanks for sharing
yes, you write them “by hand” 😄 There is no need for scary regex though! take a look here: https://github.com/TheBrainFamily/cypress-cucumber-preprocessor/blob/master/cypress/support/step_definitions/scenario_outline_string.js