黃瓜中的 Selenium 幹執行是什麼?
黃瓜幹執行用於 Step Definition 和 Feature 檔案的編譯以及驗證編譯錯誤。dry run 的值可以為 true 或 false。dry run 的預設值為 false,它是 Test Runner 類檔案的一部分。
如果 dry run 的值設定為 true,黃瓜將驗證 Feature 檔案中的各個步驟以及 Step Definition 檔案中 Feature 檔案中的步驟實現程式碼。
如果 Feature 檔案中的任何步驟未在 Step Definition 檔案中實現,將丟擲一個訊息。dry run 引數是用於配置測試設定的 @CucumberOptions 的一部分。
示例
Test Runner 類檔案實現
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(
features = "Feature"
,glue={"stepDefinition"}
,strict = true
,dryRun = true
)
public class TestRunner {
}
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP