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

Consider adding After as keyword to the Gherkin syntax #94

Open
JayGray opened this issue Feb 10, 2023 · 2 comments
Open

Consider adding After as keyword to the Gherkin syntax #94

JayGray opened this issue Feb 10, 2023 · 2 comments

Comments

@JayGray
Copy link

JayGray commented Feb 10, 2023

🤔 What's the problem you're trying to solve?

Even though Cucumber itself provides hooks to clean up any mess created by every test, I'm missing a simple solution
to tidy up some leftovers of a special test case.

99% percent of our test behave in a good manner and don't leave anything behind or the app in question in a bad shape
however, there are a few tests that require a cleaning crew.

ATM we just add a And/Then step to the end of the scenario

✨ What's your proposed solution?

Adding an AFTER step to the Gherkin keywords that behaves as Background just after a scenario is finished.

⛏ Have you considered any alternatives or workarounds?

Yes, using the after* hooks with much extra logic to determine if the hook is even needed to execute.

📚 Any additional context?

Dunno yet, let me know if you need more.

PS. Adding the keyword is not the end of the story as all the different language implementations of parsing and executing Gherkin need to support it as well, but I thought this is the best place to start.

Thx

@lu-maca
Copy link

lu-maca commented Feb 27, 2023

+1

@ehuelsmann
Copy link
Contributor

Yes, using the after* hooks with much extra logic to determine if the hook is even needed to execute.

What extra logic is required if you apply tags to the scenarios and use conditional "After" hooks as per https://cucumber.io/docs/cucumber/api/?lang=java#conditional-hooks ?

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

No branches or pull requests

3 participants