Add double_click and right_click to element - support in selenium #1079

Merged
merged 1 commit into from Nov 26, 2013

Conversation

Projects
None yet
6 participants
Collaborator

twalpole commented May 10, 2013

This adds double_click and right_click to the Node API with tests and support for Selenium

Collaborator

twalpole commented May 10, 2013

One question here is whether it should be right_click or context_click -- Selenium uses context_click, however I went with the everyday use of right_click - easy change if desired (or maybe change the definition to context_click and alias right_click to it?)

buob commented Oct 7, 2013

Is there a reason this hasn't been merged?

Contributor

TimMoore commented Nov 26, 2013

This would be really useful. I hope it can be included in Capybara 2.3.

Collaborator

jnicklas commented Nov 26, 2013

I don't think there's any reason at all this hasn't been merged, except my own inattentiveness. It took two reminders to push me to get to this, as I was reading through the list of issues when preparing 2.2, I somehow though of this as a feature request. Pull request looks good, and I like right_click better than context_click.

@jnicklas jnicklas added a commit that referenced this pull request Nov 26, 2013

@jnicklas jnicklas Merge pull request #1079 from twalpole/double_click
Add double_click and right_click to element - support in selenium
081aba7

@jnicklas jnicklas merged commit 081aba7 into teamcapybara:master Nov 26, 2013

1 check failed

default The Travis CI build could not complete due to an error
Details
Contributor

TimMoore commented Nov 26, 2013

Thank you! 😀

Can this be included in a 2.3 release? It's been on master for quite a long time.

@fabianoalmeida fabianoalmeida commented on the diff Mar 27, 2014

lib/capybara/spec/session/node_spec.rb
@@ -185,6 +185,22 @@
@session.find(:css, '.hidden_until_hover', :visible => false).should be_visible
end
end
+
+ describe '#double_click', :requires => [:js] do
+ it "should double click an element" do
+ @session.visit('/with_js')
+ @session.find(:css, '#click-test').double_click
+ @session.find(:css, '#has-been-double-clicked').should be
+ end
+ end
+
+ describe '#right_click', :requires => [:js] do
+ it "should double click an element" do
@fabianoalmeida

fabianoalmeida Mar 27, 2014

double click or right click? 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment