This plug-in can be used for any of the following purpose:
- Use cucumber steps with QAF
- Use cucumber runner and all QAF BDD2 features
Add dependency in your project.
<!-- https://mvnrepository.com/artifact/com.qmetry/qaf-cucumber -->
<dependency org="com.qmetry" name="qaf-cucumber" rev="version"/>
<!-- https://mvnrepository.com/artifact/com.qmetry/qaf-cucumber -->
<dependency>
<groupId>com.qmetry</groupId>
<artifactId>qaf-cucumber</artifactId>
<version>version</version>
</dependency>
This plug-in will work with cucumber 5+.
BDD2
is super set of Gherkin
syntax. Following are additional features in BDD2
in addition to Gherkin
:
- Custom Meta-Data
- Parameter support in step argument
- Examples from external source (
CSV
,XML
,JSON
,EXCEL
,DB
) with filter options
When you are using QAF BDD runner you can use Cucumber 5 steps with QAF BDD or BDD2 or Gherkin.
- Native TestNG implemenatation (All features of testNG)
- Multiple syntax support (QAF BDD, BDD2, Gherkin)
- Step Meta-data support
- Step retry support
- Supports step defined in BDD (non Java steps)
- Verification (also known as soft-assert) support
- Detailed live reporting
- TestNG Execution configuration
Belwo is basic TestNG configuration:
<suite name="QAF Demo" parallel="methods" verbose="0">
<test name="QAF-BDD-Test">
<parameter name="step.provider.pkg" value="pkg.to.look.for.steps" />
<parameter name="scenario.file.loc" value="resources/features" />
<classes>
<class name="com.qmetry.qaf.automation.step.client.text.BDDTestFactory2" />
</classes>
</test>
</suite>
Refer documentation for more details.
When you want to use cucumber or cucumber runner you can get support of BDD2
and QAF detailed reporting.
Following are additional features when used Cucumber with QAF:
BDD2
Support- Example from external file.
- Verification support
- Resource Management
- QAF detailed reporting
- Integration with third party tools
- QAF backend (like cucumber-java and cucumber-java8 backend)
- Inbuilt Web/MObile/Web-service functional test automation support
Required to add cucumber plugin com.qmetry.qaf.automation.cucumber.QAFCucumberPlugin
to get above features with cucumber. Below is example with Junit
@RunWith(Cucumber.class)
@CucumberOptions(plugin = {"com.qmetry.qaf.automation.cucumber.QAFCucumberPlugin"}, <other options>)//
public class RunCucumberTest {
}
If you don't have qaf dashboard in your project, add it from here for detailed report generated by QAFCucumberPlugin.
Refer QAF documentation to learn more about QAF.