例子:

package com.uuu;

import org.testng.Reporter;

import org.testng.annotations.Test;

import org.testng.annotations.BeforeTest;

import org.testng.annotations.AfterTest;

public class NewTest {

@Test

public void f() {

  System.out.println("123");

}

@Test(dependsOnMethods = {"f"})

public void a() {

  System.out.println("123");

}

}

 

说明:

在Test上写入要依赖的测试用例即可

执行的时候会先去执行依赖的测试用例,比如上面的2个测试用例 会先执行 f 再执行 a

相关文章:

  • 2022-12-23
  • 2021-09-06
  • 2022-12-23
  • 2021-04-27
  • 2021-09-23
  • 2021-07-18
  • 2021-07-19
猜你喜欢
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-08
  • 2021-07-13
相关资源
相似解决方案