Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jainamit1712 opened this issue Nov 17, 2020 · 0 comments

Comments

@jainamit1712
Copy link

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 jainamit1712 changed the title Adding ExtentCucumberFormatter plugin in testrunner file resulting in null pointer exception in testNGCucumberRunner.provideScenarios() Adding ExtentCucumberFormatter plugin in testrunner file failed to create new TestNGCucumberRunner(this.getClass()); object Nov 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant