I have following testng test methods.
@Test(groups = {"tsg1.0","smoke"})
public void testLoginWithInvalidCredentials(String usernameValue, String passwordValue){
/*Print something*/
}
@Test(groups = {"tsg1.0"})
public void testLoginWithUserIdOnly(String username) {
/*Print something*/
}
@Test(groups = {"tsg1.0"})
public void testLoginWithPasswordOnly(String password) {
/*Print something*/
}
Here is the testng xml used to test the above methods.
<suite name="Suite" thread-count="1" verbose="10">
<test name="Test">
<groups>
<run>
<include name="tsg1.0"/>
</run>
</groups>
<packages>
<package name="<test package name>"/>
</packages>
</test>
</suite>
Is there a way where in I can create one xml which will include tests with Groups "TSG1.0" AND "SMOKE". I want only the first test(testLoginWithInvalidCredentials) to be run in this case.
Please help.
Thanks, Mike.
PS: The following won't work as It will include tsg1.0 or smoke. I want an and condition here...
<run>
<include name="tsg1.0"/>
<include name="smoke"/>
</run>