簡體   English   中英

黃瓜功能文件在命令行上運行,但不在Intellij中運行:無法加載步驟定義(未定義)

[英]Cucumber feature file runs on the command line but not in Intellij: Can't load step definitions (undefined)

黃瓜功能文件在命令行上運行,但不在Intellij中運行。 我相信這意味着我缺少其他配置步驟。

我正在使用Windows 7,Intellij IDEA 13.1.3,Ruby 1.9.3,Cucumber 1.3.4

這是我的項目文件夾結構:

\cucumber
  \projectName
    \features
     -mainFeature.feature
      \step_definitions
       -helperFeature.feature

在命令行上,我導航到Cucumber文件夾:

E:\path\to\cucumber\folder\

然后執行以下命令:

bundle exec cucumber projectName/features/mainFeature.feature

並且此命令成功運行了黃瓜測試用例。

當我嘗試在Intellij中運行黃瓜測試用例時,Intellij無法找到/加載步驟定義。 它說,我在功能中使用的每個步驟“都可以使用這些摘要實現未定義步驟的步驟定義”。

具體的錯誤消息是:

You can implement step definitions for undefined steps with these snippets:

Then(/^verify the same\-date destination airport grouping strategy$/) do
  pending # express the regexp above with the code you wish you had
end
1 scenario (1 undefined)
5 steps (5 undefined)
0m0.014s

在“運行>編輯配置”下,我在配置標簽上定義了以下內容:

Feature file:          E:\path\to\cucumber\folder\projectName\features\scratchpad_grouping_strategy.feature
Runner options:        --color -r features
'cucumber' gem:        1.3.4
Working directory:     E:\path\to\cucumber\folder\
Environment variables: [environment variables]
Ruby arguments:        -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift);
Ruby SDK:              Use other SDK  -> 'cucumber' gem: ruby 1.9.3

在[Bundler]標簽下:

Run the script in context of the bundle (bundle exec) is checked

有什么建議嗎?

我必須正確指定工作目錄。 以下是我的目錄

我的工作目錄:/ user / jchiang / test / cucumber我的cucubmer功能文件:/ user / jchiang / test / cucumber / features我的cucubmer步驟定義:/ user / jchiang / test / cucumber / lib

在此處輸入圖片說明

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM