Class: Maze::Client::Appium::BrowserStackClient
Constant Summary
Constants inherited
from BaseClient
Maze::Client::Appium::BaseClient::FIXTURE_CONFIG
Instance Method Summary
collapse
Methods inherited from BaseClient
#attempt_start_driver, #initialize, #maze_address, #retry_start_driver?, #start_driver, #start_session
Instance Method Details
#device_capabilities ⇒ Object
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
# File 'lib/maze/client/appium/bs_client.rb', line 44
def device_capabilities
config = Maze.config
capabilities = {
'app' => config.app,
'deviceOrientation' => 'portrait',
'noReset' => 'true',
'bstack:options' => {}
}
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['bstack:options']['appiumVersion'] = config.appium_version unless config.appium_version.nil?
unless device_caps['platformName'] == 'android' && device_caps['platformVersion'].to_i <= 6
capabilities['bstack:options']['disableAnimations'] = 'true'
end
if Maze.config.start_tunnel
capabilities['bstack:options']['local'] = 'true'
capabilities['bstack:options']['localIdentifier'] = Maze.run_uuid
end
capabilities
end
|
#handle_error(error) ⇒ Object
On BrowserStack, wait 10 seconds before retrying if there is another device in the list
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/maze/client/appium/bs_client.rb', line 19
def handle_error(error)
Bugsnag.notify error unless error.nil?
config = Maze.config
if config.device_list.nil? || config.device_list.empty?
$logger.error 'No further devices to try'
nil
else
config.device = config.device_list.first
config.device_list = config.device_list.drop(1)
$logger.warn "Retrying driver initialisation using next device: #{config.device}"
10
end
end
|
#log_run_intro ⇒ Object
68
69
70
71
72
|
# File 'lib/maze/client/appium/bs_client.rb', line 68
def log_run_intro
url = "https://app-automate.browserstack.com/dashboard/v2/search?query=#{Maze.run_uuid}&type=builds"
$logger.info Maze::Loggers::LogUtil.linkify(url, 'BrowserStack session(s)')
end
|
#log_run_outro ⇒ Object
74
75
76
77
78
|
# File 'lib/maze/client/appium/bs_client.rb', line 74
def log_run_outro
$logger.info 'Appium session(s) created:'
@session_ids.each { |id| $logger.info " #{id}" }
log_run_intro
end
|
#prepare_session ⇒ Object