1

我正在使用 Kotlin 和 TestNG 以及 gradle 作为构建工具的报告门户

compile group: 'com.epam.reportportal', name: 'agent-java-testng', version: '4.2.0'

当我通过 gradle wrapper 运行测试时,它会在运行后在 build 文件夹下生成一堆工件。我对.xml下面的文件内容特别感兴趣/build/test-results/<gradle task name>/<test class.xml>

因为它有一个<system-out>包含所有标准输出的标签。这具有围绕测试失败的有用上下文,例如在失败之前触发了哪些 API 调用/流。

有没有办法让这些信息显示在报告门户中?

构建.gradle

repositories {
    jcenter()
    mavenCentral()
    mavenLocal()

    ...
    maven { url "http://dl.bintray.com/epam/reportportal" }
    ...
}


task runTests(type: Test) {
    useTestNG() {
        testLogging.showStandardStreams = true
        useDefaultListeners = false
        listeners << 'com.epam.reportportal.testng.ReportPortalTestNGListener'
        includeGroups System.getProperty('tag', 'NONE')
    }
}
4

0 回答 0