-
-
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
Bad scenario and step alignement in reports for Scenario Outline #3296
Comments
Can you provide a sample project? This is very hard to reproduce and very tricky to fix, so I'm not sure when it will get looked at. |
I tried to reproduce this problem in a simplified project because I cannot upload the one I'm working on. Here's the project: https://github.com/Rangiferus/basic_tg_serenity_project |
In your scenario outline, each row in the example tables is a separate scenario and so will be reported as a separate test case (not as a step, although they appear as top-level steps in the test result page) - this seems normal in 4.0.18, so maybe I am not understanding the issue you are seeing?
|
Yest, that's true - 2 test cases were not executed in this example scenario. As for the original problem which still messes up my reports, it must have something to do with the nested screeplay tasks mixed with other code that also calles other methods that include screenplay tasks.
Maven runs print sensible output in the console but aggregated reports look totally bad and it's impossible to guess what happened with failed or broken cases. |
I feel like the issue iam seeing at this point might be related to this one. 4.0.18 is the last version where I see it behaving as expected, after this version I see the following behaviour; In case of a Scenario Outline, when an assertion (which is not in the StepsDefinitions but a layer deeper for instance in a Steps Libraray) fails or an exception is thrown, the report is not displaying the steps as expected. First issue is the overview shows the tests as 'ignored' while they are in fact 'Failed'. That is not the worst because on the main overview page they are indicated as failed which is the page most people look at anyway. I have a demo project that consistently reproduces this issue. As said I only see the behaviour when the failing assert, or exception occurs on a deeper level than the StepDefinitions. We however, for instance, validate a response code to be 200 for API calls which are not always happening on that step definition level but deeper into the code. This will result in the above reporting behaviour. In the demo project I run serenity version 4.0.29 and serenity-gradle-plugin 4.0.27. Downgraden these to 4.0.16 will at least fix the merging of the steps in case of a failure. It will however remain to show the steps as 'ignored' instead of 'failed' Demo project : https://github.com/Johan-Sap/eu_pvh_demo2 (build with Gradle) If this issue is in no way connected, or already know please let me know so I can either create a new issue for it or follow the already known issue. |
@Rangiferus , what was the latest version when you saw correct behaviour? We have checked the differences between 4.0.18 and 4.0.19 but we saw there no significant changes. |
@cliviu I searched a bit more and actually found a small code change between 4.0.18 and 4.0.19. Creating a snapshot with that change reverted solves my problems In the snapshot I created I moved the currentStepDone method outside of the If statement. If I read the code correctly, when the currentStepDone method is INSIDE the if, it will only get triggered when the STEP Outcome is SUCCESS. (!hasStepFailed). When debugging I see for a failed step it does not get into this if. That would ultimately result in not triggering the currentStepDone method. It would in my opinion make sense the testcase is not closed (step was never closed) and the first steps of the next example become part of the failed step of the previous example. Below code works I don't know why this code was moved into the IF statement so I am hesitant to make a pull request for this one. Maybe you (as you did the original change) still know what the reasoning behind it was and can make a better estimation on if reverting back will break other code. I also realise now that my issue might not be as connected to the issue iam posting this in after all. If a new ticket is for this issue is required let me know. I will then create it. |
Hi, @Johan-Sap , the Pull Request is already done, it should be included in the next version. Thanks for your support |
Let's see if it helps. |
What happened?
Failed cases of scenarios defined as Scenario Outline are improperly aligned in reports.
Bad failed step treatment
Failed steps are reported as scenarios in the "Overall Test Results" tab.
The first failed test case is not listed in the scenario details view (when clicked on a failed scenario in the "Overall Test Results".
Failed and broken steps are improperly aligned in the expanded view.
What did you expect to happen?
No response
Serenity BDD version
4.0.14
JDK version
11
Execution environment
Maven, Chrome
How to reproduce the bug.
Create a Scenario Outline with Examples with failing and broken cases.
How can we make it happen?
Add it to the Serenity BDD backlog and wait for a volunteer to pick it up
The text was updated successfully, but these errors were encountered: