-
-
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
How to get scenario name before driver instantiation? #3173
Comments
In parallel execution, due to the nature of the event messages, this information is not available until the end of the scenario execution. |
I understand. But in this case can I get at least the feature name? Otherwise what should I put in the "name" capability so that it makes sense when I look in the Saucelabs Dashboard when checking the test executions? |
The JUnit 5 and Cucumber event logs make this extremely difficult in general. I don't recall if we found a solution - have a look at the current serenity-saucelabs and serenity-browserstack modules to see. |
Thank you for the quick responses. |
@wakaleo I found a quick solution looking into the serenity-saucelabs module: |
@wakaleo Another thing I noticed is that the code that I have in a @BeforeAll hook is executed before driver instantiation if I use cucumber-junit 7.2.3, but if I upgrade to version 7.12.1 then the driver instantiation is done before the @BeforeAll hook. Is this normal? |
Scratch that. After upgrade it was using the @BeforeAll annotation from Junit instead of the one from Cucumber. Not sure why this happened but with the one from Cucumber, then the code in the @BeforeAll method is executed before driver instantiation. |
I have a custom driver implementation:
`
The first line worked in serenity 3.2.5 and returned the title of the scenario that is under execution.
Now I am trying to upgrade serenity, cucumber and junit in order to be able to execute scenarios in parallel, not just features.
Currently, with serenity version 3.8.1 the line looks like this
String scenarioName = StepEventBus.getParallelEventBus().getBaseStepListener().getCurrentTestOutcome().getName();
but the scenario name always returns "Test outcome unavailable"
The text was updated successfully, but these errors were encountered: