-
Notifications
You must be signed in to change notification settings - Fork 5
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
build: ensure order of tests using the @DataProvider annotation #12
Comments
just curious as to how the order of tests is effecting the Xray extension? regardless of the order of execution, the last data/example {5, true} will always fail. Also in the test method body, we are just attaching the same attachment as attribute for all the examples. xray-testng-extensions/src/test/java/app/getxray/xray/testng/tests/DataDrivenExamples.java Line 39 in 828fe56
Perhaps I wasn't able to spot whats the linkage of this issue with build/release? Could you please elaborate a little whats the issue here so maybe i can also take a detailed look to investigat the problem |
The problem is with this datadriven scenario. |
Thank you for sharing the detailed issue. So if I understood correctly, the build failed because of the random order of We have hardcoded expected results in our test, and we expect the actual results iterations to be in ascending order (as in Data Provider). We should be able to solve this problem by implementing custom comparator for our use xray-testng-extensions/src/test/java/app/getxray/xray/testng/tests/XrayJsonReportTests.java Line 214 in 828fe56
Here is how the solution may look like:
Now that the iterations is sorted, the next set of assert statements should be passed our iterations is now in order. I look forward to your feedback if you could please try this solution and let me know if it works. |
Thanks @itkhanz ; I applied a workaround based on that code snippet with some adjustments. |
released in 0.2.0 |
Review test code, namely of the datadriven tests, to ensure the order of tests and avoid flakiness on the build.
See:
The text was updated successfully, but these errors were encountered: