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

Add Support for Rule keyword #270

Open
i-avm opened this issue Nov 25, 2021 · 5 comments
Open

Add Support for Rule keyword #270

i-avm opened this issue Nov 25, 2021 · 5 comments

Comments

@i-avm
Copy link

i-avm commented Nov 25, 2021

Rule

I would like to know whether Yadda can support the Rule feature in Gherkin Scenarios ?

The Rule keyword has been part of Gherkin since v6.

The Rule keyword is still pretty new. It has been ported in a lot of Cucumber implementation already.

The purpose of the Rule keyword is to represent one business rule that should be implemented. It provides additional information for a feature. A Rule is used to group together several scenarios that belong to this business rule. A Rule should contain one or more scenarios that illustrate the particular rule.

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

Please update on this.
Thanks

@cressie176
Copy link
Member

Hi @21Aby,

It doesn't currently support it. If I understand correctly a "Rule" is just a way of associating scenarios. They're no additional behaviour beyond this. I think it should be possible to implement, but will give it some more thought.

@i-avm
Copy link
Author

i-avm commented Nov 30, 2021

@cressie176 Thank you for the reply.

As you said, the main purpose of Rule is to group together several scenarios that belong to a business rule.
But using multiple Rules we can achieve multiple Background for a single feature.

You can only have one set of Background steps per Feature or Rule. If you need different Background steps for different scenarios, consider breaking up your set of scenarios into more Rules or more Features

This would really help in our test cases a lot.
I would really appreciate if you could implement this feature on Yadda.

Thanks & Regards

@cressie176
Copy link
Member

Understood. I guess the workaround at the moment is to have one feature file per rule?

@cressie176
Copy link
Member

cressie176 commented Nov 30, 2021

Is the only difference between a Feature and a Rule, that a Feature can contain Rules, but that a Rule cannot contain child rules?

@i-avm
Copy link
Author

i-avm commented Nov 30, 2021

@cressie176

but that a Rule cannot contain child rules?

Never seen a usage like a Child Rule inside another Rule.

Right now , what we are following is like; creating a feature file for each Resource. So a feature file will contains all the scenarios related to that resource type. Then we can use Rule to further divide & group the scenarios, right ?

Say, we can have Rules based on the CRUD operations.

I guess the workaround at the moment is to have one feature file per rule?

Means More number of files. Thats one main reason we are looking into the Rule part

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