执行Calabash iOS测试时出错Xamarin Test Cloud

时间:2016-11-29 11:53:19

标签: ios ruby testing calabash xamarin-test-cloud

我使用Ruby用Calabash编写的各种测试。我已经在模拟器和物理设备上本地尝试了测试并且没有任何问题但是,当我尝试在Xamarin测试云上执行测试时,它会抛出相对于Calabash启动器的错误。我已多次更改01_launch.rb文件并且错误仍然存​​在。这是日志文件:

{"type":"install","last_exception":{"class":"XTCOperationalError","message":"500\n{\"message\":\"undefined method `strip' for nil:NilClass\",\"app_id\”:\”XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\"}","backtrace":null}} (XTCOperationalError)
./xtc-sandbox-runtime-lib/xtc/formatter/patches/calabash_common_patch.rb:64:in `raise_operational_error'
./xtc-sandbox-runtime-lib/xtc/formatter/patches/calabash_ios_patch.rb:223:in `xtc_install_app'
./xtc-sandbox-runtime-lib/xtc/formatter/patches/calabash_ios_patch.rb:129:in `relaunch'
./features/support/01_launch.rb:98:in `launch'
./features/support/01_launch.rb:340:in `Before'

我一直在搜索这个问题,但我找不到任何相关内容。我正在尝试测试该平台,以便在CI环境中使用它来处理大型iOS和Android应用。欢迎任何帮助。

更新: 我已经能够使用这些设置在本地计算机上的物理设备上运行测试,但Xamarin测试云测试仍然失败。 失败的行在Before钩子是:

launcher.relaunch(options)

这是01_launch.rb文件:

# encoding: utf-8

require 'calabash-cucumber/launcher'

module LaunchControl
  @@launcher = nil

  def self.launcher
    @@launcher ||= Calabash::Cucumber::Launcher.new
  end

  def self.launcher=(launcher)
    @@launcher = launcher
  end

  def self.xcode
    Calabash::Cucumber::Environment.xcode
  end

  def self.instruments
    Calabash::Cucumber::Environment.instruments
  end

  def self.simctl
    Calabash::Cucumber::Environment.simctl
  end

  def self.environment
    {
      :simctl => self.simctl,
      :instruments => self.instruments,
      :xcode => self.xcode
    }
  end

  def self.target
    ENV['DEVICE_TARGET'] || RunLoop::Core.default_simulator
  end

  def self.target_is_simulator?
    self.launcher.simulator_target?
  end

  def self.target_is_physical_device?
    self.launcher.device_target?
  end
end

# Delete user data after a scenario tagged with '@reset_settings'
After('@reset_settings') do
  if xamarin_test_cloud?
   ENV['RESET_BETWEEN_SCENARIOS'] = '1'
  elsif LaunchControl.target_is_simulator?
    target = LaunchControl.target
    device = RunLoop::Device.device_with_identifier(target,       LaunchControl.environment)
    RunLoop::CoreSimulator.erase(device)
  else
    LaunchControl.install_on_physical_device
  end
end



Before do |scenario|

  launcher = LaunchControl.launcher
  options = {
  }

 launcher.relaunch(options)

end

After do |scenario|
  if launcher.quit_app_after_scenario?
    calabash_exit
  end
end

我使用了葫芦黄瓜(0.20.3)和run_loop(2.2.2)宝石。

感谢。 P.S:省略app_id,在测试中正确设置了真正的app_id。

1 个答案:

答案 0 :(得分:0)

您可能在钩子中引用了RunLoop :: Xcode。如果您提供01_launch.rb的要点,我可能会提供帮助。

^谢谢!

造成这种情况的错误已得到修复。