首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在给定中拆分示例,然后为SpecFlow场景大纲拆分示例

在给定中拆分示例,然后为SpecFlow场景大纲拆分示例
EN

Stack Overflow用户
提问于 2016-04-19 09:50:34
回答 2查看 859关注 0票数 1

我正在编写一个包含多个输入和输出参数(每个参数约为4-5 )的specflow场景。在使用场景大纲时,我需要编写一个宽表,给出同一行的输入和输出列。有任何方法可以单独指定步骤定义的示例吗?这是为了提高可读性。

电流状态

代码语言:javascript
复制
Given - State of the data
When I trigger action with parameters <input1> and <input2> and ...
Then my output should contain <output1> and <output2> ...

Examples:
| input1 | input2 |... | output1 | output2 |...

我能做这个吗?

代码语言:javascript
复制
Given - State of the data
When I trigger action with parameters <input1> and <input2> and ...
       Examples of input
Then my output should contain <output1> and <output2> ...
        Examples of output
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-04-19 10:30:50

不,不幸的是(或任何类似的)是不可能的。您可以使输入和输出更加抽象,并可能合并几个列。示例:您应该使用带有"EU“、"US、缺失邮政编码”、"HQ“等值的值,而不是Country、PostalCode、City、House、Firstname、Lastname、等。

票数 1
EN

Stack Overflow用户

发布于 2016-04-22 17:35:43

场景大纲不能有多个示例表,但可以为常规方案传递数据表。

数据表只能对使用数据表的步骤访问,但是您可以将其保存在场景上下文中供后续步骤使用。

不确定这是否适用于您,如果您的场景很复杂,并且跨越多行,但我想我要提一提。

代码语言:javascript
复制
Scenario: Checking outputs for inputs
Given - State of the data
When I trigger action with the following parameters  
input1 | input2 | input3 |
data   | data   | data   |

Then my output should contain the following outputs
output1 | output2  | output3 |
data    | data     | data    |
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36714808

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档