【问题标题】:How to apply filters while running BDD scenarios using QAF BDD2 framework?如何在使用 QAF BDD2 框架运行 BDD 场景时应用过滤器?
【发布时间】:2019-12-14 05:35:21
【问题描述】:

我们的功能文件包含仅适用于移动设备和桌面设备的场景。我只想在回归中运行移动场景。我应该如何添加这个过滤器,以便它只选择使用 QAF BDD2 的移动场景?

Ex: Feature Hello
@channel['desktop','mobile']
Scenario: This is applicable for desktop and mobile
Given ..
When ..
Then ..

@channel['desktop']
Scenario: This is applicable for desktop only
Given ..
When ..
Then ..

@channel['mobile']
Scenario: This is applicable for mobile only
Given ..
When ..
Then ..

当我尝试运行它时,它会运行并跳过桌面场景。我应该如何添加过滤器来运行移动场景并避免跳过桌面场景?我尝试在配置 xml 中添加以下代码不起作用

<parameter name="include" value="{'channel': ['mobile']}" />

并添加了

<method-selectors>
    <method-selector>
        <selector-class name="com.qmetry.qaf.automation.testng.pro.QAFMethodSelector" />
    </method-selector>
</method-selectors>

也在 xml 中。过滤器不工作。请在这里帮助我。

【问题讨论】:

    标签: bdd qaf


    【解决方案1】:

    您缺少 : 来分隔元键值对。例如:

    @channel:['桌面','移动']

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多