【问题标题】:IntelliJ Idea 10 does not recognizes global step_definitions directory for cucumberIntelliJ Idea 10 无法识别黄瓜的全局 step_definitions 目录
【发布时间】:2011-10-11 15:50:06
【问题描述】:

我在 IntelliJ Idea 10 中使用了集成的 cucumber *.feature 文件识别。我尝试使用 cucumber 插件,但是僵尸的东西疯狂地吃内存,所以我放弃了这个想法。

问题是我有一个全局 step_definitions 目录,我在其中放置了所有步骤文件。

所以我的目录树看起来像

  • 功能
  • ——模块一
  • ————功能1
  • ————函数2
  • ————功能3
  • ————函数N
  • ——模块二
  • ————功能1
  • ————函数2
  • ————功能3
  • ————函数N
  • ——step_defenitions
  • ————module1_steps.rb
  • ————module2_steps.rb
  • ————module3_steps.rb
  • ————moduleN_steps.rb
  • ——支持
  • ———— env.rb
  • ———— hooks.rb

我这样做是为了在一个地方轻松编码。

当我运行测试时,黄瓜的所有步骤都是可见的。它正在运行,正在做我写的东西。

但是当我在 *.feature 文件中编写代码时,Idea 10 看不到已定义的全局步骤定义,并在 Given、When、Then 等单词之后显示警告。

请帮助我如何告诉 Idea 10 我不需要在每个测试文件夹 (features/moduleN/functionN/step_definitions) 中包含 step_definitions 文件夹,而是使用该文件夹 (features/step_definitions)。

我试图修改项目设置,但找不到任何合适的选项。

【问题讨论】:

    标签: intellij-idea cucumber


    【解决方案1】:

    耶稣。伙计们。问题出在 step_definitions 的名称上,因为它应该是 step_definitions。

    小心。不要在家里这样做。当然,不要在工作中尝试这个:-)

    【讨论】:

    • 应该是“不要在工作中尝试这个”,因为你的错误会产生更严重的后果:>
    猜你喜欢
    • 1970-01-01
    • 2011-04-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多