arrow
arrow copied to clipboard
应用@dataProvider注释时,如运行有错误,在power-emailable-report展示时会把正确的也放到错误里面
应用@dataProvider注释时,如运行有错误,在power-emailable-report展示时会把正确的也放到错误里面。 我的测试代码如下:
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
public class Test2 {
@DataProvider
public Object[][] dataProvider(){
return new Object[][]{{1},{2},{3}};
}
@Test(dataProvider="dataProvider")
public void testAssert1(int a){
Assert.assertEquals(1, a);
}
@Test
public void testAssert2(){
Assert.assertEquals("2", "2");
}
}
结果是:
Suite1
Total tests run: 6, Failures: 2, Skips: 0
但是在 power-emailable-report里面 failed 多出了一项当参数为1时的正确结果。