From a1b7e454be2f0b842bf8427f23ddb73664cb5d85 Mon Sep 17 00:00:00 2001 From: Thomas Walpole Date: Thu, 5 Apr 2018 09:18:55 -0700 Subject: [PATCH] Add specific gemfile for appveyor ie testing --- Gemfile | 1 - appveyor.yml | 1 + gemfiles/Gemfile.beta-versions | 2 +- gemfiles/Gemfile.edge-marionette | 2 +- gemfiles/Gemfile.ie | 6 ++++++ gemfiles/Gemfile.rspec-34 | 2 +- lib/capybara/node/actions.rb | 2 +- lib/capybara/selenium/driver.rb | 4 ++-- spec/selenium_spec_ie.rb | 6 +++--- 9 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 gemfiles/Gemfile.ie diff --git a/Gemfile b/Gemfile index 6ab994dd..f36e7393 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,6 @@ gem 'bundler', '~> 1.1' gemspec gem 'xpath', git: 'git://github.com/teamcapybara/xpath.git' -gem 'webdrivers', git: 'git://github.com/hron/webdrivers', branch: 'iedriver-sorting-fix' if ENV['CI'] group :doc do gem 'redcarpet', platforms: :mri diff --git a/appveyor.yml b/appveyor.yml index 1a6fb551..b9c2a4cf 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,6 +9,7 @@ environment: CAPYBARA_FF: true - RUBY_VERSION: 25 CAPYBARA_IE: true + BUNDLE_GEMFILE: gemfiles/Gemfile.ie - RUBY_VERSION: 22 matrix: diff --git a/gemfiles/Gemfile.beta-versions b/gemfiles/Gemfile.beta-versions index 3aed1438..f76cacbe 100644 --- a/gemfiles/Gemfile.beta-versions +++ b/gemfiles/Gemfile.beta-versions @@ -1,7 +1,7 @@ source "https://rubygems.org" gem 'bundler', '~> 1.1' -gemspec :path => '..' +gemspec path: '..' gem 'pkg-config' # needed by nokogiri gem 'xpath', github: 'teamcapybara/xpath' diff --git a/gemfiles/Gemfile.edge-marionette b/gemfiles/Gemfile.edge-marionette index 301beec5..288de3c8 100644 --- a/gemfiles/Gemfile.edge-marionette +++ b/gemfiles/Gemfile.edge-marionette @@ -1,7 +1,7 @@ source "https://rubygems.org" gem 'bundler', '~> 1.1' -gemspec :path => '..' +gemspec path: '..' gem 'xpath', github: 'teamcapybara/xpath' diff --git a/gemfiles/Gemfile.ie b/gemfiles/Gemfile.ie new file mode 100644 index 00000000..ac76983e --- /dev/null +++ b/gemfiles/Gemfile.ie @@ -0,0 +1,6 @@ +source 'https://rubygems.org' + +gem 'bundler', '~> 1.1' +gemspec path: '..' + +gem 'webdrivers', git: 'git://github.com/hron/webdrivers', branch: 'iedriver-sorting-fix' if ENV['CI'] diff --git a/gemfiles/Gemfile.rspec-34 b/gemfiles/Gemfile.rspec-34 index d4886d82..b75d5652 100644 --- a/gemfiles/Gemfile.rspec-34 +++ b/gemfiles/Gemfile.rspec-34 @@ -1,7 +1,7 @@ source 'https://rubygems.org' gem 'bundler', '~> 1.1' -gemspec :path => '..' +gemspec path: '..' gem 'xpath', github: 'teamcapybara/xpath' gem 'rspec', '~>3.4.0' diff --git a/lib/capybara/node/actions.rb b/lib/capybara/node/actions.rb index 147aca5d..0b86cef2 100644 --- a/lib/capybara/node/actions.rb +++ b/lib/capybara/node/actions.rb @@ -266,7 +266,7 @@ module Capybara el ||= find(selector, locator, options.merge(visible: :all)) res = find(:label, for: el, visible: true).click unless el.checked? == checked res - rescue => e2 # swallow extra errors - raise original + rescue # swallow extra errors - raise original raise e end end diff --git a/lib/capybara/selenium/driver.rb b/lib/capybara/selenium/driver.rb index f7b0f29e..76261d1c 100644 --- a/lib/capybara/selenium/driver.rb +++ b/lib/capybara/selenium/driver.rb @@ -272,8 +272,8 @@ class Capybara::Selenium::Driver < Capybara::Driver::Base ::Selenium::WebDriver::Error::InvalidElementStateError, ::Selenium::WebDriver::Error::ElementNotSelectableError, ::Selenium::WebDriver::Error::ElementNotSelectableError, - ::Selenium::WebDriver::Error::NoSuchElementError, # IE - ::Selenium::WebDriver::Error::InvalidArgumentError #IE + ::Selenium::WebDriver::Error::NoSuchElementError, # IE + ::Selenium::WebDriver::Error::InvalidArgumentError # IE ] end diff --git a/spec/selenium_spec_ie.rb b/spec/selenium_spec_ie.rb index 3e2a74e6..bde754d3 100644 --- a/spec/selenium_spec_ie.rb +++ b/spec/selenium_spec_ie.rb @@ -8,9 +8,9 @@ require 'rspec/shared_spec_matchers' Capybara.register_driver :selenium_ie do |app| # ::Selenium::WebDriver.logger.level = "debug" Capybara::Selenium::Driver.new( - app, - browser: :ie, - desired_capabilities: ::Selenium::WebDriver::Remote::Capabilities.ie('requireWindowFocus': true) + app, + browser: :ie, + desired_capabilities: ::Selenium::WebDriver::Remote::Capabilities.ie('requireWindowFocus': true) ) end