Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cucumber 2 support #124

Closed
kevin-bruton opened this issue Oct 5, 2017 · 6 comments
Closed

Cucumber 2 support #124

kevin-bruton opened this issue Oct 5, 2017 · 6 comments

Comments

@kevin-bruton
Copy link
Contributor

kevin-bruton commented Oct 5, 2017

Looks like step definitions are not recognized when they are written as Cucumber Expressions instead of Regular Expressions. Since the Cucumber documentation now seems to favor Cucumber Expressions, it maybe important to support them.
Cf. https://docs.cucumber.io/cucumber-expressions/

@alexkrechik
Copy link
Owner

Hey! Looks like I've added such functionality in #66 scope here

@kevin-bruton kevin-bruton changed the title Add support for Cucumber Expressions Cucumber 2 support Oct 5, 2017
@kevin-bruton
Copy link
Contributor Author

Maybe mine is another issue then. The problem started after updating to Cucumber 2.
Now we're writing our step definitions like this:

const { defineStep } = require('cucumber');
const conditionsPage = require(
  '../page_objects/conditions-page');

defineStep('check conditions are shown to the user', async function () {
  await conditionsPage.checkConditionsShown();
});

Any idea why the step in the feature file can't find the step definition described above?

@alexkrechik
Copy link
Owner

The problem is related to the new steps defining format. Plugin doesn't know that defineStep('check conditions are shown to the user', async function () { is cucumber string&

@alexkrechik
Copy link
Owner

Is there any cucumber2 plugin specification with describing of all the steps definition formats supported for different programming languages (like https://cucumber.io/docs/reference)?

@kevin-bruton
Copy link
Contributor Author

According to the documentation, it looks like defineStep has three aliases: Given, When, Then
cf. https://github.com/cucumber/cucumber-js/blob/master/docs/support_files/api_reference.md#definesteppattern-options-fn

I've tried adding defineStep here at it seems to work!

Thanks for pointing me in the right direction.

@alexkrechik
Copy link
Owner

Added to 2-4-0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants