1

I'm using ExtentReports (version 5.0.5) with JUnit 5. Here is my BaseTest class snippet.

public class BaseTest
{
    protected static ExtentReports extent;
    protected ExtentTest test;
    protected ExtentTest node;

    @BeforeAll
    static void oneTimeSetup()
    {
        extent = new ExtentReports();
        ExtentSparkReporter spark = new ExtentSparkReporter(
                "target/results" + TimestampGenerator.currentTimestamp() + ".html");
        extent.attachReporter(spark);
    }

    @AfterAll
    static void oneTimeTearDown() throws Exception
    {
        extent.flush();
    }
}

I have 2 test classes in the suite. If I do not use the timestamp in the report name, the program creates one report for the last test class. That's why I added the timestamp. Now when I run the suite in Eclipse, it creates 2 HTML reports for each test class in the suite.

enter image description here

How can I have only one file that contains info for both test classes?

Vladimir
  • 630
  • 3
  • 12
  • 26

1 Answers1

0

You can write a separate class which will read the contents of both reports and create a new HTML report with contents of both files.

O_K
  • 922
  • 9
  • 14