Java – TestNG @ test (invocationcount = 20) to a class with @ test (DataProvider = “somelist”) to a method

I have a TestNG test suite for Java project, where I have one

@Test (DataProvider = "listofobjects") annotated method It provides a method for about 20 rows of data (therefore, the method runs 20 times.) Now, I want to run this class for 2 hours (part of soak related tests.) On average, class takes about 10 minutes to run So I'm thinking about or running the entire class 12 times, so consider using @ test (invocationcount = 20) on the class itself Any good ideas?

Solution

You can extract tests from methods and then create a test method with a fairly high call count In this test method, the time is compared with the variable that saves the timestamp of the first run. If the run exceeds 20 minutes, the test is skipped

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>