dependsOnMethods的默认行为是意外的

时间:2017-03-23 06:33:42

标签: testng

在dependsOnMethods上的第一级后,TestNG无法挖掘。 TestNG版本:6.11
testsNg的dependsOnMethods无法正常工作。

 @Test
                            public void test1(){
                                System.out.println("test1");
                            }
                            @Test(dependsOnMethods={"test1"})
                            public void test2(){
                                System.out.println("test2");
                            }
                            @Test(dependsOnMethods={"test2"})
                            public void test3(){
                                System.out.println("test3");
                            }
                            @Test(dependsOnMethods={"test3"})
                            public void test4(){
                                System.out.println("test4");
                            }
                            @Test(dependsOnMethods={"test4"})
                            public void test5(){
                                System.out.println("test5");
                            }

当我运行testcase test5时,它会向我显示结果

PASSED: test1


===============================================
    Default test
    Tests run: 1, Failures: 0, Skips: 0
===============================================


===============================================
Default suite
Total tests run: 1, Failures: 0, Skips: 0
===============================================

1 个答案:

答案 0 :(得分:1)

尝试将TestNg版本降级到6.9.13.6