1

I use cucumber testNG for my project and and already added some configuration based on Configuring BDD for execution and QAF Cucumber but when i run it, GherkinScenarioFactory not run any test.

[main] ERROR com.qmetry.qaf.automation.util.PropertyUtil - resources\application.properties (The system cannot find the path specified)
[main] INFO com.qmetry.qaf.automation.core.ConfigurationManager - ISFW build info: {qaf-Type=core, qaf-Revision=15, qaf-Version=2.1, qaf-Build-Time=20-N
ov-2019 22:28:06}
[main] ERROR com.qmetry.qaf.automation.core.ConfigurationManager - D:\Automation\resources not exist!
include groups []
 exclude groups: [] Scanarios location: resources/features
[main] INFO com.qmetry.qaf.automation.step.client.gherkin.GherkinScenarioFactory - scenario.file.loc[Ljava.lang.String;@400cff1a
[main] INFO com.qmetry.qaf.automation.step.client.gherkin.GherkinScenarioFactory - total test found: 0

I've added the dependency qaf and also qaf-cucumber with version 2.1.15. I've also added the @QAFTestStepProvider annotation in the step file. Here's my testng.xml file :

<suite name="MyTest">
<test name="ComparationTest" >
    <parameter name="step.provider.pkg" value="com.example.steps" />
    <parameter name="scenario.file.loc" value="resources/features" />
    <classes>
        <class name="com.qmetry.qaf.automation.step.client.gherkin.GherkinScenarioFactory" />
    </classes>
</test>

in the feature file I added : Examples: {'datafile': 'resources/data/data.xls'} and last in cucumber runner I added plugin "com.qmetry.qaf.automation.cucumber.QAFCucumberPlugin"

I'm still learing, can somebody tell me what did i miss?

ryu yuuto
  • 11
  • 1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jan 09 '22 at 02:18

1 Answers1

0

It looks that you are pointing to wrong location for resources and feature file/directory. You need to provide relative path to project root directory for resources and scenarios directory. If you observe the log also complains that fie/folder not exist.

[main] ERROR com.qmetry.qaf.automation.util.PropertyUtil - resources\application.properties (The system cannot find the path specified)
[main] INFO com.qmetry.qaf.automation.core.ConfigurationManager - ISFW build info: {qaf-Type=core, qaf-Revision=15, qaf-Version=2.1, qaf-Build-Time=20-N
ov-2019 22:28:06}
[main] ERROR com.qmetry.qaf.automation.core.ConfigurationManager - D:\Automation\resources not exist!

Make sure that you have resources directory under project root.

Regarding feature files, according to your current configuration scenario.file.loc is resources/features. In that case make sure that <project-root>/resources/features is exist. For example your project root is D:/Automation then resources/features points to D:/Automation//resources/features If not then provide correct relative path to project root.

For example resources/features expects <project-root>/resources/features if it is not there provide correct location.

Same is applied for other resources including properties file and test data files.

For application.properties it is expected under <project_root>\resources\application.properties if it is not there you can provide location by using system property application.properties=<relateive_path_to_project> or alternately place under default location <project_root>\resources.

As a side note,

  • instead of GherkinScenarioFactory recommended is BDD2 factory com.qmetry.qaf.automation.step.client.text.BDDTestFactory2
  • Latest version of qaf as of today is 3.1.0-RC1 the version you are using 2.1.15 is quite old.
user861594
  • 5,733
  • 3
  • 29
  • 45