使用带有TestNG @Factory 批注的测试运行时,所有配置方法都列在“魅力”报告的每个“设置”下。
代码:
public class TestPoc {
@TestInstanceParameter("Iteration")
int i = 1;
public TestPoc() {
}
public TestPoc(int i) {
this.i = i;
}
@BeforeClass
public void beforeClass() {
}
@Test
public void stepFailDemo() {
try {
failStep();
} catch (AssertionError e) {/*do nothing*/
}
}
@Step("Failing step")
private void failStep() {
Assert.fail("Failing an inner step " + i);
}
@Factory
public Object[] myFactory() {
return new Object[]{new TestPoc(5), new TestPoc(6), new TestPoc(7)};
}
}
预期的行为-在每个“设置”中,仅显示相关的测试配置方法,而不是全部。
版本:testng = 6.14.3和allure-testng = 2.13