5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/maze/client/selenium/bb_client.rb', line 5
def start_session
config = Maze.config
capabilities = ::Selenium::WebDriver::Remote::Capabilities.new
capabilities['bitbar_apiKey'] = config.access_key
browsers = YAML.safe_load(File.read("#{__dir__}/bb_browsers.yml"))
capabilities.merge! BitBarClientUtils.dashboard_capabilities
capabilities['version'] = config.browser_version unless config.browser_version.nil?
capabilities.merge! browsers[config.browser]
capabilities.merge! JSON.parse(config.capabilities_option)
capabilities['bitbar:options']['testTimeout'] = 900
capabilities['acceptInsecureCerts'] = true unless Maze.config.browser.include? 'ie_'
config.capabilities = capabilities
if Maze::Client::BitBarClientUtils.use_local_tunnel?
capabilities['bitbar_apiKey'] = config.access_key
Maze::Client::BitBarClientUtils.start_local_tunnel config.sb_local,
config.username,
config.access_key
end
selenium_url = Maze.config.selenium_server_url
$logger.trace "Starting Selenium driver with capabilities: #{config.capabilities.to_json}"
Maze.driver = Maze::Driver::Browser.new :remote, selenium_url, config.capabilities
Maze.driver.start_driver
end
|