Skip to content

qmetry/qaf-cucumber

Repository files navigation

License Maven Central javadoc

qaf-cucumber

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

How to use

Add dependency in your project.

IVY

<!-- https://mvnrepository.com/artifact/com.qmetry/qaf-cucumber -->
<dependency org="com.qmetry" name="qaf-cucumber" rev="version"/>

Maven

<!-- 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+.

Why BDD2 syntax

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

Using qaf-cucumber with QAF BDD runner

When you are using QAF BDD runner you can use Cucumber 5 steps with QAF BDD or BDD2 or Gherkin.

Why QAF BDD runner
  • 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.

Using qaf-cucumber with Cucumber runner

When you want to use cucumber or cucumber runner you can get support of BDD2 and QAF detailed reporting.

QAF Over Cucumber

Following are additional features when used Cucumber with QAF:

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.