@Factory运行的所有配置方法都在吸引力报告的每个“设置”下列出

时间:2020-03-27 18:34:28

标签: java testng factory allure testng-dataprovider

使用带有TestNG @Factory 批注的测试运行时,所有配置方法都列在“魅力”报告的每个“设置”下。

enter image description here

代码:

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

0 个答案:

没有答案