How to disable TestNG test based on a condition

前端 未结 7 1354
挽巷
挽巷 2020-12-05 07:23

Is there currently a way to disable TestNG test based on a condition

I know you can currently disable test as so in TestNG:

@Test(en         


        
7条回答
  •  北荒
    北荒 (楼主)
    2020-12-05 07:55

    A Third option also can be Assumption Assumptions for TestNG - When a assumption fails, TestNG will be instructed to ignore the test case and will thus not execute it.

    • Using the @Assumption annotation
    • Using AssumptionListener Using the Assumes.assumeThat(...) method

    You can use this example: example

提交回复
热议问题