I am using QAF framework BDD2 for regression automation. I know how to setup setup() and teardown() webdriver in testNG but I am not sure do we have capability to set up the same QAF BDD2 setup() and teardown(). Kindly help with some examples.
I will provide a usecase which helps to understand exactly I am looking for:
You can take benefit of testng listener and qaf listeners. For example, in above use case, implement testng suite listener and do the needful in before and after suite methods:
public class MySuiteListener implements ISuiteListener{
public void onStart(ISuite suite) {
//create directory
}
public void onFinish(ISuite suite){
//delete directory
}
}
You can register TestNG listener thorough configuration file
<suite name="MYAPP Tests">
<listeners>
<listener class-name="com.example.MySuiteListener" />
</listeners>
<test name="QAF-BDD-Test">
<classes>
<class name="com.qmetry.qaf.automation.step.client.text.BDDTestFactory2" />
</classes>
</test>