Cucumber 在大纲示例中是否可以使用表数据?
这是可能的:Cucumber 在大纲示例中是否可以使用表数据?,cucumber,gherkin,Cucumber,Gherkin,这是可能的: Scenario Outline: Add two numbers Given I have entered <num1> and <num2> into the calculator When I press add Then the result should be <result> on the screen Examples: | num1 | num2 | result | | 50 | 70 | 120 | | 10
Scenario Outline: Add two numbers
Given I have entered <num1> and <num2> into the calculator
When I press add
Then the result should be <result> on the screen
Examples:
| num1 | num2 | result |
| 50 | 70 | 120 |
| 10 | 20 | 30 |
我的问题是:
是否可以在大纲示例中使用表格?与以下场景类似:
Scenario Outline: Add two numbers
Given I have entered <num1> and <num2> into the calculator
When I press add
Then the result should be <result> on the screen
| a | b | c |
| 50 | 70 | 120 |
| 10 | 20 | 30 |
Examples:
| num1 | num2 | result |
| a | b | c |
是的,这是可能的。比如说
Scenario Outline: filing data
Given I am on the home page
And I <action>
And "<field>" field loses focus
Then I should see "<error>"
Examples:
| action | field | error |
| fill in "Email" with "test.test.com" | email | Email is not valid |