Skip to content

Commit

Permalink
Fix IE capability passing and click modifier tests
Browse files Browse the repository at this point in the history
  • Loading branch information
twalpole committed Aug 30, 2018
1 parent 0666316 commit be8bed8
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ addons:
- google-chrome-beta
- awesome

branches:
except:
- /^ie_/

cache:
bundler: true
directories:
Expand Down
39 changes: 37 additions & 2 deletions spec/selenium_spec_ie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@

Capybara.register_driver :selenium_ie do |app|
# ::Selenium::WebDriver.logger.level = "debug"
options = ::Selenium::WebDriver::IE::Options.new
options.require_window_focus = true
Capybara::Selenium::Driver.new(
app,
browser: :ie,
desired_capabilities: ::Selenium::WebDriver::Remote::Capabilities.ie('requireWindowFocus': true)
desired_capabilities: ::Selenium::WebDriver::Remote::Capabilities.ie,
options: options
)
end

Expand All @@ -33,7 +36,15 @@ module TestSessions
when /#fill_in with Date /
pending "IE 11 doesn't support date input types"
when /#click_link_or_button with :disabled option happily clicks on links which incorrectly have the disabled attribute$/
pending 'IE 11 obeys non-standard disabled attribute on anchor tag'
skip 'IE 11 obeys non-standard disabled attribute on anchor tag'
when /#right_click should allow modifiers$/
skip "Windows can't :meta click because :meta triggers start menu"
when /#click should allow multiple modifiers$/
skip "Windows can't :meta click because :meta triggers start menu"
when /#double_click should allow multiple modifiers$/
skip "Windows can't :alt double click due to being properties shortcut"
when /via clicking the wrapping label if possible$/
pending "IEDriver has an issue with the click location of elements with multiple children if the first child is a text node and the page is scrolled"
end
end

Expand All @@ -42,3 +53,27 @@ module TestSessions
include_examples 'Capybara::Session', TestSessions::SeleniumIE, :selenium_ie
include_examples Capybara::RSpecMatchers, TestSessions::SeleniumIE, :selenium_ie
end

RSpec.describe Capybara::Selenium::Node do
it '#right_click should allow modifiers' do
session = TestSessions::SeleniumIE
session.visit('/with_js')
session.find(:css, '#click-test').right_click(:control)
expect(session).to have_link('Has been control right clicked')
end

it '#click should allow multiple modifiers' do
session = TestSessions::SeleniumIE
session.visit('with_js')
# IE triggers system behavior with :meta so can't use those here
session.find(:css, '#click-test').click(:ctrl, :shift, :alt)
expect(session).to have_link('Has been alt control shift clicked')
end

it '#double_click should allow modifiers' do
session = TestSessions::SeleniumIE
session.visit('/with_js')
session.find(:css, '#click-test').double_click(:shift)
expect(@session).to have_link('Has been shift double clicked')
end
end

0 comments on commit be8bed8

Please sign in to comment.