可以从黄瓜的其他功能调用功能吗? [英] Can features be called from other features in Cucumber?

查看:213
本文介绍了可以从黄瓜的其他功能调用功能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个将调用其他要素文件的要素文件。这可能吗?例如,我想要一个高级功能文件,说这样的东西(只有正确的格式):

 调用feature1 
call feature2
call feature3

,每个调用都会转到包含,例如:

 场景概述:
给定此
然后
和更多

因此,使用此示例,您将拥有1个高级功能文件,3个低级功能文件。

解决方案

每个子功能可能都是一个场景大纲。



<

没有可以从另一个功能运行功能的黄瓜功能。您甚至不能从另一个场景调用场景。 (你可以在早期版本的Cucumber中这样做,但它已被删除。)



然而,您可以通过几种方式共享场景中的步骤列表: p>



也许你可以重构你的问题,方法。


I want to create a feature file that will call other feature files. Is this possible? For example, I'd like a high level feature file that says something like this (only in proper formatting):

call feature1
call feature2
call feature3

and each call goes to a feature file containing, for example:

Scenario Outline:
  Given this
  Then that
  And more

So with this example, you'd have 1 high level feature file, with 3 lower level feature files. Each sub-feature will probably be a scenario outline.

Thanks.

解决方案

There is no Cucumber feature that allows you to run a feature from another feature. You can't even call a scenario from another scenario. (You could do that in early versions of Cucumber, but it was removed.)

You can share lists of steps among scenarios in a couple of ways, however:

Maybe you can restructure your problem to use one of these methods.

这篇关于可以从黄瓜的其他功能调用功能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆