cucumber-reporting icon indicating copy to clipboard operation
cucumber-reporting copied to clipboard

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

Open ramyasreemaley opened this issue 4 years ago • 9 comments

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.

ramyasreemaley avatar May 20 '20 10:05 ramyasreemaley

Can you clarify the problem again?

damianszczepanik avatar May 21 '20 21:05 damianszczepanik

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 avatar May 22 '20 19:05 ramyasreemaley

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

Will this feature be added to plugin?

ramyasreemaley avatar May 23 '20 06:05 ramyasreemaley

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

damianszczepanik avatar May 24 '20 19:05 damianszczepanik

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

ramyasreemaley avatar May 25 '20 11:05 ramyasreemaley

Then I don't think I can help you

damianszczepanik avatar May 27 '20 20:05 damianszczepanik

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

stevegome avatar Oct 19 '23 07:10 stevegome

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.

costea32 avatar Mar 18 '24 08:03 costea32

Would you like to prepare PR for that ?

damianszczepanik avatar Mar 19 '24 17:03 damianszczepanik