0

I am having issue running cucumber. The below are the issue details. Could you please help me.

Command::

cucumber gherkin/pre_login_menu/pre_login_menu.feature -p common_requirements -p ios -p AU_en_ios_3dot4dot6 -p commonBranch_br_2015_2dot0 -p e2sl -p squidman --tags @done_ios DEVICE_TARGET='iPhone 5 (9.2)'

Exception::

cannot load such file -- cucumber/formatter/ordered_xml_markup (LoadError)
/Users/username/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:128:in `require'
/Users/username/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
/Users/username/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:39:in `require'
/Users/username/automation_msl_refactoring/CucumberRequirements/features/support/custom_html_formatter/custom_html.rb:2:in `<top (required)>'
/Users/username/.rvm/gems/ruby-2.0.0-p353/gems/cucumber-2.4.0/lib/cucumber/rb_support/rb_language.rb:96:in `load'
/Users/username/.rvm/gems/ruby-2.0.0-p353/gems/cucumber-2.4.0/lib/cucumber/rb_support/rb_language.rb:96:in `load_code_file'
/Users/username/.rvm/gems/ruby-2.0.0-p353/gems/cucumber-2.4.0/lib/cucumber/runtime/support_code.rb:142:in `load_file'
/Users/username/.rvm/gems/ruby-2.0.0-p353/gems/cucumber-2.4.0/lib/cucumber/runtime/support_code.rb:84:in `block in load_files!'
/Users/username/.rvm/gems/ruby-2.0.0-p353/gems/cucumber-2.4.0/lib/cucumber/runtime/support_code.rb:83:in `each'
/Users/username/.rvm/gems/ruby-2.0.0-p353/gems/cucumber-2.4.0/lib/cucumber/runtime/support_code.rb:83:in `load_files!'
/Users/username/.rvm/gems/ruby-2.0.0-p353/gems/cucumber-2.4.0/lib/cucumber/runtime.rb:253:in `load_step_definitions'
/Users/username/.rvm/gems/ruby-2.0.0-p353/gems/cucumber-2.4.0/lib/cucumber/runtime.rb:61:in `run!'
/Users/username/.rvm/gems/ruby-2.0.0-p353/gems/cucumber-2.4.0/lib/cucumber/cli/main.rb:32:in `execute!'
/Users/username/.rvm/gems/ruby-2.0.0-p353/gems/cucumber-2.4.0/bin/cucumber:8:in `<top (required)>'
/Users/username/.rvm/gems/ruby-2.0.0-p353/bin/cucumber:23:in `load'
/Users/username/.rvm/gems/ruby-2.0.0-p353/bin/cucumber:23:in `<main>'
/Users/username/automation_msl_refactoring/CucumberRequirements/features/support/01_launch.rb:148:in `block in <top (required)>': undefined method `simulator_launcher' for #<Launcher: not attached to an automator> (NoMethodError)

XCode and Calabash versions:

   [MACHINESRV:] xcode-select --print-path                                          
   /Applications/Xcode.app/Contents/Developer

   [MACHINESRV:~] xcodebuild -version
   Xcode 7.2.1
   Build version 7C1002

   [MACHINESRV:~] calabash-ios version                                
   0.20.3

   [MACHINESRV:~] curl http://localhost:37265/version                                   

{"outcome":"SUCCESS","ios_version":"9.2","app_id":"au.co.service","app_name":"AppName","app_base_sdk":"iphonesimulator9.2","git":{"remote_origin":"git@github.com:calabash/calabash-ios-server.git","branch":"master","revision":"5ec0a54"},"iOS_version":"9.2","simulator_device":"iPhone","version":"0.20.3","server_port":37265,"model_identifier":"iPhone5,1","form_factor":"iphone 4in","app_version":"3.7.0","simulator":"CoreSimulator 201.3 - Device: iPhone 5 - Runtime: iOS 9.2 (13C75) - DeviceType: iPhone 5","4inch":true,"iphone_app_emulated_on_ipad":false,"device_family":"iPhone","screen_dimensions":{"scale":2,"width":640,"native_scale":2,"sample":1,"height":1136},"short_version_string":"3.7.0","system":"x86_64","device_name":"iPhone Simulator"}

Here is the code for 01_launch.rb file:

require_relative '../support/env' if ENV['isDryRun']
require_relative '../models/runtime'
runtime = Runtime.get_inst

if runtime.is_ios?
  require 'calabash-cucumber/launcher'

  case `whoami`.chomp("\n")
    when 'jcarp5' 
    when 'jenkinsadmin'
     # Jenkins app bundle path
     APP_BUNDLE_PATH="/xxxxxx/Build/Products/Debug-iphonesimulator/CalabashTests.app"
   when 'xxxx'
    APP_BUNDLE_PATH="/Users/xxxxxxxx/Build/Products/Calabash-iphonesimulator/Enterprise.app"
   else
     if ENV['APP_BUNDLE_PATH'] == nil || ENV['APP_BUNDLE_PATH'] == ""
      puts "no appbundlepath"
       raise "You need to set the environment variable APP_BUNDLE_PATH."
    end
end


 Before do |scenario|
   @calabash_launcher = Calabash::Cucumber::Launcher.new

    unless @calabash_launcher.calabash_no_launch?
     @calabash_launcher.relaunch
     @calabash_launcher.calabash_notify(self)
    end
 end

 After do |scenario|
    unless @calabash_launcher.calabash_no_stop?
     calabash_exit
     if @calabash_launcher.active?
      @calabash_launcher.stop
     end
   end
 end

  at_exit do
    launcher = Calabash::Cucumber::Launcher.new
     if launcher.simulator_target?

       launcher.simulator_launcher.stop unless launcher.calabash_no_stop?
     end
  end

end
Akurati
  • 1
  • 1

1 Answers1

0

Please read the error message:

support/01_launch.rb:148:in `block in <top (required)>': undefined method `simulator_launcher' for #<Launcher: not attached to an automator> (NoMethodError)

You have method in your 01_launch on line 148 that is not defined.

simulator_launcher is not part of the Calabash::Cucumber::Launcher API.

Show us your 01_launch file.

jmoody
  • 2,480
  • 1
  • 16
  • 22
  • Thanks for the reply. I have added 01_launch.rb code in the question section. I have removed some commented code so number of lines reduced. – Akurati Nov 02 '16 at 19:17
  • Moody, Could you please respond to this, i have tried with xcode 8.2 also and facing the same issue – Akurati Jan 09 '17 at 22:06
  • Akurati - there is no method `simulator_launcher` - which is is exactly what the error message says. I recommend updating your hooks so they look like the example hooks here: https://github.com/calabash/calabash-ios/blob/develop/calabash-cucumber/features-skeleton/support/01_launch.rb or in any one of the example projects. – jmoody Jan 10 '17 at 08:29