Search code examples
c#jenkinsnunitextentreportsselenium-extent-report

How can i combine Extent Reports from multiple test runs ?(C#, NUnit)


I need to run my suite of tests in a particular order due to test dependencies. (Yes i know, but the nature of the application i'm testing means there's no way around it.) I'm using Extent Reporter to create test reports, tests are written in C# using the nunit framework. When i run the tests, the report html file gets overwritten with the new tests results. The alternative of having multiple reports is no alternative at all.

I also want to run the tests on Jenkins but again, when running multiple batch commands and multiple playlists, it returns a report of the last tests only.

Is there a way of combining the test results into one report or can anybody see an alternative solution to my problem?

Any and all help is greatly appreciated!

Thanks!!


Solution

  • I discovered a way around my issue. Extent Reports v3 does not currently have a means of appending test reports together. The solution was to revert back to version 2 and use the following code in my reporter class:

    ExtentReports extent = new ExtentReports(file-path, false);
    

    This sets the replaceExisting = false.

    See the extentReports documentation here: http://extentreports.com/docs/versions/2/net/#append-to-report