Class: Maze::Client::Appium::BitBarClient
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
# File 'lib/maze/client/appium/bb_client.rb', line 60
def device_capabilities
config = Maze.config
common_caps = {
'noReset' => true,
'newCommandTimeout' => 600
}
capabilities = {
'bitbar:options' => {
'apiKey' => config.access_key,
'app' => config.app,
'findDevice' => false,
'testTimeout' => 7200
}
}
if Maze.config.appium_version && Maze.config.appium_version.to_f < 2.0
capabilities.merge!(common_caps)
else
capabilities['appium:options'] = common_caps
end
capabilities.deep_merge! BitBarClientUtils.dashboard_capabilities
capabilities.deep_merge! BitBarDevices.get_available_device(config.device)
capabilities['bitbar:options']['appiumVersion'] = config.appium_version unless config.appium_version.nil?
capabilities.deep_merge! JSON.parse(config.capabilities_option)
capabilities
end
|
#handle_error(error) ⇒ Object
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/maze/client/appium/bb_client.rb', line 16
def handle_error(error)
return nil if error.nil?
interval = nil
notify = true
if error.message.include? 'no sessionId in returned payload'
interval = 60
notify = false
elsif error.message.include? 'You reached the account concurrency limit'
interval = 300
elsif error.message.include? 'There are no devices available'
interval = 120
elsif error.message.include? 'Appium Settings app is not running'
interval = 10
elsif error.message.include? 'Could not proxy command to the remote server'
interval = 10
elsif error.message.include? 'Could not find a connected Android device'
interval = 10
elsif error.message.include? '\'platformVersion\' must be a valid version number.'
interval = 10
else
end
Bugsnag.notify error if notify
interval
end
|
#log_run_intro ⇒ Object
87
88
89
|
# File 'lib/maze/client/appium/bb_client.rb', line 87
def log_run_intro
end
|
#log_run_outro ⇒ Object
91
92
93
94
95
96
97
98
99
|
# File 'lib/maze/client/appium/bb_client.rb', line 91
def log_run_outro
api_client = BitBarApiClient.new(Maze.config.access_key)
$logger.info 'Appium session(s) created:'
@session_ids.each do |id|
link = api_client.get_device_session_ui_link(id)
$logger.info Maze::Loggers::LogUtil.linkify(link, "BitBar session: #{id}") if link
end
end
|
#prepare_session ⇒ Object