-
-
Notifications
You must be signed in to change notification settings - Fork 513
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
Getting Feature level Tags in Runtime? #3432
Comments
This won't work because with JUnit 5 and Cucumber we don't have the current test outcome during the test (it is only assembled after the tests are completed). Why don't you use Cucumber hooks for this? |
I have not yet tried Cucumber hooks and our current implementation of the step defs follow older standards. So I dont know how that would work. Even with the implementing the hooks what would I call to get the tag being run? Or is that just a deprecated feature atm? EDIT: |
You can pass a Scenario parameter - see https://cucumber.io/docs/cucumber/api/?lang=java#hooks |
Replied above but that applies to a Scenario, I dont think it returns feature level tags i could be wrong tho? |
It will return any tags applicable to that scenario, no matter what level they are defined at. |
Understood. Will try that out. |
using
is returning a nullpointer. Keeps complatining that there is a null value hence it doesnt want to initialize the test |
You would need to check the Cucumber docs or forums, but I don't think it should be a static. |
You might be right. let me try removing that. |
Still returning the same error even after removing the static. |
That is managed by Cucumber so the Cucumber folks might have some ideas - I've used tags in the past like that but I don't recall where. |
I would like to retrieve the feature level tag during runtime to have a conditional assert. I am currently trying to use
StepEventBus.getParallelEventBus().getBaseStepListener().latestTestOutcome().get().getTags();
But every time it returns nothing. This is a Serenity Cucumber Framework on the latest versions of Junit 5 and Serenity. I am calling this in a actions class with a method annotated with the @step notation. I have not been able to find anything and the only solution I did find was in the archived repo for serenity cucumber.
The text was updated successfully, but these errors were encountered: