在行为上,您仅如何运行方案? [英] In behave, how do you run a scenario only?

查看:64
本文介绍了在行为上,您仅如何运行方案?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个行为"功能,上面有很多测试.

I have a 'behave' feature that has a lot of tests on it.

我只需要为开发需求运行特定方案即可.

I only need to run a specific scenario for development needs.

我该怎么做?

(最好是在命令行上)

推荐答案

要仅运行单个方案,可以将-n与方案名称一起使用:

To run only a single scenario you can use -n with the name of the scenario:

$ behave -n 'clicking the button "foo" should bar the baz'

我在上面使用单引号将方案的名称保留为一个参数.否则,shell会将方案名称的每个单词作为单独的参数传递.

I'm using single quotes above to keep the name of the scenario as one argument for -n. Otherwise, the shell will pass each word of the scenario name as a separate argument.

这篇关于在行为上,您仅如何运行方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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