Java TestNG@BeforeMethod和@AfterMethod按组运行
我希望每组有@beforeMethod和@AfterMethod用于安装和拆卸 我尝试过这样做,但它总是执行start()/end()和start2()/end2() 输出:Java TestNG@BeforeMethod和@AfterMethod按组运行,java,testng,Java,Testng,我希望每组有@beforeMethod和@AfterMethod用于安装和拆卸 我尝试过这样做,但它总是执行start()/end()和start2()/end2() 输出: Start Start2 test1 End End2 Start Start2 test12 End End2 Start Start2 test2 End End2 Start Start2 test22 End End2 我希望此输出为: Start test1 End Start test2 End Start2
Start
Start2
test1
End
End2
Start
Start2
test12
End
End2
Start
Start2
test2
End
End2
Start
Start2
test22
End
End2
我希望此输出为:
Start
test1
End
Start
test2
End
Start2
test12
End2
Start2
test22
End2
我不知道如何才能做到这一点?此处需要帮助。“我希望每组都有@beforethod
和@AfterMethod
,用于安装和拆卸。”
您需要的是称为@BeforeGroups
和@AfterGroups
。
“我希望每组都有@beforethod
和@AfterMethod
,用于安装和拆卸。”
您需要的是称为@BeforeGroups
和@AfterGroups
。
Start
test1
End
Start
test2
End
Start2
test12
End2
Start2
test22
End2