2016-11-29 81 views
0

我已經使用Ruby在Calabash中編寫了各種測試。我已經在模擬器和物理設備上本地嘗試過測試,並且沒有任何問題,但是當我嘗試在Xamarin測試雲上執行它們時,它會引發與Calabash啓動器相關的錯誤。我已經多次更改了01_launch.rb文件,並且錯誤仍然存​​在。這是日誌文件:執行葫蘆iOS測試時出錯Xamarin測試雲

{"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測試雲測試仍然失敗我的本地機器上運行在物理設備上進行測試。 出現故障的線路是在之前鉤:

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設置正確。

回答

0

你可能在你的鉤子中引用RunLoop :: Xcode。如果您提供了01_launch.rb的要點,我可能會提供幫助。

^謝謝!

導致此問題的錯誤已修復。

+0

謝謝,我用一些代碼和更多的信息更新了這個問題。我希望它有幫助。 –

+0

請給我一個鏈接,您的測試雲運行。你可以私信給我。 – jmoody

+0

https://testcloud.xamarin.com/test/eon-espana-sl-tu-oficina-online-pre_48d384c5-429a-4ef0-8c47-8cd3d797060d/ –