【问题标题】:Error executing Calabash iOS tests Xamarin Test Cloud执行 Calabash iOS 测试时出错 Xamarin Test Cloud
【发布时间】:2016-11-29 11:53:19
【问题描述】:

我使用 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'

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

更新: 我已经能够使用这些设置在本地计算机上的物理设备上运行测试,但 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设置正确。

【问题讨论】:

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


    【解决方案1】:

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

    ^ 谢谢!

    导致此问题的错误已修复。

    【讨论】:

    • 谢谢,我已经用一些代码和更多信息更新了这个问题。我希望它有所帮助。
    • 请给我一个你的测试云运行的链接。可以私信我。
    • @AntonioD.Barquero 您分享的链接目前可供任何点击它的人公开访问。如果将其设置为“私人”,则它将不再可公开访问,但 Xamarin 工程师仍应能够使用管理员访问权限(包括我自己和@jmoody)查看它。如果需要,您还可以单击顶部的“支持”链接直接联系 Test Cloud 电子邮件支持。屏幕截图,红色为隐私设置,绿色为支持链接:screencast.com/t/8C3yWVuT
    • 我再次测试了应用程序并且测试正常。感谢您提供的所有帮助。
    猜你喜欢
    • 1970-01-01
    • 2018-09-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多