Saturday, April 2, 2016

Groups in TestNG


import org.testng.annotations.Test;

public class GroupExamples {

@Test(groups="Regression")
public void testCaseOne(){
System.out.println("Im in testCaseOne - And in Regression Group");
}

@Test(groups="Regression")
public void testCaseTwo(){
System.out.println("Im in testCaseTwo - And in Regression Group");
}

@Test(groups="Smoke")
public void testCaseThree(){
System.out.println("Im in testCaseThree - And in Smoke Test Group");
}

@Test(groups="Smoke")
public void testCaseFour(){
System.out.println("Im in testCaseFour - And in Regression Group");
}

}
 

xml version="1.0" encoding="UTF-8"?>
<suite name="Regression Suite">
        <test name="testing">
            <groups>
                  <run>
                     <include
name="Regression" />
                  </run>
           </groups>
           <classes>
                         <class name="com.example.group.groupExamples" />
          </classes>
     </test>
</suite>

No comments:

Post a Comment