Getting scenario and steps undefined in cucumber with java(使用java在黄瓜中获取未定义的场景和步骤)
问题描述
自 2 天以来,我一直在与此作斗争.我的测试显示通过,但测试没有在 cucumber+java 中运行 Selenium webdriver 测试.在控制台中,我收到以下消息
I have been battling with this since 2 days. My test is shown passed but the test is not running in cucumber+java for Selenium webdriver test. In the console I am getting following message
1 Scenarios (1 undefined)
4 Steps (4 undefined)
0m0.000s
You can implement missing steps with the snippets below:
@Given("^User navigate to shopping page$")
public void user_navigate_to_shopping_page() throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
@When("^user enters data$")
public void user_enters_data() throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
@When("^clicks on search button$")
public void clicks_on_search_button() throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
@Then("^product should be displayed$")
public void product_should_be_displayed() throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
我已经写了以下跑步者课程
I have written following runner class
package stepDefinition;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(
monochrome=true,
features = "src/main/resources/feature",
glue="src/test/java/stepDefinition",
tags={"@tag2"},
dryRun = false)
public class TestRunner {
}
我还会附上项目目录结构的截图
I will also attach the screenshot of directory structure of the project
特征文件是
[

- 未找到/usr/local/lib 中的库 2022-01-01
- Eclipse 的最佳 XML 编辑器 2022-01-01
- GC_FOR_ALLOC 是否更“严重"?在调查内存使用情况时? 2022-01-01
- 将 Java Swing 桌面应用程序国际化的最佳实践是什么? 2022-01-01
- 在 Java 中,如何将 String 转换为 char 或将 char 转换 2022-01-01
- 获取数字的最后一位 2022-01-01
- 如何指定 CORS 的响应标头? 2022-01-01
- 如何使 JFrame 背景和 JPanel 透明且仅显示图像 2022-01-01
- 转换 ldap 日期 2022-01-01
- java.lang.IllegalStateException:Bean 名称“类别"的 BindingResult 和普通目标对象都不能用作请求属性 2022-01-01