当前位置 : 主页 > 网络安全 > 测试自动化 >

TestNG(十) 依赖测试

来源:互联网 收集:自由互联 发布时间:2021-06-19
package com.course.testng.suite; import org.testng.annotations.Test; public class DepenTest { @Test public void test1(){ System.out.println( "test1 run" ); throw new RuntimeException(); } @Test(dependsOnMethods = {"test1" }) public void tes
 
  
  
package com.course.testng.suite;

import org.testng.annotations.Test;

public class DepenTest {
    @Test
    public void test1(){
        System.out.println("test1 run");
        throw new RuntimeException();
    }

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

 

package com.course.testng.suite;

import org.testng.annotations.Test;

public class DepenTest {
    @Test
    public void test1(){
        System.out.println("test1 run");

    }

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

 

 

网友评论