可以使用 enabled 属性来禁用测试用例的运行。可以将 false 值分配给 enabled 属性,这样我们就可以禁用测试用例的运行。
package com.yiibai;
import org.testng.annotations.Test;
public class Test_cases
{
@Test(enabled=false)
public void testcase1()
{
System.out.println("testcase1");
}
@Test
public void testcase2()
{
System.out.println("testcase2");
}
}