I did refer this link and understood about IAnnotationTransformer.
I have a scenario where I have parameterized data with data provider. Need to run test with certain data for N number of times using invocation Count which.
How do I leverage the transform?
@DataProvider(name = "loginData", parallel = false)
fun loginDataProvider(): MutableIterator<String> {
val loginTestData: ArrayList<String> = ["abc", "def", "xyz"]
return loginTestData.iterator()
}
@Test(dataProvider = "loginData")
fun funloginTest(loginDetails: String){
print("The value of $loginDetails")
}
How do I run this test 4 times for the parameter "def"?
Ideally I want to get the invocationCount before every run for the test case from an external source like a json and run the test N number of times for specific data
I tried looking at many invocationCount and IAnnotationTransformer and couldn't find the exact answer. Any idea or code snippet to solve the problem can help here
IAnnotationTransformerdoesn't seems to work in this case. I suggest to modify the behaviour of DataProvider method instead.e.g.
{ "funloginTest" : { "def" : 4 } }loginDataProvider, we can use the test method name(Referring to document of DataProvider) to see which data need to have different invocation count.