Repository navigation
Releases
Releases · rubycdp/cuprite
0.20
Changed
- Node helpers on
Capybara::Cuprite::Browser(value,set,select,visible_text,drag, etc.) are private, use
Capybara's node API ornode.native.nodefor Ferrum's Browser#findis private,Browser#active_elementandBrowser#within_windoware removed, use Capybara's
active_elementandwithin_windowDriver#find,Driver#screen_size,Driver#within_window,Node#findandNode#commandare private- Ferrum's
base_urlfollowsCapybara.app_host(or Capybara's server) and the visited page, so
page.driver.browser.cookiesdoesn't needdomain:. A:base_urloption is replaced onvisitand restored on
reset! - Requires Ferrum 0.20.1, see its changelog.
page.driver.browser.evaluate_on_new_documentapplies to the current page only and is gone afterreset!, use the
:extensionsoption orbrowser.add_extension. Scripts passed toevaluate_scriptandexecute_scriptmay warn
about what changes in Ferrum 0.21, setFERRUM_JS_API=newto run them that way now
Deprecated
- Deprecated methods print a warning and will be removed in 0.21
Driver#body, useDriver#htmlinsteadDriver#backandDriver#forward, useDriver#go_backandDriver#go_forwardinsteadDriver#window_handleandBrowser#window_handle, usecurrent_window_handleinsteadDriver#render, useDriver#save_screenshotinsteadDriver#render_base64, usepage.driver.browser.screenshotorpage.driver.browser.pdfinsteadDriver#zoom_factor=andDriver#paper_size=, passscale:,paper_width:andpaper_height:to
save_screenshotinsteadDriver#resizeandDriver#resize_window, usepage.current_window.resize_toinsteadDriver#authorizeandDriver#basic_authorize, usepage.driver.browser.network.authorizeinsteadDriver#headers,headers=,add_headersandadd_header, usepage.driver.browser.headersinsteadDriver#cookies,set_cookie,remove_cookieandclear_cookies, usepage.driver.browser.cookiesinsteadDriver#network_traffic,clear_network_traffic,wait_for_network_idleandclear_memory_cache, use
page.driver.browser.networkinstead.network.trafficincludes blocked requestsDriver#click, usepage.driver.browser.mouse.clickinsteadDriver#scroll_to, usepage.scroll_toinsteadDriver#wait_for_reload,timeout,timeout=,device_pixel_ratioandviewport_size, use the same methods on
page.driver.browserinsteadDriver#set_proxy, pass the:proxyoption to the driver insteadDriver#restartandNode#browser, usepage.driver.browser.restartandpage.driver.browserinsteadBrowser#visitandBrowser#status_code, usegotoandnetwork.statusinsteadNode#send_key, useNode#send_keysinsteadNode#parents, use Capybara'sancestorinsteadNode#property, usenode.native.node.propertyinsteadNode#attributesNode#description, usenode.native.node.descriptioninstead
Fixed
Node#drag_towithdrop_modifiers:holds the modifiers while moving to the target and sends keydown and keyup for
them, like Selenium does. They used to be set only on mouseup [rubycdp/ferrum#581]- Resizing the window reset hover and pointer overrides passed with
--blink-settings, so@media (hover: hover)
stopped matching on headless Linux [#282, rubycdp/ferrum#664]
Removed
- Ruby 3.1 support, Cuprite requires Ruby 3.2 or newer
format: :pdfinDriver#save_screenshot, broken since Ferrum 0.6. A.pdfpath renders a PDFDriver#source, it always raisedNotImplementedError. Usepage.htmlorpage.sourceinsteadCapybara::Cuprite::Cookie, it was never loaded.Driver#cookiesreturnsFerrum::Cookies::CookieobjectsPage#frame_name, it was unusedPage#reset_modalsandBrowser#reset_modals, they were unusedBrowser#switch_to_frame,find_modal,accept_confirm,dismiss_confirm,accept_promptanddismiss_prompt,
they were internal delegates toPageBrowser#browser_error, it was used only in specsNode#as_jsonandNode#to_json, they were unusedDriver#pause, usebinding.irbwithheadless: false, orDriver#debug
0.19
Added
:emulatedriver option to emulate a device listed in Chrome DevTools with its user agent, e.g.
emulate: :iphone_14, along with:mobileand:scale_factoroptions it sets, kept across window resizes [#216]Node#drag_toacceptsx:andy:to drop at an offset from the target, measured from its center or top left like
click, so drop targets that tell the upper half from the lower one can be driven [#325]
Changed
- Ferrum is bumped to
~> 0.19.1 --disable-web-securityis added to the browser options, since Ferrum dropped it from its defaults. Tests keep
reaching into cross-origin frames, e.g.current_urlwithin a frame from another origin [rubycdp/ferrum#472]- Change
Node#send_keysto avoid triggeringclickon an already focused element.send_keys(:tab)without an
element no longer clicks the middle of the page first, so Tab moves focus from the start of the page, and Capybara's
#active_elementandfocused:specs run in the suite [#327]
Fixed
Node#drag_tofireddragleaveright beforedropon an HTML5 drop target, which browsers never do, so libraries such
as Pragmatic drag and drop dropped onto nothing. A drag now ends withdropif the target accepted it, otherwise
withdragleave[#325]window_size: nilraisedFerrum::BrowserError: Invalid parameterson every page instead of leaving the window
size to Chrome, sostart-maximizedcouldn't be used [#278]Driver#reset!kept the page it had cached when the browser failed to reset, so every later example raised
Session with given id not foundorBrowser is dead or given window is closedinstead of starting on a fresh
page [#274], [rubycdp/ferrum#641]Node#visible?reported an open popover or modal dialog as hidden when an ancestor hadopacity: 0[#328]Driver#window_handleslisted the web workers a page spawned as windows, sowindow_opened_byraised
opened 2 windows instead of 1[#326]Node#select_optionandNode#unselect_optiondidn't fire theinputevent on the select [#223]Node#triggersilently dispatched nothing for events other than mouse, focus andsubmit, such asinput,
changeor custom events [#197]Node#setwith an empty string cleared a text field without firing theinputevent [#164]- Finders with
exact_text: trueraisedInvalidSelectorbecause Capybara appended an empty[]predicate to the
XPath [#256]
0.18
Added
- Support time inputs [#245]
- Add initial support for shadow_root [#234]
- Support
Capybara::Cuprite::Node#rect[#276] - Extend
Node#setwith thedatetime-localinput type [#295] - Support HTML5 drag-and-drop and drag modifier keys in
Node#drag_to[#315] - Support
Element#dropfor files and strings [#316] - Add
:raise_on_unhandled_modalbrowser option to raise instead of warn on an unhandled modal [#320]
Changed
- Bump Ferrum dependency to
~> 0.18.0
Fixed
- Ensure the node has focus before setting value [#280]
- Raise
ObsoleteNodeinstead of silently acting on a node that got disconnected from the DOM between being found and being used [#239] Capybara::Cuprite::Node#send_keysignores empty or nil keys instead of raising, matching the Selenium and rack_test drivers [#313]Driver#switch_to_frameaccepts aCapybara::Cuprite::Nodeinstead of only a wrappedCapybara::Node::Element[#312]- Report
tag_nameas"ShadowRoot"for shadow root nodes [#318] - Treat non-summary descendants of a closed
<details>element as non-visible [#317] switch_to_windowsendsTarget.activateTargetso Chrome reactivates the window's renderer immediately instead of leaving it backgrounded, which could stall the next input command for several seconds [#321]Node#setfiresinputandchangeevents for acolorinput, since its value can only be set via JavaScript and never gets them naturally [#229]- Generate a
FocusEvent(not a genericEvent) for focus-related events (blur,focus,focusin,focusout), matching real browser behavior [#272]
0.17
0.16
0.15.1
Added
- Support for
Driver#send_keys, the:focusedfilter, andDriver#active_element[#261]
Changed
@window_sizeattribute is moved from Ferrum, viewport size is still inherited [#253]- Compatibility with latest Ferrum. Browser instance is not passed everywhere now [#254]
Cuprite::Browsermethods are located inOptions.#window_size#url_blacklist#url_whitelist#timeout
Page#newarguments are changed toclient, context_id:, target_id:Target#attached?renamed toTarget#connected?- Ferrum doesn't restart browser automatically, Cuprite does
Browser#close_windowremoves target id asap from the target list
Fixed
0.15
Added
url_blocklist | url_allowlistaliases forwhitelist | blacklist- Support steps option for dragging [#182]