How to get list of all tests in a package (and ones with data provider multiple times)

85 views Asked by At

We are trying to create custom report about our test execution and for this we'd like to have list of all the tests we have. We tried implementing IMethodInterceptor interface and adding each test into list in intercept method. This worked partly, this way we get list of all the test methods we have into list.

Problem is that it does not give any information about parameters. One test might be run tens of times with different parameters with the help of TestNG's data providers and we'd like to capture each of these executions once. E.g that our list would not have just

testClass1::testMethod1
testClass1::testMethod2

but

testClass1::testMethod1(5)
testClass1::testMethod1(6)
testClass1::testMethod2(4)
testClass1::testMethod2(5)

Is there any way to get this information in TestNG? (Without actually running the tests, as this takes long time and we want to list also the tests that might never have been ran but which would be ran if the package was included into some suite)

0

There are 0 answers