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

Update better-gherkin.md #873

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Update better-gherkin.md #873

wants to merge 6 commits into from

Conversation

atdd-bdd
Copy link
Contributor

Added an intermediate style between imperative and declarative

🤔 What's changed?

Added a third style between imperative and declarative

⚡️ What's your motivation?

It's good to have three perspectives on how to approach an issue. In many cases, the data in the scenario should be transparent. The third way allows for transparency, as well as reuse of the scenario in multiple contexts.

📋 Checklist:

Added an intermediate style between imperative and declarative
Copy link
Contributor

@luke-hill luke-hill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check your editor as it seems as though some inconsistent spacing is being added.


## A third style

There is a style that is intermediate between these two. The exact values are specified in the scenario, but the way the user interacts with the system is not. This style uses stepdef tables with domain terms as the column headers. The step definitions can be reused for mulitple scenarios with different data in the table. In this example, the scenarios for free and paid subscribers use the same step defs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few minor things to fix:

  • Check your formatter here as lots of extra spaces are being added.
  • Use step definitions instead of stepdef
  • mulitple* typo

Also these technical items are known as data tables not step definition tables

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the changes as you suggested. Thanks for the corrections.

| Title | For Subscription |
| Free Article 1 | Free |
| Paid Article 1 | Paid |
And user is logged in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you're using a single table, maybe suffix it with as i.e. And the user is logged in as for both scenarios

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the change

And user is logged in
| User Name | Password | Subscription |
| [email protected] | validPassword123 | Paid |
When articles are displayed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step would then become redundant in both scenarios

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was split on whether the login should become a separate scenario or not. I was matching the data in the imperative style

There would at least need to be a step that said the logged user had a paid.free subscription. Keeping that as a data table emphasizes that Subscription is a domain term.

I could write a section on splitting scenarios, which might come after this one.

Copy link
Contributor

@luke-hill luke-hill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the sentences are good but it's likely you're missing the conjunction "the" in most/all of them (Possibly confusing if you're not a native speaker).

Also if you can remove the redundant steps we can get this merged.

Split off the login scenario from the display scenarios.   The logon follows along with the first scenario on this page.
Add conjunctions to the scenarios.
@atdd-bdd
Copy link
Contributor Author

I think this should meet what you asked for. Let me know if I am still missing something. Thanks.

@luke-hill
Copy link
Contributor

Hi @atdd-bdd Think there's still a couple of things to fix up. Missed your comment sorry

@luke-hill luke-hill added the 🍼 incomplete Blocked until more information is provided label Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍼 incomplete Blocked until more information is provided
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants