Skip to content

应用@dataProvider注释时,如运行有错误,在power-emailable-report展示时会把正确的也放到错误里面 #3

@MattGong

Description

@MattGong

应用@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时的正确结果。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions