【发布时间】:2015-08-27 06:25:03
【问题描述】:
目前我正在使用 Cucumber 开发一个简单的程序,该程序将测试用户在网站上的登录。
这是我的 TestRunner 文件:
package cucumberTest;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(features = "Feature")
public class TestRunner {
}
我也有黄瓜文件作为 LogIn_Test.feature 如下:
功能:登录操作
Scenario: Successful Login with Valid Credentials
Given User is on Home Page
When User Navigate to LogIn Page
And User enters UserName and Password
Then Message displayed Login Successfully
Scenario: Successful LogOut
When User LogOut from the Application
Then Message displayed LogOut Successfully
但每当我尝试将 TestRunner 类作为 JUnit 测试运行时,我都会收到错误消息:
在所选项目中找不到测试类。
【问题讨论】:
标签: java junit automation cucumber gherkin