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

How to Fail a step using cucumber extent report without throwing exception #106

Open Ranjit2017 opened 5 years ago

Ranjit2017 commented 5 years ago

In my project I am using both Extent Report and Cucumber Extent Report.

Features i am getting from Extent report :- public static void logStart(String testname) throws ClassNotFoundException { // logger = extent.startTest("..." + testname); // logger = extent.logger = extent.createTest(testname, testname); Log.startTestCase(testname); } public static void reportInfo(String info) { logger.log(Status.INFO, info); Log.info(info); }

public static void reportPass(String testname) throws ClassNotFoundException {
    // logger = extent.createTest(testname, "");
    logger.log(Status.PASS, testname + " : Is Passed");
    Log.info(testname + " : is passed");

}

public static void reportLogFail(String testname, String stepName) throws IOException, ClassNotFoundException {
    logger.log(Status.FAIL, "Failed : " + stepName);
    Log.info("Failed : " + stepName);
    Log.FailedTestCase(testname);
}

But how i can get the same kind of methods in Cucumber extent report as its only give two methods

1.Reporter.addStepLog(""); 2.Reporter.addScenarioLog("");