Repository navigation
feat(node): support clear: in set and warn about unsupported options - #378
Merged
Merged
Conversation
clear: works like Selenium's: :none appends, :backspace deletes the value with Backspace, an Array of keys is pressed before typing, and an unknown value raises ArgumentError. The caret moves to the end with End in inputs and setSelectionRange in textareas, where End only reaches the end of the line. Options other than rapid: and clear: warn again, as before real key presses; those two stay silent on fields that don't use them, so default_set_options doesn't warn on every checkbox.
This was referenced Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #307. Follows #377, which made text fields use real key presses.
clear:works like Capybara's Selenium node, for text inputs and textareas:clear:rapid:appliesnil(default):none:backspaceArgumentErrorDifferences from Selenium:
setSelectionRange, because End only reaches the end of the current line. Inputs press End, sincetype="email"doesn't supportsetSelectionRange.:none,:backspaceor an Array runs only the clearing step.clear:value raises instead of acting likenil.#377 dropped the warning for options Cuprite ignores. It's back for any option other than
rapid:andclear:, naming them. Those two stay silent on fields that don't use them, soCapybara.default_set_options = { clear: :backspace }doesn't warn on every checkbox.Node::Typingfirst (refcommit, no behavior change), which also bringsNodeback under 300 lines.Node#set. 7 fail without the feature; the checkbox no-warning one passes both ways.Node#setand a CHANGELOG line under Added.