You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be very nice to have a feature, that will allow us to combine multiple data providers into single DP. The result of such combination could be a cartesian product or concatenation, depending on options specified.
Simple example
Lets say we have two dataProviders first and second. We are already using these two somewhere in our tests and we need the third one, which is going to be cartesian product of these two.
@Test(dataProvider = "combination")
public void combinedDpTest(int firstDpArgument, int secondDpArgument) {
//test method body
}
@CombinedDataProvider(mode = CARTESIAN_PRODUCT)
public String[] combination() {
return new String[]{"first", "second"};
}
@DataProvider
public Object[][] first() {
return new Object[][]{
{1},
{2},
{3}
};
}
@DataProvider
public Object[][] second() {
return new Object[][]{
{4},
{5},
{6}
};
}
The text was updated successfully, but these errors were encountered:
This has come up a few times and I've never really been convinced it's worth adding such an implementation to TestNG when there are so many ways data providers can be combined.
This has come up a few times and I've never really been convinced it's worth adding such an implementation to TestNG when there are so many ways data providers can be combined and it's pretty trivial to write your own.
Yeah, i'm aware of the fact that these combinations are easy to implement on your own, but it would be handy to have such thing "out of the box" anyway imo.
Combining data providers
It would be very nice to have a feature, that will allow us to combine multiple data providers into single DP. The result of such combination could be a cartesian product or concatenation, depending on options specified.
Simple example
Lets say we have two dataProviders first and second. We are already using these two somewhere in our tests and we need the third one, which is going to be cartesian product of these two.
The text was updated successfully, but these errors were encountered: