uninitialized constant Autotest when running cucumber features Follow
I got the following error when trying to run a cucumber feature for a new project in a new installation of EAP RM-97.39:
/Users/carl/.rvm/rubies/ruby-1.9.2-p0/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/carl/Source/sandbox/tms_status/script/cucumber /Users/carl/Source/sandbox/tms_status --format Teamcity::Cucumber::Formatter --expand --color
Testing started at 3:52 PM ...
Using the default profile...
uninitialized constant Autotest (NameError)
/Users/carl/.rvm/gems/ruby-1.9.2-p0@tms_status/gems/rspec-expectations-2.0.1/lib/rspec/expectations/backward_compatibility.rb:6:in `const_missing'
/Users/carl/.rvm/gems/ruby-1.9.2-p0@tms_status/gems/rspec-core-2.0.1/lib/rspec/core/backward_compatibility.rb:20:in `const_missing'
/Users/carl/Source/sandbox/tms_status/autotest/discover.rb:1:in `<top (required)>'
/Users/carl/.rvm/gems/ruby-1.9.2-p0@tms_status/gems/cucumber-0.9.2/lib/cucumber/rb_support/rb_language.rb:143:in `load_code_file'
/Users/carl/.rvm/gems/ruby-1.9.2-p0@tms_status/gems/cucumber-0.9.2/lib/cucumber/runtime/support_code.rb:158:in `load_file'
/Users/carl/.rvm/gems/ruby-1.9.2-p0@tms_status/gems/cucumber-0.9.2/lib/cucumber/runtime/support_code.rb:61:in `block in load_files!'
/Users/carl/.rvm/gems/ruby-1.9.2-p0@tms_status/gems/cucumber-0.9.2/lib/cucumber/runtime/support_code.rb:60:in `each'
/Users/carl/.rvm/gems/ruby-1.9.2-p0@tms_status/gems/cucumber-0.9.2/lib/cucumber/runtime/support_code.rb:60:in `load_files!'
/Users/carl/.rvm/gems/ruby-1.9.2-p0@tms_status/gems/cucumber-0.9.2/lib/cucumber/runtime.rb:185:in `load_step_definitions'
/Users/carl/.rvm/gems/ruby-1.9.2-p0@tms_status/gems/cucumber-0.9.2/lib/cucumber/runtime.rb:26:in `run!'
/Users/carl/.rvm/gems/ruby-1.9.2-p0@tms_status/gems/cucumber-0.9.2/lib/cucumber/cli/main.rb:54:in `execute!'
/Users/carl/.rvm/gems/ruby-1.9.2-p0@tms_status/gems/cucumber-0.9.2/lib/cucumber/cli/main.rb:29:in `execute'
/Users/carl/.rvm/gems/ruby-1.9.2-p0@tms_status/gems/cucumber-0.9.2/bin/cucumber:8:in `<top (required)>'
/Users/carl/Source/sandbox/tms_status/script/cucumber:9:in `load'
/Users/carl/Source/sandbox/tms_status/script/cucumber:9:in `<top (required)>'
-e:1:in `load'
-e:1:in `<main>'
Empty test suite.
Process finished with exit code 1
Also, when I try to run the feature file directly with ctrl-cmd-F8 it tries to launch script/server instead. I would like to map the Run all features and the Run this feature file commands to keystrokes. Any suggestions?
Thanks,
Carl
Please sign in to leave a comment.
Hi Carl,
Ctrl+Cmd+F8 - is "Run" action, it launches "current" active run configuration (it is shown in toolbar bar)
Cmd+Option+F8 - launches current context, where cursor is located (e.g. ruby file, test, focused test, feature or scenarion, etc.)
Cmd+F8 - Show list of saved and tmp run configurations and allow to quickly choose any of them, using speed search feature
Could you try to launch test from system console? Looks like rspec bug or rails app configuration problem
If I run cucumber from the command line, the feature runs correctly:
carl@caywork ~/Source/sandbox/tms_status ruby-1.9.2-p0@tms_status ∴ cucumber
Using the default profile...
.F---.F---
(::) failed steps (::)
cannot fill in, no text field, text area or password field with id, name, or label 'Email' found (Capybara::ElementNotFound)
./features/step_definitions/web_steps.rb:41:in `block (2 levels) in <top (required)>'
./features/step_definitions/web_steps.rb:14:in `with_scope'
./features/step_definitions/web_steps.rb:40:in `/^(?:|I )fill in "([^"]*)" with "([^"]*)"(?: within "([^"]*)")?$/'
features/signin.feature:8:in `When I fill in "Email" with "carl.youngblood"'
cannot fill in, no text field, text area or password field with id, name, or label 'Email' found (Capybara::ElementNotFound)
./features/step_definitions/web_steps.rb:41:in `block (2 levels) in <top (required)>'
./features/step_definitions/web_steps.rb:14:in `with_scope'
./features/step_definitions/web_steps.rb:40:in `/^(?:|I )fill in "([^"]*)" with "([^"]*)"(?: within "([^"]*)")?$/'
features/signin.feature:15:in `When I fill in "Email" with "carl.youngblood"'
Failing Scenarios:
cucumber features/signin.feature:6 # Scenario: Log in with a correct password
cucumber features/signin.feature:13 # Scenario: Log in with an incorrect password
2 scenarios (2 failed)
10 steps (2 failed, 6 skipped, 2 passed)
0m1.221s
It also works if I pass the individual feature file to cucumber as a command-line arg.
I have this same problem. I tried uninstalling test-unit gem, but didn't seem to help.
I fixed this by editing the run configuration and changing the working directory from the base directory of the project to the features subdirectory.
(I also unchecked the make box, I don't know if that did anything).
Do you use IntelliJ IDEA with Ruby plugin?
I cannot reproduce. My scenario:
0. I have ruby 1.8.7 sdk with bundler
1. Create new Rails 3.0 application
2. My Gemfile is:
3. run "cucumber:init" rake task
4. create some resource using Scaffold and feature test for it (cucumber:feature)
5. run task "db:migrage"
6. Run feature file from context menu.
* test-unit (2.1.1)
* cucumber (0.9.3)
* cucumber-rails (0.3.2)