-
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
Add Node#Send keys to standardize usage across drivers #1472
Conversation
# element.send_keys [:control, 'a'], :space #=> value: ' ' | ||
# | ||
# Symbols supported for keys | ||
# :null |
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.
trailing space
There are a few keys that we can't send in capybara-webkit :left_shift
:left_control
:left_alt
:arrow_left
:arrow_up
:arrow_right
:arrow_down
:separator
:decimal
:command There is no differentiation between shift and left shift, control and left control, or alt and left alt in Qt. We only have left, up, right, and down mappings, but nothing corresponding to "arrow". Is Command is not a cross-platform key, so it is not supported by Qt. On OS X, Finally, what should |
@mhoran - The list of symbols is what selenium understands :separator is the numeric keypad "seperator" key (different from the :decimal key) - the keycode is 108 and I'm guessing its a key returned by non-english keyboards although I can't find info that specifically states that. :null - appears to be used in lower level key routines in selenium to trigger release of all modifier keys. It is probably not needed for this so I'm removing it from the list |
I'm guessing that if we just sent shift, control, and alt, that would be least surprising to users. Same goes for up/arrow_up. |
@jferris I have removed the arrow_x and left_x aliases from the list of required supported key symbols - For future info DOM Level 3 does support identifying left vs right instances of shift, alt, control via the location attribute of a KeyboardEvent however not all browsers support it at the moment https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent.location and selenium doesn't currently provide a way to set it, so we may have to revisit left_shift, right_shift, etc in the future |
Add Capybara::Node::Element#send_keys to standardize usage across drivers, and support in selenium driver
Implementation of item discussed in Issue #1459 - @jferris @jonleighton @mhoran Thoughts on implementing this in your drivers for Capybara 2.5 ?