Class: Maze::Client::Appium::BrowserStackLegacyClient

Inherits:
BrowserStackClient show all
Defined in:
lib/maze/client/appium/bs_legacy_client.rb

Constant Summary

Constants inherited from BaseClient

Maze::Client::Appium::BaseClient::FIXTURE_CONFIG

Instance Method Summary collapse

Methods inherited from BrowserStackClient

#handle_error, #log_run_intro, #log_run_outro, #prepare_session, #start_scenario, #stop_session

Methods inherited from BaseClient

#attempt_start_driver, #handle_error, #initialize, #log_run_intro, #log_run_outro, #maze_address, #prepare_session, #retry_start_driver?, #start_driver, #start_scenario, #start_session, #stop_session

Constructor Details

This class inherits a constructor from Maze::Client::Appium::BaseClient

Instance Method Details

#device_capabilitiesObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/maze/client/appium/bs_legacy_client.rb', line 5

def device_capabilities
  config = Maze.config
  capabilities = {
    'app' => config.app,
    'browserstack.console' => 'errors',
    'deviceOrientation' => 'portrait',
    'noReset' => 'true'
  }
  device_caps = Maze::Client::Appium::BrowserStackDevices::DEVICE_HASH[config.device]
  capabilities.deep_merge! device_caps
  capabilities.deep_merge! JSON.parse(config.capabilities_option)
  capabilities.merge! project_name_capabilities
  capabilities['browserstack.appium_version'] = config.appium_version unless config.appium_version.nil?
  unless device_caps['platformName'] == 'android' && device_caps['platformVersion'].to_i <= 6
    capabilities['disableAnimations'] = 'true'
  end
  if Maze.config.start_tunnel
    capabilities['browserstack.localIdentifier'] = Maze.run_uuid
    capabilities['browserstack.local'] = 'true'
  end

  capabilities
end