如何从TestNG中的测试用例集合中合并和删除测试方法?
示例
Testngxml文件。
<?xml version = "1.0" encoding = "UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name = "Tutorialspoint Test ">
<test name = "Test Cycle">
<groups>
<run>
<include name = "Smoke"/>
<exclude name = "CodingModule"/>
</run>
</groups>
<classes>
<class name = "TestRegularExpression" />
</classes>
</test>
</suite>testNGxml具有要包含的Smoke组和要从执行中排除的CodingModule组。
示例
@Test(groups={"Smoke"})
public void ContactDetails(){
System.out.println(“Contact details verification is successful”);
}
@Test(groups={"CodingModule"})
public void verifyInvoice(){
System.out.println(“Invoice verification is successful”);
}在Java类文件中,组用于查明测试方法。组(例如Smoke)的测试方法将添加到运行中,而CodingModule将从执行中排除。因此,ContactDetails()测试方法将运行,但verifyInvoice()将被排除在执行之外。
热门推荐
10 看病贺卡祝福语简短英文
11 姐妹分手了祝福语简短
12 送情侣生日祝福语简短
13 写给情侣祝福语 浪漫简短
14 友谊晚上祝福语大全简短
15 上岸离职祝福语大全简短
16 打牌翻盘祝福语简短
17 城堡文案简短婚礼祝福语
18 女朋友考试祝福语简短