given following structure in two Java classes:
public class UserRegistrationTest {
@Test(groups = { "userRegistration" })
public void registerUserSuccess(ITestContext context) {
...
context.setAttribute("user", user);
}
}
public class UserLoginTest {
@Test(dependsOnGroups = { "userRegistration" })
public void userLoginSuccess(ITestContext context) {
User user = (User) context.getAttribute("user");
...
}
}
When from Intellij Idea I try to run only one test "UserLoginTest" - then test is ignored with the exception:
DependencyMap::Method "UserLoginTest.userLoginSuccess(org.testng.ITestContext)[pri:0, instance:...tests.UserLoginTest@25618e91]" depends on nonexistent group "userRegistration"
Problem is:
Test developer should be able to run only one test without running all the suite, for test development or test debug purposes. How to make that dependent test run?