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

Null pointer exception when running test cases for specific tag #65

Closed sapan-kumar closed 6 years ago

sapan-kumar commented 6 years ago

When I run my cucumber test case for a single tag e.g.

mvn clean verify -Dcucumber.options="--tags @abc"

and my runner class looks like

@RunWith(Cucumber.class) public class RunCukesTest {

@AfterClass
public static void teardown() {
    try {
        Reporter.loadXMLConfig(new File("src/test/resources/extent-config.xml"));
        Reporter.setSystemInfo("user", System.getProperty("user.name"));
        Reporter.setSystemInfo("os", "Win");
        Reporter.setTestRunnerOutput("Sample test runner output message");
    }
    catch (Exception exp) {
        exp.printStackTrace();
    }
}

}

Note: There is no error when I remove the @abc from the feature file and I simply run mvn clean verify

the situation comes only when I try to run specific test case with @tag

sapan-kumar commented 6 years ago

Was not providing enough options in the -Dcucumber.options.