【发布时间】:2015-06-12 16:50:00
【问题描述】:
我似乎在使用 Rake 和我的 Cucumber 功能文件时遇到了一些问题。
这是 Jenkins 中的命令。它指定了我直接放在 ./features 目录中的 Rake 文件,因此 testjson.feature 就在那里。
/usr/local/bin/rake --rakefile /home/robm/code/BDD/practise-tests/testtq/features/Rakefile
Rakefile 看起来像这样:
require 'cucumber/rake/task'
Cucumber::Rake::Task.new :features do |t|
t.cucumber_opts = '*.feature'
end
这很简单,但在 Jenkins 的控制台输出中我得到:
Feature: Validate DUT JSON
JSON should be evaluated for all routes in API
All API routes should return valid JSON
If JSON is invalid for one or more route in API it has DUT failed
Scenario Outline: Validate JSON # testJson.feature:6
Given there is a DUT with "<input>" and "<un>" and "<pw>" # testJson.feature:7
When the JsonTest code is run # testJson.feature:8
Then the output should be "<output>" # testJson.feature:9
Examples:
| input | un | pw | output |
| 172.168.101.139 | username | password | CHECK |
| 172.168.101.214 | username | password | CHECK |
2 scenarios (2 undefined)
6 steps (6 undefined)
0m0.007s
这告诉我它没有找到功能文件,对吧?
当我转到功能文件上方的目录并运行 Cucumber 时,测试工作正常!
所以,很明显我的 Rake 文件有错误。有什么想法吗?
【问题讨论】:
-
欢迎来到 Stack Overflow。 SO 支持许多问题和答案的格式选项,使我们更容易阅读您所写的内容。请参阅Markdown help 了解更多信息。
标签: ruby jenkins cucumber rake