Passing output of one test method to another method testng

后端 未结 3 1741
别跟我提以往
别跟我提以往 2020-12-06 18:55

I have to write the following unit test cases in testng:

  1. saveProductTest which would return productId if product details are saved successfully in DB.

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-06 19:07

    Each unit test should be independent of other tests so you more easily can see what fails. You can have a helper method saving the product and returning the id and call this from both tests.

提交回复
热议问题