您将如何为TestNG中的每个测试运行先决条件方法和后置条件方法?
示例
@BeforeMethod
public void prerequisite(){
System.out.println("Run before every tests");
}
@AfterMethod
public void postcondition(){
System.out.println("Run after every tests ");
}
@Test
public void loanPay(){
System.out.println("Loan pay is successful");
}在Java类文件中,prerequisite()将执行带有@BeforeMethod的方法,这被称为每种测试方法的前提。然后loanPay()将被执行,最后postcondition()带有@AfterMethod的方法将运行。
热门推荐
10 财运虎年祝福语简短语
11 单亲爸爸春节祝福语简短
12 狗狗上厕所训练
13 植物种植祝福语简短
14 翻译考试祝福语朋友简短
15 个人周年庆简短祝福语
16 狗狗怎么训练
17 分别祝福语简短搞笑英文
18 生日广州男生祝福语简短