我正在使用 testng 编写魅力报告,并且有一个非常基本的方法,如下所示。
@Test
@DisplayName("Hello this is a description for allure report")
public void method1(){
System.out.println("Hi i am from method1");
}
在上面的代码中,@DisplayName 来自 allure 报告。现在我想要实现的是在运行时使用 TestngListners 设置 DisplayName。
我查看了 ITextResult 和 ITestContext,但据我所知,它不支持此功能。
有没有其他方法可以实现这一目标?