-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API proposal/discussion for touch platform interactions #803
Comments
It sounds reasonable enough to me. The method names are descriptive and fit their purpose. I'm for it! |
Cool! So would I add these methods as follows? # Capybara::Driver::Node
def single_tap
raise NotSupportedByDriverError
end # Capybara::Node::Element
def single_tap
synchronize { base.single_tap }
end |
Yes exactly. It would make sense to add tests for them as well. This might be a bit tricky, obviously since none of the drivers in Capybara itself support it. |
I am thinking: For |
The ideal solution, imo would be to have tests for the actual implementation in the Capybara suite. Selenium and RackTest could exclude those tests from their own suites. |
Did this ever get made? I'd be interested in contributing to Capybara to help create this API |
@MITDelian unfortunately, no. If you'd like to help, that'd be great. |
This would be very helpful 👍 |
I've started implementation of a touch api in pr #1289 - currently there are 4 methods single_tap, double_tap, long_press, flick (based on element specific touch methods selenium webdriver provides) -- I'm not sure what useful parameters to flick should be, so feedback is definitely welcome, as are suggestions for any other methods we should have. Please add suggestions/comments over in #1289. I've also added testing of them against android via saucelabs, won't work here yet due to the secure env vars being set for my repo but I'll get them fixed up at some point. |
Closing this as discussion should move over to pr #1289 |
Hey, there's this gem I have developed that adds touch gestures support to Capybara. Take a look at https://github.com/Ricardonacif/touch_action . Thanks, |
Little bit of background: For a touch platform only web app we're building we're using Capybara for acceptance tests, along with a js driver that is touch capable (now poltergeist, before capybara-webkit - basically any recent webkit based driver supporting touch events could be used). We're not using any click interactions at all, thus I needed to make the capybara js driver touch capable.
Here's a pull request I sent to poltergeist
https://github.com/jonleighton/poltergeist/pull/135/files
which contains an initial implementation, so far only for simple, single taps:
e.g.
@jonleighton in response asked me to start a discussion here as to (hopefully) agree on an API that could be implemented by any capable driver. See teampoltergeist/poltergeist#141
I had further methods in mind to be implement later, just as a proposal:
single_tap
double_tap
long_tap
swipe_left
swipe_right
swipe_up
swipe_down
(The names follow what Zepto.js provides for touch event abstractions.) There are also gesture events I didn't yet think about.
I'd be glad if we could get a discussion going about this and happily help with the implementation whenever required.
[Edit: swipe_bottom -> swipe_down]
The text was updated successfully, but these errors were encountered: