用扩展报告设置Klov



我第一次尝试用一个新项目来设置Klov。我已经安装了mongodb的正确版本,并拥有klov jar。在运行测试之前,我在cmd中运行了这两个程序。当我在浏览器中查看我的Klov报告时,除了"选择你的项目:"下拉列表中没有列出任何项目之外,其他一切似乎都正常工作。有人知道我为什么会犯这个错误吗?

public class MyRunner {
private static KlovReporter klov;
private static ExtentReports extent;
private static Date d;
private static ExtentHtmlReporter htmlReporter;
@BeforeClass
public static void initialize(){
d = new Date();
extent = new ExtentReports();
klov = new KlovReporter();
htmlReporter = new ExtentHtmlReporter("ExtentReport.html");
htmlReporter.setAppendExisting(true);
htmlReporter.config().setChartVisibilityOnOpen(true);
htmlReporter.config().setDocumentTitle("Klov Example");
htmlReporter.config().setReportName("Test");
htmlReporter.config().setTestViewChartLocation(ChartLocation.TOP);
htmlReporter.config().setTheme(Theme.STANDARD);
klov.initMongoDbConnection("localhost",27017);
klov.setProjectName("klovexample");
klov.setReportName("Test" + d.toString());
klov.setKlovUrl("http://localhost:80");
extent.attachReporter(htmlReporter, klov);
extent.createTest("ROF");
}
@AfterClass
public static void teardown(){
klov.flush();
}

使用

extent.flush();

代替

klov.flush();

还添加了一个日志家伙:

extent.createTest("ROF").pass("log");

最新更新