lib/scoutui/commands/strategy.rb in scoutui-2.0.3.7.pre vs lib/scoutui/commands/strategy.rb in scoutui-2.0.3.8.pre

- old
+ new

@@ -151,27 +151,36 @@ tmpCaps = caps if caps.has_key?(:browser) && caps[:browser].match(/edge/i) Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Capabilities[browser] : EDGE" - caps = Selenium::WebDriver::Remote::Capabilities.edge() + + + # https://support.saucelabs.com/customer/portal/questions/16217472-microsoft-edge-ruby-bindings + if caps.has_key?(:browserName) + Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Ruby bindings workaround for Edge" + caps={} + else + caps = Selenium::WebDriver::Remote::Capabilities.edge() + end + + elsif caps.has_key?(:browser) && caps[:browser].match(/chrome/i) caps = Selenium::WebDriver::Remote::Capabilities.chrome() elsif caps.has_key?(:browser) && caps[:browser].match(/firefox/i) caps = Selenium::WebDriver::Remote::Capabilities.firefox() else caps = Selenium::WebDriver::Remote::Capabilities.internet_explorer() end - tmpCaps.each_pair do |k, v| Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " caps[#{k.to_s}] = #{v}" caps[k.to_s]=v end - Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Remote Caps => #{caps}" + Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Remote Caps => #{caps.to_s}" elsif caps.has_key?(:deviceName) && caps[:deviceName].match(/(iphone|ipad)/i) && !caps[:deviceName].match(/simulator/i) caps = Selenium::WebDriver::Remote::Capabilities.iphone() caps['platform'] = 'OS X 10.10' caps['version'] = '9.1' @@ -211,11 +220,16 @@ sauce_endpoint = "http://#{ENV['SAUCE_USERNAME']}:#{ENV['SAUCE_ACCESS_KEY']}@ondemand.saucelabs.com:80/wd/hub" caps[:name]=Scoutui::Utils::TestUtils.instance.getSauceName() caps[:tags]=[caps[:name], "ScoutUI"] + if !Scoutui::Utils::TestUtils.instance.getSauceBuild().nil? + caps[:build] = Scoutui::Utils::TestUtils.instance.getSauceBuild() + end + begin if client.nil? + puts __FILE__ + (__LINE__).to_s + " caps => #{caps}" @drv=Selenium::WebDriver.for :remote, :url => sauce_endpoint, :desired_capabilities => caps # setup(caps) else @drv=Selenium::WebDriver.for :remote, :url => sauce_endpoint, :http_client => client, :desired_capabilities => caps # setup(caps) end