Test parameters in TestListener

(Nikita Skvortsov) #1

How can I access test parameters in TestListener (which is attached via init script)? This is needed for tests that use TestNG’s DataProvider

(Peter Niederwieser) #2

If you need access to test parameters, you’ll have to do it on the test (JVM) side. For example, you can register a TestNG listener with ‘test.useTestNG { listeners << “my.org.testng.ITestListener” }’.

(Nikita Skvortsov) #3

Any chances this information is added to TestDescriptor passed to TestListener? Having to attach some test-ng-specific listeners is not a good solution for Gradle-TeamCity integration :slight_smile:

(Peter Niederwieser) #4

Do you need the original values, or some String representation? If you need the values, we’d have to serialize them and send them over to the Gradle JVM, which could cause problems.

(Nikita Skvortsov) #5

At current state, string representation would be sufficient. It will give CI server users a good hint and will allow TeamCity to distinguish tests failures with different parameters.