lib/calabash-android/operations.rb in calabash-android-0.3.6 vs lib/calabash-android/operations.rb in calabash-android-0.3.7

- old
+ new

@@ -165,11 +165,11 @@ log "Uninstalling: #{package_name}" log `#{adb_command} uninstall #{package_name}` end def app_running? - `#{adb_command} shell ps`.include?(package_name(@app_path)) + `#{adb_command} shell ps`.include?(ENV["PROCESS_NAME"] || package_name(@app_path)) end def keyguard_enabled? dumpsys = `#{adb_command} shell dumpsys window windows` #If a line containing mCurrentFocus and Keyguard exists the keyguard is enabled @@ -308,10 +308,12 @@ cmd = "#{adb_command} shell am instrument -e target_package #{ENV["PACKAGE_NAME"]} -e main_activity #{ENV["MAIN_ACTIVITY"]} -e class sh.calaba.instrumentationbackend.InstrumentationBackend sh.calaba.android.test/sh.calaba.instrumentationbackend.CalabashInstrumentationTestRunner" log "Starting test server using:" log cmd raise "Could not execute command to start test server" unless system("#{cmd} 2>&1") - raise "App did not start" unless app_running? + retriable :tries => 10, :interval => 1 do + raise "App did not start" unless app_running? + end begin retriable :tries => 10, :interval => 3 do log "Checking if instrumentation backend is ready"