我想重用一些常见的步骤。例如
Scenario: Navigate to Page 2 and perform first set of validations
Given A user<username> is logged in
When user clicks on <menuItem>
and page <page_name> is displayed
and user clicks on Submit button
Then Page <second_page> is displayed
And validate <condition_1>
Scenario: Navigate to Page 2 and perform second set of validations
Given A user<username> is logged in
When user clicks on <menuItem>
and page <page_name> is displayed
and user clicks on Submit button
Then Page <second_page> is displayed
And validate <condition_2>
Examples:
|username|page_name|menuItem|condition_1|condition_2|
|username1|Page1|Menu1|Condition1|Condition2|
现在,由于给定的条件相同,我想将故事规范化为这样的东西。
在 precondition1.story
Given A user<username> is logged in
When user clicks on <menuItem>
and page <page_name> is displayed
and user clicks on Submit button
Then Page <second_page> is displayed
在 currentTestStory.story
GivenStories: precondition1.story
Scenario: Navigate to Page 2 and perform first set of validations
Given Page <second_page> is displayed
And validate <condition_1>
Scenario: Navigate to Page 2 and perform second set of validations
Given Page <second_page> is displayed
And validate <condition_2>
Examples:
|username|page_name|menuItem|condition_1|condition_2|
|username1|Page1|Menu1|Condition1|Condition2|
但我面临的挑战是,我无法从当前故事中参数化 GiveStory。有没有办法实现我想要做的事情?