1

这篇文章是对Is it possible to migrate from cucumber-jvm to QAF的补充查询吗?你能帮我知道执行为 testNG 的方法吗?现在我已经从下面的链接配置了示例

https://github.com/qmetry/qaf/releases/download/2.1.9-RC2/QAFGherkin.zip

但是当我尝试执行 CucumberRunner.java 它没有找到任何功能

log4j:WARN No such property [follow] in org.apache.log4j.FileAppender.
[ConfigurationManager] - ISFW build info: {qaf-Type=core, qaf-Revision=9-RC1, qaf-Version=2.1, qaf-Build-Time=23-Sep-2016 12:16:17}
[ConfigurationManager] - Resource dir: C:\Users\Kalyankar\Downloads\qaf-blank-project-maven-masterDec\qaf-blank-project-maven-master\resources. Found property files to load: 6
[ConfigurationManager] - Resource dir: C:\Users\Kalyankar\Downloads\qaf-blank-project-maven-masterDec\qaf-blank-project-maven-master\resources. Found property files to load: 0
[TestNG] Running:
  C:\Users\Kalyankar\AppData\Local\Temp\testng-eclipse-1055468291\testng-customsuite.xml

No features found at [classpath:com/qmetry/qaf/examples/cucumber/runners]

0 Scenarios
0 Steps
0m0.000s

PASSED: run_cukes
        Runs Cucumber Features

===============================================
    Default test
    Tests run: 1, Failures: 0, Skips: 0
===============================================


===============================================
Default suite
Total tests run: 1, Failures: 0, Skips: 0
===============================================

[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@6e1567f1: 18 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@72d818d1: 18 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 30 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter@31a5c39e: 35 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@59ec2012: 224 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@42dafa95: 131 ms

我已经确保 application.properties 值也设置为step.provider.pkg=com.qmetry.qaf.examples.steps.cucumber后来,我移动了一个功能文件来com.qmetry.qaf.examples.cucumber.runners打包并执行它。没运气。任何帮助将非常感激。

提前致谢

4

1 回答 1

1

请参考迁移步骤。请您在迁移后分享您的项目结构和您正在使用的配置文件吗?使用 QAF 最新版本,不要使用 cucumber runner 运行,而是使用 QAF 运行。以下是示例配置文件:

<test name="Gherkin-QAF-Test">
   <parameter name="step.provider.pkg" value="your.steps.pkg" />
   <parameter name="scenario.file.loc" value="your features file relative path" />
   <classes>
      <class name="com.qmetry.qaf.automation.step.client.gherkin.GherkinScenarioFactory" />
   </classes>
</test>

您可以作为 TestNG 测试运行。

.bdd或文件的默认目录.feature是 <project_home>/scenarios 目录。如果它不在 /scenarios 下,则需要使用scenario.file.loc.

于 2017-12-13T16:13:49.290 回答