Behat可以在尝试运行任何命令之前检查步骤是否已定义吗? [英] Can behat check that steps are defined before trying to run anything?

查看:65
本文介绍了Behat可以在尝试运行任何命令之前检查步骤是否已定义吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个behat场景,需要很长时间才能运行.如果我写错了一个步骤,则必须等待测试达到该步骤,然后才能发现错误,因为它告诉我我有一个未定义的步骤.

I've got a behat scenario that takes a long time to run. If I've written a step incorrectly, I have to wait for the test to hit that step before I find out my mistake when it tells me I've got an undefined step.

有没有办法让behat在尝试运行任何东西之前检查要尝试运行的所有步骤是否已定义?

Is there a way to get behat to check that all the steps it's going to try and run are defined, before it tries to run anything?

推荐答案

使用空运行选项以防止执行步骤:

Use dry run option to prevent step execution:

bin/behat --dry-run

从长远来看,您应该修复测试并使其更快.例如,仅对少量烟雾测试(关键路径)执行端到端测试,并对业务对象运行大多数验收测试.

In the long run, you should rather fix your tests and make them quicker. For example, only execute end-to-end tests for small number of smoke tests (critical paths), and run most of your acceptance tests against your business objects.

这篇关于Behat可以在尝试运行任何命令之前检查步骤是否已定义吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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