1

我正在尝试在 Quantum 框架中运行 BDD 场景。执行时,使用 But 关键字的步骤失败,并出现错误“步骤尚未实现”。

Auto-generated code snippet by QMetry Automation Framework.
TODO: remove NotYetImplementedException and call test steps
    throw new NotYetImplementedException();

我没有看到任何其他 BDD 关键字的问题。只有以“But”关键字开头的步骤会失败,但出现上述异常。有什么我想念的吗?

请找到我们正在使用的场景

Scenario: Validate help me log in link
Given user have the "XXX" app in mobile
But user open the app by the name "XXX"

步骤实现:

import cucumber.api.java.en.But;
...
    @But("^user open the app by the name \"([^\"]*)\"$")
    public void user_open_the_app_by_the_name(String arg1) throws Throwable {
        try {
            AppiumUtils.stopApp(arg1);
        } catch (Exception e) {
        } 
    }
4

1 回答 1

1

QAF 使用以下 BDD 关键字:

  • 给定
  • 什么时候
  • 然后
  • 使用

由于But不是内置关键字,它可能会给您带来错误。这并不意味着您不能使用Butas 关键字!有一个功能可以通过定义同义词来支持任何自定义关键字。

您可以尝试在application.properties文件中添加以下属性:

And=But;And

这将允许您But用作关键字,并且应该可以解决您的问题。

于 2019-08-27T23:53:17.243 回答