Skip to content

Commit

Permalink
Avoid testing control+shift+click in Firefox
Browse files Browse the repository at this point in the history
When the shift key is pressed, Firefox doesn't generate a JavaScript
event for a context click.

See: https://bugzilla.mozilla.org/show_bug.cgi?id=692139
  • Loading branch information
elliterate committed Jul 3, 2018
1 parent 91add54 commit 931bb56
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/capybara/spec/session/node_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@
end

it "should allow multiple modifiers", requires: [:js] do
pending "Firefox doesn't generate an event for shift+control+click" if marionette_gte?(62, @session)
@session.visit('with_js')
@session.find(:css, '#click-test').click(:control, :alt, :meta, :shift)
# Selenium with Chrome on OSX ctrl-click generates a right click so just verify all keys but not click type
Expand Down
8 changes: 8 additions & 0 deletions spec/selenium_spec_marionette.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,5 +163,13 @@ def extract_results(session)
tr.click
expect(tr.base).to have_received(:warn).with(/Clicking the first cell in the row instead/)
end

it "should allow multiple modifiers", requires: [:js] do
session = TestSessions::SeleniumMarionette
session.visit('with_js')
# Firefox doesn't generate an event for control+shift+click
session.find(:css, '#click-test').click(:alt, :ctrl, :meta)
expect(session).to have_link("Has been alt control meta clicked")
end
end
end

0 comments on commit 931bb56

Please sign in to comment.