本文介绍了如何使用Qaf Bdd编辑器在Eclipse中运行单个方案?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 bdd实现"https://qmetry.github.io/qaf/" rel ="nofollow noreferrer"> qaf 用于测试自动化并使用 qaf-bdd-editors 用于开发的eclipse插件.我可以使用 xml配置文件运行我的方案,但是可以运行特定的单个场景需要每次修改确认文件.有没有更简单的方法可以在编辑器中运行选定的方案而无需修改配置文件?

I am using bdd implementation provided by qaf for test automation and using qaf-bdd-editors eclipse plugin for development. I am able to run my scenarios using xml configuration file but to run specific single scenario need to modify confirmation file each time. Is there any easier way to run selected scenario in editor without modifying configuration file?

推荐答案

您可以通过以下技巧来实现:

You can achieve it by doing below trick:

  1. 创建通用配置文件.假设 config/selectionrun_config.xml
<suite name="QAF Demo">
    <test name="BDD Test">
        <method-selectors>
            <method-selector>
                <script language="beanshell"><![CDATA[
       System.getProperty("selection","").length()==0 || testngMethod.getMethodName().equalsIgnoreCase(System.getProperty("selection","").trim())
       ]]></script>
            </method-selector>
        </method-selectors>
        <classes>
            <class
                name="com.qmetry.qaf.automation.step.client.text.BDDTestFactory" />
            <class
                name="com.qmetry.qaf.automation.step.client.text.BDDTestFactory2" />
        </classes>
    </test>
</suite>
  1. 创建 TestNG配置,说"RUN_SELECTED_SCENARIO"
  1. Create TestNG configuration let say "RUN_SELECTED_SCENARIO"
  1. 提供配置名称: RUN_SELECTED_SCENARIO
  2. 设置套件: config/selectionrun_config.xml
  3. 选择参数选项卡,然后设置虚拟机参数

     -Dscenario.file.loc="${selected_resource_loc}" -Dselection="${selected_text}"
  1. 现在可以在编辑器中运行任何单个方案(bdd或gherkin)打开文件并选择方案名称(在编辑器中选择常规文本),右键单击->运行方式->运行配置->" RUN_SELECTED_SCENARIO.如果要在文件中运行所有方案,请不要选择方案名称并运行.
  1. Now to run any single scenario (bdd or gherkin) open file in editor and select scenario name (normal text selection in editor), right-click -> run As -> Run Configuration -> "RUN_SELECTED_SCENARIO". If you want to run all scenarios in file, don't select scenario name and run.

您还可以在编辑器中选择方案,并直接由顶部的运行按钮直接运行导航.

You also can select scenario in editor and directly run by Run button in top navigation.

这篇关于如何使用Qaf Bdd编辑器在Eclipse中运行单个方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 01:38