I am using QAF for my automation project. I have project specific meta-data which has group SMOKE, regression, P1 and author with x,y,z name.
SCENARIO: SampleTest
META-DATA: {"description":"Sample Test Scenario","groups":["SMOKE"],"author":["x"]}
#TODO: call test steps
END
I want to run only "smoke" group and author with "x" or "y". Is there any solution for these?
For example,
public class TestSelenium {
@Test(groups= "SMOKE")
public void runSelenium() {
System.out.println("runSelenium()");
}
@Test(groups= "Regression")
public void runSelenium1() {
System.out.println("runSelenium()1");
}
}
Now if you want to execute only "SMOKE" group, do like this way.
<suite name="TestAll">
<!-- Run test method on group "selenium" only -->
<test name="selenium">
<groups>
<run>
<include name="SMOKE" />
</run>
</groups>
<classes>
<class name="com.TestSelenium" />
</classes>
</test>
</suite>
For more details, inclusion/exclusion refer this. http://testng.org/doc/documentation-main.html#exclusions.
You can use include
or exclude
properties refer documentation here.
For example:
include= {'author': ['x']}
to run all scenario with author value x. you can provide this properties in any property file or as system property or in run configuration xml file refer different ways of providing prop.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With