Discussion:
[Cucumber] [Cucumber-JVM]: Cucumber @After hook executed twice
Add Reply
Wong Peter
2018-04-12 08:07:49 UTC
Reply
Permalink
Raw Message
I"m implemnet Cucumber Testng for learning purposes. I"m realizes that
@After hook method is executed twice. I can confirm it with debugging set
and test report output. I"m only execute 1 feature file and my test report
has two same class names.

Do you guys know why?

<Loading Image...>
@After
public void tearDown(Scenario scen) throws IOException {
ExtentTest logger = reportMgr.getLogger();
String feature = getClass().getName() + " Feature"; //+ "." +
Thread.currentThread().getStackTrace()[1].getMethodName().toString();
logger = reportMgr.getExtent().createTest(feature);
String screenShot =
CaptureScreenshot.captureScreen(WebDriverManager.driver,
CaptureScreenshot.generateFileName(feature));
if (!scen.isFailed()) {
logger.pass("Pass");
logger.addScreenCaptureFromPath(screenShot);
} else {
logger.fail("Fail");
logger.addScreenCaptureFromPath(screenShot);
}
}





Please help. Thanks.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...