Jak*_*las 19
从官方指南:
复制和粘贴方案以使用不同的值可能很快变得乏味和重复:
Run Code Online (Sandbox Code Playgroud)Scenario: Eat 5 out of 12 Given there are 12 cucumbers When I eat 5 cucumbers Then I should have 7 cucumbers Scenario: Eat 5 out of 20 Given there are 20 cucumbers When I eat 5 cucumbers Then I should have 15 cucumbers场景大纲允许我们通过使用带占位符的模板来更简洁地表达这些示例
Run Code Online (Sandbox Code Playgroud)Scenario Outline: Eating Given there are <start> cucumbers When I eat <eat> cucumbers Then I should have <left> cucumbers Examples: | start | eat | left | | 12 | 5 | 7 | | 20 | 5 | 15 |Scenario Outline步骤提供了一个永远不会直接运行的模板.对于其下方的"示例"部分中的每一行,都会运行一次"场景大纲"(第一个标题行除外).
更多在写作功能指南.