damianszczepanik / cucumber-reporting

HTML reports for Cucumber
GNU Lesser General Public License v2.1
546 stars 402 forks source link

remove duplicate scenarios from the same cucumber.json file caused due to retry mechanism #940

Open ramyasreemaley opened 4 years ago

ramyasreemaley commented 4 years ago

when the failed scenario will be retried immediately after the failure during execution, This results in the json entry twice in the same cucumber.json file.

If the scenario, runs successfully after retry, cucumber reports show error once and successful once. but the overall status of the feature will be failure.

damianszczepanik commented 4 years ago

Can you clarify the problem again?

ramyasreemaley commented 4 years ago

I am using retryAnalyzer of testNG for retry mechanism (So the retry happens just after the scenario is failed but not at the end of the test execution). Because of this, if the scenario is failed for the first time and succeeds the second time, this is reported in the same cucumber.json file.

When I check, I see the the same id for both the executions. I tried MergeWithId option but it did not effect as it compares the scenario's with same id from different cucumber.json files.

ramyasreemaley commented 4 years ago

I think this is similar to https://github.com/damianszczepanik/cucumber-reporting/pull/914

Will this feature be added to plugin?

damianszczepanik commented 4 years ago

https://github.com/damianszczepanik/cucumber-reporting/blob/master/src/main/java/net/masterthought/cucumber/reducers/ReducingMethod.java#L64 does it look like the solution?

ramyasreemaley commented 4 years ago

I have tried this but it does not work in this scenario

damianszczepanik commented 4 years ago

Then I don't think I can help you

stevegome commented 11 months ago

Hi Team, is there any fix for the ^ issue ?

costea32 commented 6 months ago

I had some issues that are related to this thread, using report generation through the maven plugin, what I found was that I had duplicate results in the final report because of the MergeFeatures flag, which was true on the plugin. In ReportFeatureMergerFactory you can see that the order of mergers are merge features first, then merge rerun scenarios, due to this order if you have the flag for merge features you will always get duplicate results in the end report. make sure that you don't have the MergeFeatures enabled, or remove the ReducingMethod.MERGE_FEATURES_BY_ID;

A solution to this would be to invert the order of processing the reducing methods.

damianszczepanik commented 6 months ago

Would you like to prepare PR for that ?