0

I've various tests written in Calabash using Ruby. I've tried the tests locally on the simulator and on a physical device and there wasn't any issues but, when I try to execute them on the Xamarin Test Cloud it throws an error relative to the Calabash launcher. I've changed the 01_launch.rb file several times and the error persists. This is the log file:

{"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'

I've been searching about this issue but I don't find anything related. I'm trying to test the platform in order to use it in a CI environment for a large iOS and Android app. Any help would be welcome.

Update: I've been able to run the test on a physical device on my local machine with these settings but the Xamarin Test Cloud tests still failing. The failing line is at the Before hook is:

launcher.relaunch(options)

This is the 01_launch.rb file:

# 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

I've used the calabash-cucumber (0.20.3) and the run_loop (2.2.2) gems.

Thanks. P.S: The app_id is omitted, in the tests the real app_id is setted correctly.

anbarquer
  • 178
  • 1
  • 2
  • 8

1 Answers1

1

You are probably referencing RunLoop::Xcode in your hooks. If you provide a gist of your 01_launch.rb, I might be able to help.

^ Thanks!

The bug that was causing this has been fixed.

jmoody
  • 2,480
  • 1
  • 16
  • 22
  • Thanks, I've updated the question with some code and more information. I hope it helps. – anbarquer Dec 13 '16 at 10:42
  • Please send me a link your Test Cloud run. You can private message me. – jmoody Dec 15 '16 at 17:28
  • https://testcloud.xamarin.com/test/eon-espana-sl-tu-oficina-online-pre_48d384c5-429a-4ef0-8c47-8cd3d797060d/ – anbarquer Dec 19 '16 at 13:09
  • @AntonioD.Barquero the link you shared is currently publically accessible to anyone who clicks it. If you set it to "Private" than it will no longer be publically accessible, though Xamarin Engineers should still be able to view it using admin access (including myself & @jmoody). You can also click the "Support" link at the top to reach out directly to Test Cloud email support if needed. Screenshot with privacy setting in red & support link in green: http://www.screencast.com/t/8C3yWVuT – user62171 Jan 03 '17 at 22:06
  • I've tested the application again and the tests are working. Thanks for all the help provided. – anbarquer Jan 23 '17 at 13:16