[英]Common examples for different scenario outline Gherkin
我想验证 3 台服务器上的数据。 使用以下功能文件,存在场景执行重复。
特征:
作为测试人员,
我想验证数据库中的信息
场景大纲:数据验证服务器 1
鉴于服务器 1 处于活动状态
当我连接到服务器 1
然后服务器 1 在 <table> 中有可用的 <attribute>
Examples:
| attribute | table |
| attr1 | table1 |
| attr2 | table2 |
场景大纲:数据验证服务器 2
鉴于服务器 2 处于活动状态
当我连接到服务器 2
然后服务器 2 在 <table> 中有可用的 <attribute>
Examples:
| attribute | table |
| attr1 | table1 |
| attr2 | table2 |
场景大纲:数据验证服务器 3
鉴于服务器 3 已上线
当我连接到服务器 3
然后服务器 3 在 <table> 中有可用的 <attribute>
Examples:
| attribute | table |
| attr1 | table1 |
| attr2 | table2 |
怎么可能实现?:
场景大纲:数据验证服务器 1
鉴于服务器 1 处于活动状态
当我连接到服务器 1
然后服务器 1 在 <table> 中有可用的 <attribute>
场景大纲:数据验证服务器 2
鉴于服务器 2 处于活动状态
当我连接到服务器 2
然后服务器 2 在 <table> 中有可用的 <attribute>
场景大纲:数据验证服务器 3
鉴于服务器 3 已上线
当我连接到服务器 3
然后服务器 3 在 <table> 中有可用的 <attribute>
Examples:
| attribute | table |
| attr1 | table1 |
| attr2 | table2 |
谢谢。
您可以考虑在示例中传递服务器详细信息,如下所示。 然后在您的步骤 def 中使用服务器连接详细信息(通过示例传递)来检查服务器是否处于活动状态并连接到服务器,然后检查相应的属性和表
Scenario Outline: Data verify servers
Given <Server> is live
When I connect to <Server>
Then server has <attribute> available in <table>
Examples:
Server | attribute | table |
<server1 connection details> | attr1 | table1 |
<server2 connection details> | attr2 | table2 |
<server3 connection details> | attr3 | table3 |
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.