lib/calabash-android/operations.rb in calabash-android-0.7.3.preintentstart5 vs lib/calabash-android/operations.rb in calabash-android-0.7.3
- old
+ new
@@ -137,12 +137,12 @@
def push(local, remote)
default_device.push(local, remote)
end
- def start_test_server_in_background(options={}, &block)
- default_device.start_test_server_in_background(options, &block)
+ def start_test_server_in_background(options={})
+ default_device.start_test_server_in_background(options)
end
def shutdown_test_server
default_device.shutdown_test_server
end
@@ -635,20 +635,20 @@
def push(local, remote)
cmd = "#{adb_command} push #{local} #{remote}"
raise "Could not push #{local} to #{remote}" unless system(cmd)
end
- def start_test_server_in_background(options={}, &block)
+ def start_test_server_in_background(options={})
raise "Will not start test server because of previous failures." if ::Cucumber.wants_to_quit
if keyguard_enabled?
wake_up
end
- env_options = options.clone
- env_options.delete(:intent)
+ env_options = options
+ env_options[:target_package] ||= package_name(@app_path)
env_options[:main_activity] ||= main_activity(@app_path)
env_options[:test_server_port] ||= @test_server_port
env_options[:class] ||= "sh.calaba.instrumentationbackend.InstrumentationBackend"
cmd_arr = [adb_command, "shell am instrument"]
@@ -717,27 +717,13 @@
raise msg_s
end
log("Client and server versions match (client: #{client_version}, server: #{server_version}). Proceeding...")
- block.call if block
-
- start_application(options[:intent])
-
# What is Calabash tracking? Read this post for information
# No private data (like ip addresses) are collected
# https://github.com/calabash/calabash-android/issues/655
Calabash::Android::UsageTracker.new.post_usage_async
- end
-
- def start_application(intent)
- result = JSON.parse(http("/start-application", {intent: intent.to_json}))
-
- if result['outcome'] != 'SUCCESS'
- raise result['detail']
- end
-
- result['result']
end
def shutdown_test_server
begin
http("/kill")