在 BDD 中使用 But 关键字会抛出 Step not implemented 异常,而在 Quantum 框架中 运行 场景
Using But keyword in BDD throws Step not implemented exception while running scenario in Quantum framework
我正在尝试 运行 Quantum 框架中的 BDD 场景。执行时,带有 But 关键字的步骤失败并出现错误 "Step not yet implemented".
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) {
}
}
QAF 使用以下 BDD 关键字:
- 给出
- 何时
- 然后
- 和
- 使用
- 有
- 有
因为 But
不是内置关键字,它可能会给您带来错误。这并不意味着您不能使用 But
作为关键字!有一项功能可以通过定义 synonyms.
来支持任何自定义关键字
您可以尝试在 application.properties
文件中添加以下 属性:
And=But;And
这将允许您使用 But
作为关键字,应该可以解决您的问题。
我正在尝试 运行 Quantum 框架中的 BDD 场景。执行时,带有 But 关键字的步骤失败并出现错误 "Step not yet implemented".
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) {
}
}
QAF 使用以下 BDD 关键字:
- 给出
- 何时
- 然后
- 和
- 使用
- 有
- 有
因为 But
不是内置关键字,它可能会给您带来错误。这并不意味着您不能使用 But
作为关键字!有一项功能可以通过定义 synonyms.
您可以尝试在 application.properties
文件中添加以下 属性:
And=But;And
这将允许您使用 But
作为关键字,应该可以解决您的问题。