is there a way to tell a Test with annotations or something like that, to load properties based on a custom annotation and run the tests equally to the number of parameters that test has.
For example: I want to run test A that has values injected with Spring @value , three times, and for run 1 I want the test to get the values from property file X for run 2 from property file Y and you got it, run 3 from property file Z.
@Value("${person.name}")
private String person.name;
@RunTestWithProperties(properties = {X,Y,Z})
@Test
public void testA() {(System.out.println(person.name); }
On the first run, this test would print the person.name from X properties file, on the second run the test would print the person.name from Y and so on.
What would be expected:
testA runs 3 times(each run with different properties) from files X, Y and Z;
I could use data providers or something like that, load properties with system variables but it is not the solution I want.
Technologies I use are Java, TestNG and Spring. Any solution is more than welcomed.
Thank you in advance guys!