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
Touch API #1289
base: master
Are you sure you want to change the base?
Touch API #1289
Conversation
I'd like to suggest additional swipe methods: swipe_left, swipe_right, swipe_up, swipe_down or maybe as swipe(:left), swipe(:down) etc. |
end | ||
|
||
def long_press | ||
#driver.browser.touch.long_press(native).perform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be uncommented. I think you commented it because Android driver doesn't support long_press
currenly (https://github.com/appium/appium/blob/463e692c7bb7c38dc1a95319aaa6c95ba986bed7/lib/devices/android/android-controller.js#L1042)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's commented because it didn't work, so I manually did the long press with a delay
|
@carhartl yeah, the question there is just how far (in px) is a 'swipe' -- the flick currently is just set to a fast 200px swipe right, not really sure what makes sense for defaults on something like that. Should swipe replace flick, or is a flick a fast swipe and should remain (so we would have swipe(:left) and flick(:left) ), etc? |
What is the difference between |
I've just filed https://www.w3.org/Bugs/Public/show_bug.cgi?id=25293 as Webdriver spec doesn't define a way to set speed/duration of However, I don't understand the difference between |
@abotalov - speed -- webdriver does support a speed for the flick (the ruby selenium-webdriver has :fast and :normal) -- a slower flick would be what most people would call a swipe I believe -- I don't know if it makes sense to have the two as separate methods, or pass a parameter, or just not worry about speed |
The part about speed is currently missing in Webdriver spec so when it will appear there may be API breakage in Selenium 3. So I would prefer to provide a single method without saying in documentation if it's fast or not. Maybe it would be Appium provides a much more robust API than Webdriver language bindings currently provide. I think swipe vs flick situation and other disputable API decisions should be handled upstream. |
I don't like I think it would be better to name this method I'm fine with adding |
directions = if args.last.is_a?(Hash) then args.pop else {} end | ||
directions.default = 0 | ||
args.each { |arg| directions[arg] = 200 } | ||
x = directions[:right] - directions[:left] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by :left
, :right
, :down
, :up
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its the direction of swipe
@abotalov - the issue with tap is that it would be overriding Object#tap with a function that is completely different - that might be a surprise to some people |
|
||
## | ||
# | ||
# Sinlge tap on the Element |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
pulling in @jonleighton @mhoran @jferris @jcoglan , if any of you are planning on implementing touch methods do you have any feedback on this? |
QtWebKit supports touch events (and seems to have them on by default, even on non-mobile clients), so I think this should be fine in capybara-webkit. I know some users are using them now by just sending the events manually. I'm not sure when I'll be able to go through and implement the new API, though. |
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, |
Touch API to get this moving forward