gradle - 如何在报告门户上查看来自 gradle 的 TestNG 测试结果 xml 结果?
问题描述
我正在使用 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')
}
}
解决方案
推荐阅读
- javascript - 如何检查承诺是否已解决并有条件地渲染 Javascript?
- scala - 如何验证 Scala 二进制文件?
- java - Kafka 向 Spark Streaming 发送消息时出错
- database-design - 可以从过去的数据库状态中选择的版本化数据库引擎?
- javascript - 编辑时输入 http://localhost:8000/controller/1 500(内部服务器错误)
- angular - Ionic v4 - 检查模态是否打开
- fetchmail - 需要立即从邮件服务器获取邮件
- javascript - 映射对象数组并根据名字过滤
- tensorflow - GAN 没有多 GPU 加速
- python - 在我的猜谜游戏中将用户输入验证为整数