0

Currently working with the .js port of Cucumber - CucumberJS. I am facing this issue where the scenario outline steps are not coming in the defined step.

My Scenario is pretty simple

Scenario Outline: Enter a seven digit number and see if the input box accepts it
Given a user edits the Page
When he enters <Number> on the Code box
Then it should not be accepted with a message

Examples:
|Number |
|AB12343|
|JNC1121|

When the step definition file is generated , I expect this

When(/^he enters AB12343 on the code box$/, function(callback) {
  // Write code here that turns the phrase above into concrete actions
  callback(null, 'pending');
});

However, the code generated is

Then(/^he enters AB12343 on the code box$/, function(callback) {
  // Write code here that turns the phrase above into concrete actions
  callback(null, 'pending');
});

which doesn't makes sense to me. For reference I used this SO post. What seems to the mistake here?

  • Not sure how this particular port works, but in cucumber-jvm Given/When/Then in glues are fully interchangeable and there's no difference outside of the gherkin scenarios. Just FYI, maybe this is not a big issue after all. – Mykola Gurov Apr 28 '18 at 10:40
  • It's not an issue per se. The only thing I'm trying to figure out is why it is happening. – demouser123 Apr 30 '18 at 5:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.