Gherkin 格式以涵盖可重复的场景
Gherkin format to cover repeatable scenarios
我在功能文件中有以下 Gherkin 行
Feature: Vessel - x memo
Background:
Given that logged in user is on home page
@debug
Scenario Outline: Verify something for all links in a table
When clicking on the 'x' link
Then a new pop up should be displayed with 'x' name as title
And a pop body should contain the data for 'x'
棘手的部分是,我必须通过一次又一次地执行上述步骤来验证 page/table 中所有 'n' 个链接(动态)。但不确定,我怎么能想出一个涵盖相同内容的小黄瓜格式。任何帮助将不胜感激?
使用这种方法,您可以对多个输入和输出使用相同的步骤。
Scenario Outline: Verify something for all links in a table
When clicking on the "<link>"
Then a new pop up should be displayed with "<link>" name as title
And a pop body should contain the data for "<link>"
Examples:
| link |
|firstlink |
|secondlink|
|thirdlink |
When('clicking on the {string}', async (link: string) => {
//step def
});
我在功能文件中有以下 Gherkin 行
Feature: Vessel - x memo
Background:
Given that logged in user is on home page
@debug
Scenario Outline: Verify something for all links in a table
When clicking on the 'x' link
Then a new pop up should be displayed with 'x' name as title
And a pop body should contain the data for 'x'
棘手的部分是,我必须通过一次又一次地执行上述步骤来验证 page/table 中所有 'n' 个链接(动态)。但不确定,我怎么能想出一个涵盖相同内容的小黄瓜格式。任何帮助将不胜感激?
使用这种方法,您可以对多个输入和输出使用相同的步骤。
Scenario Outline: Verify something for all links in a table
When clicking on the "<link>"
Then a new pop up should be displayed with "<link>" name as title
And a pop body should contain the data for "<link>"
Examples:
| link |
|firstlink |
|secondlink|
|thirdlink |
When('clicking on the {string}', async (link: string) => {
//step def
});