TestNGExtentsReport icon indicating copy to clipboard operation
TestNGExtentsReport copied to clipboard

Adding ExtentCucumberFormatter plugin in testrunner file failed to create new TestNGCucumberRunner(this.getClass()); object

Open jainamit1712 opened this issue 5 years ago • 0 comments

This works well when i dont add "com.cucumber.listener.ExtentCucumberFormatter:target/cucumber-reports/report.html" plugin in my TestRunner file. But as soon as i add this plugin it failed to create this object testNGCucumberRunner = new TestNGCucumberRunner(this.getClass());

Could you please suggest what am i doing wrong here!

@CucumberOptions(features= {"src\test\resources\FunctionalTests"}, glue= {"stepDefinitions"}, plugin = {"pretty", "html:target/html/", "json:target/json/file.json", "com.cucumber.listener.ExtentCucumberFormatter:target/cucumber-reports/report.html"

}, strict=false, dryRun=false, monochrome = true, tags= "@test" )

public class TestRunner{ private TestNGCucumberRunner testNGCucumberRunner;

@Parameters({"browsername"}) @BeforeClass(alwaysRun = true)
public void setUpClass(String browsername) throws Exception {

testNGCucumberRunner = new TestNGCucumberRunner(this.getClass()); 
 Reporter.loadXMLConfig(new File("src\\test\\resources\\extent-config.xml"));

}

@Test(groups = "cucumber", description = "Runs Cucumber Scenarios", dataProvider = "scenarios") public void scenario(PickleWrapper pickle, FeatureWrapper cucumberFeature) throws Throwable {
testNGCucumberRunner.runScenario(pickle.getPickle());
} @DataProvider
public Object[][] scenarios() {
return testNGCucumberRunner.provideScenarios();
}
@AfterClass(alwaysRun = true)
public void tearDownClass() throws Exception{

testNGCucumberRunner.finish();
}

jainamit1712 avatar Nov 17 '20 02:11 jainamit1712