我正在處理我的第一個功能文件/硒項目。黃瓜測試沒有運行
我創建了一個功能文件和跑步者類。
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