anshooarora / extentreports-csharp

Community version of Extent API for .NET has moved to https://github.com/extent-framework/
http://extentreports.com/
Other
47 stars 43 forks source link

Wrong reporting while creating Multiple Extent Reports in a single Execution for different Modules #99

Closed chakraborty-rupam closed 6 years ago

chakraborty-rupam commented 6 years ago

Hi, I have a framework which is testing both APIs and UI (in seperate modules) and uses Specflow BDD framework.

I'm doing a one time initialization of 2 different ExtentReport instances (one for UI and one for API). They have their own HtmlReporter object pointing to different html path locations(apparently I want the reports to get generated at different paths for API and UI) When I am executing only API or only UI tests, I can see extent reports are getting generated fine. But, the issue is - When I try to mix and match UI and API tests, I can see 2 Extent Reports generated at the specified locations, BUT - both the reports have UI as well as API tests reported.

Though when I'm reporting the Failure, different ExtentTest objects are reporting it which are created by different ExtentReport objects.

Any suggestions/alternatives appreciated.

Thanks!

chakraborty-rupam commented 6 years ago

Oh forgot to mention - I'm running these tests using Nunit and they are running in parallel mode.

chakraborty-rupam commented 6 years ago

@anshooarora : Hi, could you please advise if this is really a limitation or am I missing something here?

anshooarora commented 6 years ago

It depends on your usage, this is not a limitation.

You need 2 instances of ExtentReports, and each instance must have the correct test instance.

var apiExtent = new ExtentHtmlReporter();
apiExtent..CreateTest("APITest").AssignCategory("API");

var uiExtent = new ExtentHtmlReporter();
uiExtent..CreateTest("UITest").AssignCategory("UI");