Repository navigation
Conversation
Chrome checks minlength only after a user edit, and a value set from JS never counts as one. Text inputs and textareas are now typed with Ferrum's node.type, and values over 30 characters use Capybara's Selenium rapid mode. Newlines are sent as \r because Ferrum drops \n. has_field with valid, CRLF in a textarea and \n submitting a single-input form pass and are no longer skipped.
Typing a trailing \r presses Enter, which can submit the form and navigate away before the final blur/focus runs. That raised ObsoleteNode, and Capybara retried set on the stale node until it timed out. Also inline the rapid-append JS and raise Metrics/ClassLength to 310.
route
marked this pull request as ready for review
November 24, 2026 19:32
Rapid mode types the first 4 and last 3 characters and sets the middle from JS, so a value of 7 characters or fewer overlapped: "Hello" became "Hellllo". It now types such values in full. Adds specs for a long value, a short one with rapid: true and maxlength with rapid: true.
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.
Chrome checks
minlengthonly after a user edit, and a value set from JS never counts as one, sohas_field(..., valid: false)couldn't see a too-short value. Text inputs (text, password, email, search, tel, url) and textareas are now filled the way Capybara's Selenium node does it:node.type.rapid: true/falseis supported, and the "options ignored" warning is gone. Values of 7 characters or fewer are always typed in full: the split overlapped there ("Hello"became"Hellllo"), which Capybara's Selenium node also does.change, then the field is focused again. That step is skipped when typing Enter submitted the form and left the page, which otherwise raisedObsoleteNodeand made Capybara retrysetuntil it timed out.\r: Ferrum'skeyboard.typedrops\ninside a string, fixed in fix(keyboard): type "\n" in a string as Enter ferrum#730. The workaround can go once that is released.Now passing and no longer skipped:
#has_field with valid should be false if field is invalid#fill_in should handle carriage returns with line feeds in a textarea correctlynode #set should submit single text input forms if ended with \nEvery event-order and
preventDefaultspec innode_spec.rbpasses unchanged.Cost, average
settime vsmain:mainThe threshold stays at 30 characters, like Selenium.
Metrics/ClassLengthgoes from 300 to 310 forNode.