Skip to content

0.21

Latest

Choose a tag to compare

@route route released this 25 Nov 19:33
· 1 commit to main since this release

Added

  • Node#style reads computed styles in one call, Capybara no longer falls back to its own script after
    NotImplementedError
  • open_new_window(:window) opens a window instead of a tab, an unknown kind raises ArgumentError
  • browser.go_to takes the keywords of Ferrum's go_to, like referrer: and timeout:, it accepted only the URL
  • :url_blocklist and :url_allowlist driver options as aliases for :url_blacklist and :url_whitelist [#330]
  • clear: set option like Selenium's: :none appends, :backspace deletes with Backspace, an Array of keys is pressed
    first. Options Cuprite doesn't support warn again

Changed

  • Text inputs and textareas are filled with real key presses like Selenium, values over 30 characters type the first 4
    and last 3 and set the rest from JS. minlength validates, \n submits a single-input form, and rapid: is supported
  • CUPRITE_DEBUG is renamed to CUPRITE_LOG, which takes FERRUM_LOG values and passes them on, CUPRITE_DEBUG is
    deprecated and acts as CUPRITE_LOG=*. FERRUM_DEBUG is deprecated in Ferrum 0.21
  • trigger("click") watches for a navigation as long as real clicks, Ferrum's FERRUM_NAVIGATION_WAIT
  • Clicks, hovers and drags find their point with Ferrum's node.pinpoint instead of find_position, deprecated in
    Ferrum 0.21, and a click passes an offset only when Capybara gives x and y [rubycdp/ferrum#726]
  • Calls Ferrum's go_to and node.scroll instead of goto and scroll_into_view, deprecated in Ferrum 0.21, and
    page.goto/page.go warn through Ferrum's deprecation instead of being Cuprite's own aliases [rubycdp/ferrum#717]
  • Driver#current_url and Driver#title read Ferrum's url and title of the window, not current_url and
    current_title deprecated in Ferrum 0.21 [rubycdp/ferrum#687]
  • :js_errors is handled by Cuprite instead of being passed to Ferrum, which deprecates it. Behavior is the same
    [rubycdp/ferrum#688]
  • :pending_connection_errors is handled by Cuprite instead of being passed to Ferrum, which deprecates it. visit
    raises Capybara::Cuprite::PendingConnectionsError, a subclass of Ferrum's, and rescuing Ferrum's warns
    [rubycdp/ferrum#689]
  • Dialogs are handled with Ferrum's on(:dialog) instead of the raw CDP event, so Ferrum's default handler no longer
    accepts them first and loses dismissals and prompt responses [rubycdp/ferrum#703]
  • A closed window is removed from Ferrum's context, which returns a copy of its targets, so close_window no longer
    leaves it listed until Chrome reports it destroyed [rubycdp/ferrum#707]
  • find_css and find_xpath answer Capybara's finder hints in the call that finds the nodes, so Capybara no longer
    asks each node for its visibility and text. As with Selenium, a lazily filtered result keeps the answers [#347]
  • Cuprite's own options are kept in Browser::Settings instead of reopening Ferrum::Browser::Options, so
    browser.options is Ferrum's alone and browser.default_user_agent is Chrome's even with emulate:
  • trigger("click") waits for the navigation it starts with Ferrum's await_navigation, not wait_for_navigation!
    deprecated in Ferrum 0.21. go_back, go_forward and refresh no longer raise when the page doesn't load in time
    [rubycdp/ferrum#716]
  • :url_blacklist and :url_whitelist driver options set together raise ArgumentError like the setters, the
    blacklist won

Fixed

  • An empty url_blacklist= unblocks the current page, it kept blocking until the next page
  • url_blacklist= and url_whitelist= raise before saving the list when the other one is set, so new windows no
    longer get the list that raised
  • set with an Array on a field without multiple raises ArgumentError like Selenium, it typed the Array as text
  • Number fields are typed with real key presses like text fields, so clear: and rapid: apply, their value was set
    from JS with no key events
  • value of a multiple select includes the selected options in an <optgroup>, it returned only the others
  • Node#send_keys focuses an element without focus instead of clicking it, so a checkbox isn't toggled and a link isn't
    followed, and the keys go to the end of a filled field instead of where the click put the caret
  • Setting a text field to a value ending in \n no longer fails now and then with Ferrum::NoExecutionContextError
    when the form submits and the page navigates away before the field refocuses
  • response_headers are looked up case-insensitively as with rack_test, ["Content-Type"] returned nil
  • A click on a node the page removes before the hit test raises ObsoleteNode, which Capybara retries, instead of
    Ferrum::JavaScriptError: node.getRootNode(...).elementFromPoint is not a function [#359]
  • Driver#reset! and Driver#quit don't launch Chrome when no browser has started, so a failed launch doesn't
    launch again during teardown
  • The :emulate device user agent is set with Ferrum's network.emulate, so clearing its other overrides keeps the
    device user agent instead of falling back to Chrome's

Removed

  • Methods deprecated in 0.20, see its Deprecated section for replacements
  • String patterns for url_blacklist/url_whitelist, deprecated in 0.15, raise ArgumentError, pass regexps
  • CUPRITE_MODAL_WAIT, accept_*/dismiss_* find the dialog as soon as it's answered instead of checking for it on
    an interval
  • CUPRITE_TRIGGER_CLICK_WAIT, use Ferrum's FERRUM_NAVIGATION_WAIT, which real clicks use too