email2vimalraj / CucumberExtentReporter

A plugin to generate the cucumber jvm custom html report using ExtentsReport
http://www.vimalselvam.com/cucumber-extent-reporter/
MIT License
58 stars 74 forks source link

HTML reports which are generated are not getting append in next run, its overwriting #76

Open MaxTester1 opened 6 years ago

MaxTester1 commented 6 years ago

Hi

i wanted all my previous reports available along with latest report but its overwriting report every time test gets executed. please fix this issue its very much required feature for me.

below is my test runner class:

package com.cgi.in;

import java.io.File; import java.io.IOException; import java.util.Date;

import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass;

import com.cucumber.listener.Reporter;

import cucumber.api.CucumberOptions; import cucumber.api.testng.AbstractTestNGCucumberTests;

@CucumberOptions( plugin = "com.cucumber.listener.ExtentCucumberFormatter:testresults/Test_Results.html", features ="src/test/java/features", tags = "@rest1") public class Runner extends AbstractTestNGCucumberTests {

    @BeforeClass
    public static void setup() throws IOException{      

    }

    @AfterClass
    public static void TearDown() throws InterruptedException {

        Reporter.loadXMLConfig(new File("src/test/resources/extent-config.xml"));
        Reporter.setSystemInfo("user", System.getProperty("user.name"));
        Reporter.setSystemInfo("OS", "Windows 7");
        Reporter.setSystemInfo("Environment","Demo");
        Reporter.setTestRunnerOutput("Smoke Test Execution");
        **Reporter.getExtentHtmlReport().setAppendExisting(true);**
    }
}

In Step Definitions:

@Given("^I construct url \"([^\"]*)\" with baseURL$")
public void I_construct_url_with_baseURL(String strApiUrl) throws Throwable {
    strBaseUrl = strBaseUrl+strApiUrl;

    Reporter.addStepLog("url is constructed with base url and final"
            + " url is : "+"\n '"+strBaseUrl+"'");
}
15d6d commented 6 years ago

I am facing same problem ,i am not getting merge report ,getting single scenario report.