Skip to content

Generic annotation for asterisk prefix #2435

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

Closed
Azukovs opened this issue Dec 10, 2021 · 3 comments
Closed

Generic annotation for asterisk prefix #2435

Azukovs opened this issue Dec 10, 2021 · 3 comments
Labels
⌛ stale Will soon be closed by stalebot unless there is activity

Comments

@Azukovs
Copy link

Azukovs commented Dec 10, 2021

Is your feature request related to a problem? Please describe.
I have some very specific feature files that have long tests that validate multiple things written in non-english language, the Given -> When -> Then structure doesn't make sense here. I tried replacing feature file keywords with *, and that works just fine, however the problem is the step definition is not logical.
There doesn't seem to be any way to have a "universal" annotation to use for asterisk steps, only Given, When, Then, And, But exists. It's not very logical to have a * Some step in a feature and @Given("Some step") definition.
Additionally (but this would be IntelliJ IDEA problem) if I'm trying to generate a step definition from a new step in this form - * Some step - the generation intent doesn't function at all, probably because there is no annotation to assign when asterisk is used.

Describe the solution you'd like
An additional annotation that would correctly reflect the asterisk step in feature file and would function when generating the step definition, something like @Step("Some step") would be just fine.

Describe alternatives you've considered
Using different language for Given -> When -> Then steps doesn't make sense either due to test structure, which is too complex, and does multiple validations within the test. Not the best practice, I'm fully aware, but in my case unavoidable due to project specifics.

@mpkorstanje
Copy link
Contributor

A generic step definition would also allow the complexity of getPreviousGivenWhenThenKeyword to be removed.

String keyword = step.getType().isGivenWhenThen() ? step.getKeyword() : step.getPreviousGivenWhenThenKeyword();

@stale
Copy link

stale bot commented Apr 14, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two months if no further activity occurs.

@stale stale bot added the ⌛ stale Will soon be closed by stalebot unless there is activity label Apr 14, 2023
@mpkorstanje
Copy link
Contributor

Superseded by #2705

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⌛ stale Will soon be closed by stalebot unless there is activity
Projects
None yet
Development

No branches or pull requests

2 participants