【问题标题】:Add parameter to test title in allure在 allure 中添加参数到测试标题
【发布时间】:2015-09-18 13:21:19
【问题描述】:

我将 Allure 与 jUnit 一起使用。在参数化测试中,我在标题中看到参数

当我想通过@Title 注释提供自定义标题时,这些参数不会显示。我尝试将参数指定为@Title("Test {0}"),但效果不佳。

有没有办法在测试用例中自定义标题和参数?

【问题讨论】:

    标签: testing junit allure


    【解决方案1】:

    name设置成@Parameterized注解怎么样?

    @Parameterized.Parameters(name = "My cool test {1} {2} {3}")
    

    UPD: Allure 按原样获取 @Title 注释值,既不支持 {method} 也不支持 {i} 符号,因为它是在没有方面的情况下处理的。 Java 不允许在注解中使用动态表达式。

    【讨论】:

    • 我试过并得到了Calculation test [My cool test 1]。但我希望替换整个标题,而不是括号内容
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-08-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-04
    • 2020-04-07
    相关资源
    最近更新 更多