Module: KrakenMobile::CalabashAndroid::Operations

Included in:
Runner::MonkeyRunner
Defined in:
lib/kraken-mobile/runners/calabash/android/operations.rb

Instance Method Summary collapse

Instance Method Details

#channel_to_device_id(channel) ⇒ Object

helpers



32
33
34
35
36
37
38
39
40
41
# File 'lib/kraken-mobile/runners/calabash/android/operations.rb', line 32

def channel_to_device_id channel
  begin
    formatted_channel = channel.tr("@user", "")
    device_position = formatted_channel.to_i - 1
    devices_manager = DevicesHelper::Manager.new({runner: ENV["RUNNER"], config_path: ENV["CONFIG_PATH"]})
    devices_manager.connected_devices[device_position].id
  rescue
    nil
  end
end

#install_app_with_calabashObject



6
7
8
9
10
# File 'lib/kraken-mobile/runners/calabash/android/operations.rb', line 6

def install_app_with_calabash
  operations_module = Calabash::Android::Operations
  default_device = operations_module::Device.new(operations_module, ENV["ADB_DEVICE_ARG"], ENV["TEST_SERVER_PORT"], ENV["APP_PATH"], ENV["TEST_APP_PATH"])
  default_device.ensure_apps_installed
end

#shutdown_kraken_test_server(scenario) ⇒ Object



25
26
27
28
29
# File 'lib/kraken-mobile/runners/calabash/android/operations.rb', line 25

def shutdown_kraken_test_server scenario
  channel = @scenario_tags.grep(/@user/).first
  end_setup channel, scenario
  shutdown_test_server
end

#start_kraken_test_server_in_background(scenario) ⇒ Object



19
20
21
22
23
# File 'lib/kraken-mobile/runners/calabash/android/operations.rb', line 19

def start_kraken_test_server_in_background scenario
  channel = @scenario_tags.grep(/@user/).first
  start_test_server_in_background
  start_setup(channel, scenario)
end

#uninstall_app_with_calabashObject



12
13
14
15
16
17
# File 'lib/kraken-mobile/runners/calabash/android/operations.rb', line 12

def uninstall_app_with_calabash
  operations_module = Calabash::Android::Operations
  default_device = operations_module::Device.new(operations_module, ENV["ADB_DEVICE_ARG"], ENV["TEST_SERVER_PORT"], ENV["APP_PATH"], ENV["TEST_APP_PATH"])
  default_device.uninstall_app(package_name(default_device.test_server_path))
  default_device.uninstall_app(package_name(default_device.app_path))
end