【发布时间】:2020-07-07 15:53:26
【问题描述】:
我想在 junit 测试生成的 xml 报告中添加一些属性,以便为我的测试添加可追溯性
这就是我想要的:
class MyTest{
@Test
@AddAttribute("key","value")
fun myTest()
{
}
}
然后将这对 ("key","value") 添加到我的 report.xml 中,例如:
<?xml version='1.0' encoding='UTF-8' ?>
<testsuite name="MyTests" tests="1" failures="0" errors="0" skipped="0" time="20.846" timestamp="2020-07-07T15:07:57" hostname="localhost">
<properties>
<property name="project" value="app" />
</properties>
<testcase name="MyTest" classname="MyTest" time="12.912" key="value" />
</testsuite>
有什么想法吗?
【问题讨论】:
标签: android xml kotlin testing junit