开发者

Cucumber : Command failed with status (1) with rake features

开发者 https://www.devze.com 2023-02-20 06:14 出处:网络
I am using rails 2.3.5 with cucumber (0.10.0) cucumber-rails (0.3.2) capybara (0.4.1.2) rspec (2.5.0) rspec-core (2.5.1)

I am using rails 2.3.5 with cucumber (0.10.0) cucumber-rails (0.3.2) capybara (0.4.1.2) rspec (2.5.0) rspec-core (2.5.1) rspec-expectations (2.5.0) rspec-mocks (2.5.0) rspec-rails (2.5.0)

I have this scenario

Feature: User Login

Scenario: User sees the admin login page
    Given There exists an admin login page
    When I visit the admin login page
    Then she should see the "login , Password" fields
    And she should see links to "Forgot Password? , Do not have an account?"

And my web steps

Given /^There exists an admin login page$/ do
    Capybara.default_host = "admin.local"
    Capybara.app_host = "http://admin.local:9887" if Capybara.current_driver == :selenium  
end

When /^I visit the admin login page$/ do
  visit ('/')
end


Then /^she should see the "([^"]*)" fields$/  do |fields|
  fields.split(/,/).each do |field|
   page.should have_xpath("//*[@id='user_session_#{field.downcase.strip}']")
  end
end

Then /^she should see links to "([^"]*)"$/ do |links|
  links.split(/,/).each do |link_name|
   page.should have_content(link_name.strip)   
  end
end

I have my admin console mapped as a sub domain as shown in the web steps.

The problem that I am facing is when i run this scenario using cucumber-f pretty all the steps pass and the overall scenario looks good.

But when i do rake features or rake cucumber:all I get this below error ( I am posting the error with trace)

$ rake features --trace --verbose
** Invoke features (first_time)
** Invoke cucumber (first_time)
** Invoke cucumber:ok (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:abort_if_pending_migrations
** Execu开发者_Go百科te db:test:prepare
** Invoke db:test:load (first_time)
** Invoke db:test:purge (first_time)
** Invoke environment 
** Execute db:test:purge
** Execute db:test:load
** Invoke db:schema:load (first_time)
** Invoke environment 
** Execute db:schema:load
** Execute cucumber:ok
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -I "/Library/Ruby/Gems/1.8/gems/cucumber-0.10.0/lib:lib" "/Library/Ruby/Gems/1.8/gems/cucumber-0.10.0/bin/cucumber"  --profile default
Using the default profile...
/Users/raghavendra/Projects/project/project/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010.  Use #requirement
F----F

Failing Scenarios:
cucumber features/user_features/user_login_and_creation.feature:3 # Scenario: User sees the admin login page

1 scenario (1 failed)
4 steps (4 skipped)
0m0.005s
rake aborted!
Command failed with status (1): [/System/Library/Frameworks/Ruby.framework/...]
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:995:in `sh'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1010:in `call'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1010:in `sh'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1094:in `sh'
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.0/lib/cucumber/rake/task.rb:72:in `run'
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.0/lib/cucumber/rake/task.rb:142:in `define_task'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19

Any idea or help would be highly appreciated :)


While I am not sure this relates exactly to your issue, but RSpec 2.x is Rails 3.x only. You will want RSpec 1.3.x for use with rails 2.3.x.


Cucumber throws a non zero return if there are any pending or undefined steps, when --strict is defined in your cucumber.yml file. Try taking ---strict and see if that works for you.

0

精彩评论

暂无评论...
验证码 换一张
取 消