testng - 倾城标题注释

标签 testng title allure

Allure Report默认情况下能够显示测试名称而不进行更改吗?

当前行为:它将测试名称按单词分隔,并为测试名称中的每个单词设置大写字母。

我正在使用 TestNG 测试框架。

示例:

import org.testng.annotations.Test;

@Test
public void testExample() {
  //do smth
}

将在前端显示“测试示例”。

import org.testng.annotations.Test;
import ru.yandex.qatools.allure.annotations.Title;

@Title('testExample')
@Test
public void testExample() {
  //do smth
}

将在前端显示“testExample”。

我不想在每个测试的 @Title 注释中重复测试名称。 如何避免在每个测试上方都写@Title注解?

最佳答案

您可以在测试用例页面顶部看到方法名称:

The top of the test case page

目前无法更改此行为 - 但我们将删除标题生成功能。请参阅相关的 Github 问题 - https://github.com/allure-framework/allure-core/issues/408 .

关于testng - 倾城标题注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30080370/

相关文章:

javascript - 为灯箱幻灯片标题添加 alt 属性?

r - 向 ggvis 添加情节标题

pytest - 诱惑:在 linux 上找不到命令

report - 来自多个 Allure 报告的汇总数据

pytest - Allure 是否处理 pytest 中的 xfail、xpass、skip 和错误?

java - 在 TestNG xml 文件中,如何在 beanshell 中调用另一个 java 方法?

java - 通过命令终端在 Eclipse 中使用 JUnit 运行 java 文件

java - @Autowired 字段在测试中始终为空,我错过了什么?

java - 如果 TestNG 不尝试运行 JUnit 测试,我的 Maven 项目如何同时运行 JUnit 和 TestNG?

javascript - 如何在 Javascript 中获取 html 页面的标题