如果通过Wi-Fi执行,Calabash测试通常会停留在启动服务器上

时间:2015-04-08 11:29:09

标签: wifi calabash calabash-ios

问题的一般描述:

由于项目特定( iDevice必须通过Lightning端口连接到外部硬件),我们必须通过Wi-Fi执行我们的测试包。

有专门的Macbook Pro(2011年初),Yosemite 10.10.2作为测试执行的客户端。 Mac和iDevice都连接到相同的隔离( 1 Mac和1个iDevice only )Wi-Fi接入点(无法访问互联网)。

每次我试图执行所有现有测试套件(~150次测试)时,我都面临着一个随机点 的事实(即某些测试已经被执行过了 )使用Calabash服务器的应用程序在iDevice端可视化启动,但从命令行角度看,服务器似乎没有响应它已成功启动的Mac客户端(只是我的假设)和整个执行只是在这一点上陷入困​​境。如果我通过“Ctrl + C”删除测试执行并尝试再次开始执行或通过控制台执行start_test_server_in_background我将看到应用程序服务器立即启动和关闭多次,没有任何运气建立新的稳定应用程序服务器。

此处唯一的解决方法是重新启动iDevice,并在重启后通过USB连接iDevice启动App服务器,然后我才能再次通过Wi-Fi运行Calabash测试。

我曾尝试使用许多不同的iDevices和不同的Wi-Fi接入点,以及几款Mac,但没有运气可以为所有测试提供一个坚实的不间断运行。

如果有人帮我解决这个令人难以置信的讨厌问题,那会很高兴。

一些细节:

  • iOS版:8.1.3,8.2
  • XCode版本:6.2
  • Mac OS版本:10.10.2
  • Xcode路径:/Applications/Xcode.app/Contents/Developer
  • Calabash版本:0.13.0(和0.14.0)
  • calabash.framework版本:0.13.0(和0.14.0)
  • 当发生'hang'时,这是控制台输出(DEBUG = 1):
@test
Scenario: [12657] Scenario Name # features/2_feature_name.feature:87

INFO: Using uia strategy: 'host'
Preparation took 0.099263 seconds
{
                        :app => "com.xxx.one",
                       :args => [],
    :bundle_dir_or_bundle_id => "com.xxx.one",
                  :bundle_id => "com.xxx.one",
                     :device => "com.xxx.one",
              :device_target => "00fea94be88909c74aa7b68a2b7f3f339407163b",
              :launch_method => :instruments,
             :launch_retries => 5,
                   :log_file => "/var/folders/4w/tw3_yvd54sq9brl1kxf9cy8c0000gp/T/run_loop20150408-59711-1rjd4d1/run_loop.out",
                  :no_launch => false,
                    :no_stop => false,
                      :reset => false,
                :results_dir => "/var/folders/4w/tw3_yvd54sq9brl1kxf9cy8c0000gp/T/run_loop20150408-59711-1rjd4d1",
          :results_dir_trace => "/var/folders/4w/tw3_yvd54sq9brl1kxf9cy8c0000gp/T/run_loop20150408-59711-1rjd4d1/trace",
                     :script => "/var/folders/4w/tw3_yvd54sq9brl1kxf9cy8c0000gp/T/run_loop20150408-59711-1rjd4d1/_run_loop.js",
                :sdk_version => nil,
                       :udid => "00fea94be88909c74aa7b68a2b7f3f339407163b",
               :uia_strategy => :host,
                      :xcode => "6.2",
                 :xcode_path => "/Applications/Xcode.app/Contents/Developer"
}

### Starting on 00fea94be88909c74aa7b68a2b7f3f339407163b App: com.xxx.one ###
2015-04-08 12:38:22 +0300 xcrun instruments -w 00fea94be88909c74aa7b68a2b7f3f339407163b -D /var/folders/4w/tw3_yvd54sq9brl1kxf9cy8c0000gp/T/run_loop20150408-59711-1rjd4d1/trace -t Automation com.dxo.one -e UIARESULTSPATH /var/folders/4w/tw3_yvd54sq9brl1kxf9cy8c0000gp/T/run_loop20150408-59711-1rjd4d1 -e UIASCRIPT /var/folders/4w/tw3_yvd54sq9brl1kxf9cy8c0000gp/T/run_loop20150408-59711-1rjd4d1/_run_loop.js >& /var/folders/4w/tw3_yvd54sq9brl1kxf9cy8c0000gp/T/run_loop20150408-59711-1rjd4d1/run_loop.out 

更新:以下是Calabash打印到终端的时候,它无法在应用程序卡住后重新启动应用程序:

    Calabash::Cucumber::Launcher::StartError: Time out waiting for UIAutomation run-loop Error while writing to fifo. RunLoop::Fifo::NoReaderConfiguredError. 
      Logfile /var/folders/4w/tw3_yvd54sq9brl1kxf9cy8c0000gp/T/run_loop20150422-35789-1mgrom1/run_loop.out 

      2015-04-22 11:03:41.649 instruments[35913:114217] WebKit Threading Violation - initial use of WebKit from a secondary thread.
     Instruments Trace Error : Target failed to run: Failed looking up pid of launched process

      (Calabash::Cucumber::Launcher::StartError)
     /Users/wrathttodd/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/calabash-cucumber-0.14.0/lib/calabash-cucumber/launcher.rb:772:in `new_run_loop'
     /Users/wrathttodd/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/calabash-cucumber-0.14.0/lib/calabash-cucumber/launcher.rb:630:in `relaunch'
     /Users/wrathttodd/APP NAME/PATH/AAT/features/support/01_launch.rb:27:in `Before'

0 个答案:

没有答案