cucumber - Citrus cucumber 不提供睡眠的默认实现
问题描述
我正在使用 citrus 框架(2.7.6,也使用 2.8.0-SNAPSHOT 测试)来端到端测试应用程序。在创建测试时,我注意到文档具有默认的睡眠和回声方法,如 33.9 和 33.10 的文档中所述(https://citrusframework.org/citrus/reference/2.7.5/html/index.html#sleep-steps)。但是,以下功能文件抱怨未提供实现:
Feature: Test
Scenario: Sleep test
Given echo "hi"
Then sleep 50 ms
结果是:
You can implement missing steps with the snippets below:
@Then("sleep {int} ms")
public void sleep_ms(Integer int1) {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
@Given("echo {string}")
public void echo(String string) {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
我应该在哪里寻找解决方案的任何提示?
我编写的步骤运行良好,只是似乎缺少默认值。
解决方案
听起来您没有将默认的 Citrus 步骤实现包作为胶水添加到您的 @CucumberOptions 注释中。您需要将以下内容添加到您的测试类中:
@CucumberOptions(glue = { "com.consol.citrus.cucumber.step.runner.core" })
这个包包含“echo”和“sleep”的默认步骤实现。
推荐阅读
- django - 为非 dockerized django 网站设置 CD 的最佳或推荐方式?
- laravel - 从控制器传递值以查看未定义的变量错误
- c# - 向 ItemsControl 添加缩放功能?
- firebase - 在颤振上使用firebase进行电话身份验证不起作用
- wolfram-mathematica - 在 Mathematica 中,当 n 被描述为区间时,如何找到 n 的最小正整数值
- python - 如何在 Django 中将 .format() 与 url 一起使用?
- google-apps-script - Google Apps 脚本 indexOf
- php - 显示网站中的 Apacheserver 配置错误?
- python-3.x - 用于遗传算法的 TensorFlow (2.x) 模型
- java - NodeUtil 解包方法