我正在尝试使用以下代码创建范围报告:
public static ExtentHtmlReporter htmlReporter;
public static ExtentReports extentReport;
public static ExtentTest extentTest;
@Before
public void beforeCenario(Scenario cenario) {
if(extentReport == null) {
extentReport = new ExtentReports();
htmlReporter = new ExtentHtmlReporter("src/test/resources/htmlReporter.html");
extentReport.attachReporter(htmlReporter);
}
extentTest = extentReport.createTest(cenario.getId());
}
@After
public void afterCenario(Scenario cenario) {
extentTest.log(Status.PASS, "Cenario "+ cenario.getName()+ "executado com sucesso!");
extentReport.flush();
}
但是当我这样做时,我得到了:
挂钩前失败:Steps.beforeCenario(方案)
您能帮我解决吗?谢谢