运行功能时黄瓜步骤不会自动加载 [英] Cucumber steps not automatically loaded when running features

查看:177
本文介绍了运行功能时黄瓜步骤不会自动加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近更新了我的机器上的黄瓜宝石('cucumber'和'cucumber-rails'),并遇到了几个问题。我目前正在战斗的是没有一个定义的步骤,我的功能是由黄瓜自动加载。这导致我的命令行告诉我,对于我的功能中使用的每一个步骤,可以实现这些片段的未定义步骤的步骤定义。

I have recently updated the Cucumber gems ('cucumber' and 'cucumber-rails') on my machine and have run into a couple of issues. The one i am currently fighting is that none of the defined steps for my features are being automatically loaded by Cucumber. This results in my command line telling me i "can implement step definitions for undefined steps with these snippets" for every single step i use in my features.

cucumber --verbose

...并且可以看到以下内容:

...and can see the following:

代码:
* vendor / plugins / paperclip / cucumber / paperclip_steps.rb

Code: * vendor/plugins/paperclip/cucumber/paperclip_steps.rb

但是,除非我指定要加载的文件,否则没有任何步骤正由Cucumber加载:

However, none of the steps are being loaded in by Cucumber unless i specify files to load:

cucumber -r features/step_definitions/web_steps.rb

只是我在我的应用程序结构中的step_definitions文件夹中创建的自定义步骤文件,但它会出现标准的web_steps文件未加载。

I thought this might just be the custom step files i had created within the "step_definitions" folder in my app structure but it would appear the standard "web_steps" file isnt being loaded either.

感谢。

推荐答案

OK我已经为此提出了一个解决方案。我不知道如果它的正确的一个或不。在运行cucumber命令时,简单禁用配置文件似乎可以确保为这些功能加载正确的步骤定义。

OK i have come up with a solution for this for the time being. Im not sure if its the right one or not. Simple disabling profiles when running the cucumber command seems to ensure that the correct step definitions are loaded for the features.

现在可以使用以下命令运行测试:

I can now run my tests with:

cucumber --no-profile

这篇关于运行功能时黄瓜步骤不会自动加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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