Cucumber 柑橘黄瓜不提供睡眠的默认实现
我正在使用citrus框架(2.7.6,也使用2.8.0-SNAPSHOT进行测试)对应用程序进行端到端测试。在创建一个测试时,我注意到文档中有一个默认的sleep和echo方法,如33.9和33.10中的docu所述()。但是,以下功能文件抱怨未提供实现:Cucumber 柑橘黄瓜不提供睡眠的默认实现,cucumber,citrus-framework,Cucumber,Citrus Framework,我正在使用citrus框架(2.7.6,也使用2.8.0-SNAPSHOT进行测试)对应用程序进行端到端测试。在创建一个测试时,我注意到文档中有一个默认的sleep和echo方法,如33.9和33.10中的docu所述()。但是,以下功能文件抱怨未提供实现: Feature: Test Scenario: Sleep test Given echo "hi" Then sleep 50 ms 结果: You can implement missing steps with
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 step实现包作为胶水添加到@CucumberOptions注释中。您需要将以下内容添加到测试类中:
@CucumberOptions(glue = { "com.consol.citrus.cucumber.step.runner.core" })
此软件包包含“echo”和“sleep”的默认步骤实现。供将来参考:默认步骤在33.4中提到