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
特征文件是
[

基础教程推荐
- 首次使用 Hadoop,MapReduce Job 不运行 Reduce Phase 2022-01-01
- 如何强制对超级方法进行多态调用? 2022-01-01
- Spring Boot Freemarker从2.2.0升级失败 2022-01-01
- 在螺旋中写一个字符串 2022-01-01
- 如何对 HashSet 进行排序? 2022-01-01
- 如何使用 Stream 在集合中拆分奇数和偶数以及两者的总和 2022-01-01
- 由于对所需库 rt.jar 的限制,对类的访问限制? 2022-01-01
- 如何在不安装整个 WTP 包的情况下将 Tomcat 8 添加到 Eclipse Kepler 2022-01-01
- Java 中保存最后 N 个元素的大小受限队列 2022-01-01
- 如何使用 Eclipse 检查调试符号状态? 2022-01-01