我们正在使用 bamboo 来漂亮地打印 junit 输出以进行测试,我想在报告中添加一些版本信息。有没有办法做到这一点?我使用以下参数:
--plugin junit:./output.xml --glue com.package.integrationtest
--plugin com.package.util.LogbackFormatter
我尝试使用以下内容一步步编写版本:
stepdefs.scenario.write(String.format("version: %s",stepdefs.version);
这会将字符串发送到格式化程序(重定向到 logback),但不会将字符串放入 junit 格式化程序中。有没有办法将字符串放入 junit 输出中?
使用jUnit注解方法。
@After
public void afterScenario(Scenario scenario) {
scenario.write("Text you want to write in junit report");
}
可以使用Cucumber中的log方法:
@After
public void afterScenario(Scenario scenario) {
scenario.log("Output to Report");
}