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

Support the Rule keyword #140

Open
ciaranmcnulty opened this issue Jan 9, 2019 · 8 comments
Open

Support the Rule keyword #140

ciaranmcnulty opened this issue Jan 9, 2019 · 8 comments

Comments

@ciaranmcnulty
Copy link
Contributor

This is new in Gherkin v6

https://docs.cucumber.io/gherkin/reference/#rule

@stof
Copy link
Member

stof commented Jan 9, 2019

If we want to support it, we should also consider refactoring Behat and Gherkin to separate the Gherkin AST from what they call pickles. This way, the Behat runner would not have to know about the extra grouping features of the Gherkin syntax.
This would be a BC break for hooks (some hooks would have to disappear, as the execution itself would not know about outlines or backgrounds anymore for instance).

In any case, adding that would require a new behat/gherkin major version, as adding rules inside features would break Behat when running them.

@ciaranmcnulty
Copy link
Contributor Author

Yes, if we went that route it might make sense to semi-generate the parser the same way that's done in other languages (and this repo might become a compat later)

Or cucumber-engine will become the future and we won't need a Gherkin parser for behat...

@stof
Copy link
Member

stof commented Jan 10, 2019

Well, what other languages are doing is not semi-generating the parser. They are calling the go parser (as a CLI) and then only rebuilding the output objects. I'm not sure that's what we want for now.

@ciaranmcnulty
Copy link
Contributor Author

I caught up about cucumber-engine and it looks like the future of it is uncertain (the idea was to have a large part of the runtime distributed as a binary).

I'll take a look at how disruptive adding Rule would be, and see if there are any other changes in Gherkin - maybe doing #95 is the best starting point?

@benztest
Copy link

benztest commented Sep 3, 2020

I was wondering if there was any further updates regarding the Rule keyword?

As in my recent attempt to include two rules in a single feature results in an error.

  [Behat\Gherkin\Exception\ParserException]
  Expected Step, but got text: "Rule: Authenticate as a learner" in file: C:\<path>\<file>.feature

.feature:

Feature: ...

Rule: Rule: Do no authenticate

Scenario: ...

Scenario: ...

Rule: Rule: Authenticate as a learner

Scenario: ...

Scenario: ...

@ciaranmcnulty
Copy link
Contributor Author

ciaranmcnulty commented Feb 4, 2021

@Harrisonbro
Copy link

Sorry if this should be obvious, but is there somewhere we can see how support for the Rule keyword moves from this issue into a version of Behat we can use as end users? Sorry, I’m not familiar enough with the project or how open source works to figure this out myself.

@ciaranmcnulty
Copy link
Contributor Author

This isn’t yet implemented here. Once it is, a new version of Behat will need to add support

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

No branches or pull requests

4 participants