空 extentX 报告

empty extentX report

extentX 看起来是完美的解决方案,测试结果的集合。

但是,我已按照所有说明进行操作,并已准备就绪 运行ning,但似乎测试信息似乎没有到达范围页面。

它是空的。我可以从仪表板看到测试有 运行 但项目是默认的并且单击它们显示没有信息,但我可以看到它正在获取一些数据,因为它显示了有多少测试已经 运行 以及有多少信息已通过。

我做错了什么吗?

我可以看到标准范围报告完美运行,但它似乎确实被传递到 extentX 服务器。

我运行暂时将所有内容都放在本地,作为概念验证。

我使用的是 extentreports 3.0.1 版

我们将不胜感激,如果有人知道在单个集线器上显示多个测试报告的任何替代方案,那将是非常好的


使用以下页面 - https://github.com/anshooarora/extentreports-java/issues/652#issuecomment-254078018

我设法更进一步,但现在我收到以下错误

java.lang.ExceptionInInitializerError 在下一行

ExtentTest 父级 = ExtentTestManager.createTest(testName);

这是我的 TestNG 基础

public class 测试库 {

private String uri;
protected Logger APPLICATION_LOGS = LoggerFactory.getLogger(getClass());
private static ExtentReports extent;
private ThreadLocal<ExtentTest> parentTest;
private ThreadLocal<ExtentTest> test;
public static ExtentTest childTest;

protected String getUri() {
    return uri;
}

@BeforeSuite
@Parameters({"env"})
public void initialiseReport(String env) {

    ExtentXReporter extentxReporter = new ExtentXReporter("localhost:27017");
    ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter(("user.dir") + "/target/ExtentReports.html");


    extentxReporter.config().setServerUrl("localhost:1337");
    extent = new ExtentReports();
    extent.attachReporter(htmlReporter, extentxReporter);
}

@BeforeClass
@Parameters({"protocol", "env", "server", "port", "endPoint", "testName"})
public void initialiseURI(String protocol, String env, String server, String port, String endPoint, String testName) {
    uri = protocol + env + "." + server + ".mcom:" + port + "/" + endPoint;
    APPLICATION_LOGS.debug("Will use the following URI: " + uri);

    baseURI = uri;
    given().when().post().then().statusCode(200);

    ExtentTest parent = ExtentTestManager.createTest(testName);
    parentTest.set(parent);

}

@BeforeMethod
public final void beforeMethod(Method method) {

    childTest = parentTest.get().createNode(method.getName());
    test.set(childTest);

}

@AfterMethod
public void afterMethod(ITestResult result) {
    switch (result.getStatus()) {
        case ITestResult.FAILURE:
            childTest.fail(result.getThrowable());
            break;
        case ITestResult.SKIP:
            childTest.skip(result.getThrowable());
            break;
        case ITestResult.SUCCESS:
            childTest.pass("Passed");
            break;
        default:
            break;
    }
}

@AfterSuite
public void completeReport() {

    ExtentManager.getExtent().flush();
}

}


设法使用这个 git 项目让它工作

https://github.com/saikrishna321/extent_reports

但我的 extentX 页面仍然是空的,显示有多少测试 运行 但没有附加报告。

原来我使用了错误的范围分布。

从网站下载 zip 时 - https://drive.google.com/open?id=0ByJmgAhaLx0GcmVYNkhBSThUcG8

有效