import org.testng.annotations.Test;
public class Grp {
@Test(groups={"smoke"},priority=4)
public void a()
{
System.out.println("a method");
}
@Test(groups={"smoke"},priority=5)
public void b()
{
System.out.println("b method");
}
@Test(groups={"regression"},priority=2)
public void c()
{
System.out.println("c method");
}
@Test(groups={"smoke","sanity"},priority=3)
public void d()
{
System.out.println("d method");
}
@Test(groups={"smoke"},priority=1,dependsOnMethods={"b","d"})
public void e()
{
System.out.println("e method");
}
}
package GroupsPriorityDependsOnMethods;
import org.testng.annotations.Test;
public class Grp1 {
@Test(groups={"sanity"})
public void a1()
{
System.out.println("a1 method");
}
@Test(groups={"smoke","sanity"})
public void b1()
{
System.out.println("b1 method");
}
@Test(groups={"regression,smoke"})
public void c1()
{
System.out.println("c1 method");
}
@Test(groups={"smoke"})
public void d1()
{
System.out.println("d1 method");
}
@Test(groups={"sanity"})
public void e1()
{
System.out.println("e1 method");
}
}
package GroupsPriorityDependsOnMethods;
import org.testng.annotations.Test;
public class Grp2 {
@Test(groups={"sanity"})
public void a2()
{
System.out.println("a2 method");
}
@Test(groups={"regression"})
public void b2()
{
System.out.println("b2 method");
}
@Test(groups={"smoke"})
public void c2()
{
System.out.println("c2 method");
}
@Test(groups={"regerssion"})
public void d2()
{
System.out.println("d2 method");
}
@Test(groups={"sanity","smoke"})
public void e2()
{
System.out.println("e2 method");
}
}
<suite name="Suite1" verbose="1" >
<test name="build1" >
<classes>
<class name="GroupsPriorityDependsOnMethods.Grp" />
<class name="GroupsPriorityDependsOnMethods.Grp1" />
<class name="GroupsPriorityDependsOnMethods.Grp2" />
</classes>
<groups>
<run>
<include name="sanity"/>
<include name="smoke"/>
<exclude name="regression" />
</run>
</groups>
</test>
</suite>
No comments:
Post a Comment