我想使用我给出报告而不是方法名称的测试名称。
这是我命名测试的地方。
@Test(testName = "The test name is test", retryAnalyzer = RetryAnalyzer.class)
这是我获取测试名称的before方法
@BeforeMethod
public synchronized void beforeMethod(Method method) {
ExtentTest child = parentTest.get().createNode(method.getName());
test.set(child);
我希望before方法在测试开始时读取测试名称。
谢谢
而不是@Test(testName =“测试名称是测试”)使用@Test(Description =“测试名称是测试”)
并使用下面这行。
ExtentTest child = parenttest.get()。createNode(method.getDescription()。getName());
这个有效!!