目的是使用場景中提到的示例,以便在功能檔案中的背景給定陳述句中使用。
以下是供參考的功能檔案
Feature: As a user with a valid credentials i should view awards and select products for cart
Background:
Given an authenticated logged in user with valid <username> and <password>
@smoke
Scenario: Bot should display awards
When the user is checks for award section
Then User is presented with awards earned
Examples:
| username | password |
| username | password |
@smoke
Scenario: bot should select the proper product
When the user chooses product to buy
Then User is presented with cart with selected product.
Examples:
| username | password |
| username | password |
uj5u.com熱心網友回復:
Afaik 您不能在后臺使用示例中的變數。在您的示例中,如果您需要不同的登錄名,則需要在實際場景中執行該步驟。
uj5u.com熱心網友回復:
Cucumber 不支持背景中的場景大綱。您需要在場景中定義它,這意味著如果您想要用戶場景大綱,您不能在后臺使用該步驟。這是黃瓜團隊關于此功能的更新,請在此處輸入鏈接描述: https ://github.com/cucumber/common/issues/469
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/447576.html
下一篇:在testcafe中訪問環境變數
