Unable to run Automation scripts - Throws error - NoMethodError: undefined method `describe_to' for nil:NilClass

Hello all,

Am new to Ruby world and i am trying to automated a webapp around Ruby + selenium + cucumber + rspec + capybara.

i am doing this from windows 8 environment.

I tried all possible ruby installer from 1.9.3, 2.1.6 & 2.2.2

Installed all gems, like  activesupport,selenium-client,selenium-webdriver,rspec,capybara,cucumber,gherkin.

Error details:

C:\Ruby193\bin\ruby.exe -EUTF-8 -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:\Ruby193\bin/cucumber "D:/Automation/Ruby/Working Folder/Firstproject/Features/first.feature" --format Teamcity::Cucumber::Formatter --expand --name "^Check validation of Google Sign Up page$" --color -r features
Testing started at 6:04 PM ...
...
NoMethodError: undefined method `describe_to' for nil:NilClass
..
-e:1:in `load'
-e:1:in `<main>'

Env.rb:

 
require "Capybara"
require "Capybara/cucumber"
require "rspec"
require File.expand_path("../Common_Lib",__FILE__) #require

include RSpec
::Matchers
include Common_functions

$timeout
= 50
Capybara
.configure do |capybara|

Capybara.register_driver :selenium_ff do |app|
   Capybara::Selenium::Driver.new(app, :browser => :firefox)
  end

  Capybara
.register_driver :selenium_ie do |app|
    Capybara::Selenium::Driver.new(app, :browser => :internetexplorer)
  end

  Capybara
.register_driver :selenium_chrome do |app|
    Capybara::Selenium::Driver.new(app,:browser => :chrome)
  end

  capybara
.default_driver = :selenium_ff #set the browser you want to run the test on
  capybara
.run_server = false
  #capybara.app_host ="https://www.youtube.com" #if you have your own project, you can set your own app_host here.
end

RSpec
.configure do |config|
  config.include Capybara::DSL
end


Note:

Am just trying to do some examples from internet and i am following exact steps of what they do, where they get results and am not?

Can anyone help me in solving this, as am blocked in this stage itself.

Thanks,
SatGalley

0
3 comments
Avatar
Permanently deleted user

Hi,

it is better to ask such questions on Capybara's mailing list (there are more people who may help with your problem).
This forum is for quesions about how to use RubyMine.

Regards, Oleg.

0
Avatar
Permanently deleted user

I am encountering the same issue in rubymine but everything runs fine from command line.

I noticed in the rubymine console output that a tag i am using in my feature file appears with an extra @.

The environment variables are set in the run configuration. Both ruby and cucumber in the config are the same as used for command line.

Rubymine console output

Testing started at 9:02 AM ...
Code:

Features:
  * /Users/mgraff/Documents/workspace/pages/web/features/scenarios/tracking.feature

Tag: @@useproxy

NoMethodError: undefined method `describe_to' for nil:NilClass
/Users/mgraff/.rvm/gems/ruby-2.1.0/gems/cucumber-2.0.0/lib/cucumber/rb_support/snippet.rb:98:in `new'
/Users/mgraff/.rvm/gems/ruby-2.1.0/gems/cucumber-2.0.0/lib/cucumber/rb_support/snippet.rb:13:in `initialize'
/Users/mgraff/.rvm/gems/ruby-2.1.0/gems/cucumber-2.0.0/lib/cucumber/rb_support/rb_language.rb:61:in `new'
/Users/mgraff/.rvm/gems/ruby-2.1.0/gems/cucumber-2.0.0/lib/cucumber/rb_support/rb_language.rb:61:in `snippet_text'
/Users/mgraff/.rvm/gems/ruby-2.1.0/gems/cucumber-2.0.0/lib/cucumber/runtime/support_code.rb:116:in `block in snippet_text'
/Users/mgraff/.rvm/gems/ruby-2.1.0/gems/cucumber-2.0.0/lib/cucumber/runtime/support_code.rb:115:in `map'
/Users/mgraff/.rvm/gems/ruby-2.1.0/gems/cucumber-2.0.0/lib/cucumber/runtime/support_code.rb:115:in `snippet_text'
/Users/mgraff/.rvm/gems/ruby-2.1.0/gems/cucumber-2.0.0/lib/cucumber/formatter/legacy_api/runtime_facade.rb:12:in `snippet_text'

Command line

$ cucumber features/scenarios/tracking.feature

Please report a bug if this causes problems.
Using the default profile...
@useproxy
Feature: web tracking tests

  Scenario: Tests tracking on bpage pageview                   # features/scenarios/tracking.feature:5
      setup proxy
      proxy setup
    Given I am testing tracking for page "entry_oius90d70s8djf098g0sd987f"
...

0

It looks like already fixed issue RUBY-16612

Could you try the latest EAP of RubyMine 8?

0

Please sign in to leave a comment.