如何在不對 Cucumber 中使用 Examples 的情況下執行單個數據引數化?


透過直接在要素檔案中傳遞值,可以在不使用 Cucumber 中的 Examples 的情況下執行單個數據引數化。

示例

要素檔案。

Feature: Tutorialpoint Job page
Scenario: Tutorialpoint job page look and fee
Given Launch site https://tutorialspoint.tw/about/about_careers.htm
Then Verify the tabs on the page

URL 直接在要素檔案中的 Given 語句中傳遞。

步驟定義檔案應包含 Given 語句的對映。

示例

@Given (“^Launch site \"([^\"]*)\"$”)
public void launchJobsite(String url){
   System.out.println("url is : " + url);
}
@Then (“^Verify the tabs on the page"$”)
public void tabverification(){
   System.out.println("Tabs verified successfully);
}

@Given (“^啟動站點 \"([^\"]*)\"$”)在執行時傳遞 UR。

更新於: 2020 年 6 月 11 日

305 次瀏覽

開啟你的 職業生涯

透過完成課程獲得認證

開始
廣告