[英]How to execute a test just after another test has been executed?
我需要在執行另一種測試方法( testB
)之后執行testNG測試方法( testA
)。 我也想用@Test
注釋testA,因為我想告訴testNG它是一種測試方法而不是配置方法。
我可以使用@AfterMethod
進行處理,但是testNG將testA視為我不希望使用的配置方法。
我還需要在執行testB之后立即執行testA。 我不想在這之間進行其他測試。 我該怎么做呢?
采用
@Test (dependsOnMethods={"methodB"})
public void methodA () {
}
另請參見http://testng.org/doc/documentation-main.html#dependent-methods
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.