I created just a feature file (AddMovie.feature) that contains:
Feature: User can manually add movie
Scenario: Add a movie
Given I am on the RottenPotatoes home page
When I follow "Add new movie"
Then I should be on the Create New Movie page
When I fill in "Title" with "Men In Black"
And I select "PG-13" from "Rating"
And I press "Save Changes"
Then I should be on the RottenPotatoes home page
And I should see "Men In Black"
When I execute cucumber to test it with the command:
bundle exec cucumber features/AddMovie.feature
I get this as a result:
Using the default profile...
Feature: User can manually add movie
Scenario: Add a movie # features/AddMovie.feature:3
Given I am on the RottenPotatoes home page
When I follow "Add new movie"
Then I should be on the Create New Movie page
When I fill in "Title" with "Men In Black"
And I select "PG-13" from "Rating"
And I press "Save Changes"
Then I should be on the RottenPotatoes home page
And I should see "Men In Black"
1 scenario (1 passed)
0 steps
Normally this scenario will fail since i didn't add the path of "the RottenPotatoes home page". If you read the last line "0 steps" so cucumber is not running any step.
How can I fix this ? and make cucumber testing the steps defined in AddMovie.feature ?
PS: when I used the command cucumber features/Addmovies.feature I got this error
Using the default profile...
You have already activated activesupport 3.2.8, but your Gemfile requires activesupport 3.1.0. Using bundle exec may solve this. (Gem::LoadError)
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/runtime.rb:31:in `block in setup'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/runtime.rb:17:in `setup'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler.rb:107:in `setup'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.5/lib/bundler/setup.rb:7:in `<top (required)>'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
/home/ubuntu/Desktop/hw2_rottenpotatoes/config/boot.rb:6:in `<top (required)>'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
/home/ubuntu/Desktop/hw2_rottenpotatoes/config/application.rb:1:in `<top (required)>'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
/home/ubuntu/Desktop/hw2_rottenpotatoes/config/environment.rb:2:in `<top (required)>'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-rails-1.3.0/lib/cucumber/rails.rb:7:in `<top (required)>'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
/home/ubuntu/Desktop/hw2_rottenpotatoes/features/support/env.rb:7:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/rb_support/rb_language.rb:129:in `load'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/rb_support/rb_language.rb:129:in `load_code_file'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:171:in `load_file'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:83:in `block in load_files!'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:82:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:82:in `load_files!'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime.rb:175:in `load_step_definitions'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime.rb:40:in `run!'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:43:in `execute!'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:20:in `execute'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/bin/cucumber:14:in `<top (required)>'
/usr/local/bin/cucumber:19:in `load'
/usr/local/bin/cucumber:19:in `<main>'
And It disappeared when I have added Bundle exec
Have you initialized your database and run 'bundle install'? The error without bundle exec is because your bundle wants a different version of active support than the one presently installed.
Rails encourages convention over configuration. The convention for feature names is lower case snake_case.
Look at your other features. cucumber seems to execute all features the way you are invoking it. It could be a problem with something else in the directory.
Do you have any step files? They might also be your issue.
Also, Stackoverflow is not really the place for asking questions about homework (there is a forum for that).
I solve this problem, for your solutions do this
install gem bundler
latest
gem install bundler --no-ri --no-rdoc
and then run cucumber features/find_movie_with_same_director.feature
if still that error comes then follow steps that define below links
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.