黄瓜 - 发射器:没有连接到自动变速器

时间:2016-10-23 08:03:01

标签: cucumber calabash-ios

我遇到运行黄瓜的问题。以下是问题详情。你能帮我吗?

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)'

异常::

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和Calabash版本:

   [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                                   

{&#34;结果&#34;:&#34; SUCCESS&#34;&#34; ios_version&#34;:&#34; 9.2&#34;&#34; APP_ID&#34 ;: &#34; au.co.service&#34;&#34; APP_NAME&#34;:&#34; AppName的&#34;&#34; app_base_sdk&#34;:&#34; iphonesimulator9.2&#34; &#34; GIT中&#34; {&#34; remote_origin&#34;:&#34; git@github.com:蠡/蠡-IOS-server.git&#34;&#34;分支&#34 ;:&#34;主&#34;&#34;修订&#34;:&#34; 5ec0a54&#34;}&#34; iOS_version&#34;:&#34; 9.2&#34;,& #34; simulator_device&#34;:&#34; iPhone&#34;&#34;版本&#34;:&#34; 0.20.3&#34;&#34; SERVER_PORT&#34;:37265&# 34; model_identifier&#34;:&#34; iPhone5,1&#34;,&#34; form_factor&#34;:&#34; iphone 4in&#34;,&#34; app_version&#34;:&#34; 3.7.0&#34;,&#34;模拟器&#34;:&#34; CoreSimulator 201.3 - 设备:iPhone 5 - 运行时:iOS 9.2(13C75) - DeviceType:iPhone 5&#34;,&#34; 4inch&# 34;:真,&#34; iphone_app_emulated_on_ipad&#34;:假,&#34; device_family&#34;:&#34; iPhone&#34;&#34; screen_dimensions&#34; {&#34;刻度&# 34;:2&#34;宽度&#34;:640,&#34; native_scale&#34;:2&#34;样品&#34;:1,&#34;高度&#34;:1 136}&#34; short_version_string&#34;:&#34; 3.7.0&#34;&#34;系统&#34;:&#34; x86_64的&#34;&#34; DEVICE_NAME&#34 ;: &#34; iPhone模拟器&#34;}

以下是01_launch.rb文件的代码:

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

1 个答案:

答案 0 :(得分:0)

请阅读错误消息:

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

你在第148行的01_ launch中有一个未定义的方法。

simulator_launcher不属于Calabash :: Cucumber :: Launcher API。

向我们展示您的01_launch文件。