我正在处理我的第一个功能文件/硒项目。黄瓜测试没有运行
我创建了一个功能文件和跑步者类。
package cucumberpkg2;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions
(features="Features") \t
public class Runner {
}
Feature: Login screen
Scenario Outline: Successful login
Given User is on Login page
When User enters valid UserName and Password
And Clicks the login button
Then User landed on the home page
但每当我尝试运行的TestRunner类作为JUnit测试,我得到的错误:
测试类没有在选定的项目中找到。
您还需要在@CucumberOptions – kushal
@kushal中为特性文件指定glue作为“glue = {”packagename.classname“}”的步骤定义所在的位置。 'glue'选项不是强制性的,用于测试Cucumber项目绑定。但是当你想测试完整的实现时,'glue'是必须的。谢谢 – DebanjanB
@dev,我知道胶水有时候不是强制性的,但我不明白你的声明:/ – kushal