在场景大纲中,如果有2个或更多场景,则所有功能步骤都将针对其他2个场景中的两个场景执行。如何绕过黄瓜功能文件中的重复步骤执行?
但我只需要执行一个步骤之一即登录步骤。
例如:
Scenario Outline: Acceptance page has <Application> logo appearing on top
Given I am signing up in <Application> #I want to run this step only once
And I navigate to "Dashboard" page # I want to run this step only once
Then I should see "header logo" exist
And I should see "footer" exist
And I should expect the following elements to be visible
| element |
| Legal |
| Privacy |
| Security |
| Cookies |
Examples:
| Application |
| Gmail |
在上述特征文件,我想登录应用仅一次,并验证的步骤其余部分。
当前对于每个验证步骤,登录事情都会一次又一次地发生。
请建议我如何运行登录步骤一次,并可以检查页面上的多个项目。
难道你不需要运行'鉴于我在每个例子中注册'?这与您的评论所说的只运行一次不兼容。 –
另外,你正在使用哪个Cucumber实现?它不能同时是cucumber-jvm和cucumberjs。 –
我想(或希望)你混淆注册登录。 – kiedysktos