History.md
Release date: 2024-01-26
Capybara::Result#to_ary to support multiple assignment [Sean Doyle]has_element? and related matchers [Sean Doyle]Release date: 2023-06-10
Release date: 2023-05-12
Release date: 2023-04-02
:target filter option on :link selector [Yudai Takada]Release date: 2022-11-03
click, double_click, right_click can now be called on the session to click the currently scoped element (or document)Session#within now passes the scoped element to the blockevaluate_async_script added to Session::DSL_METHODS [Henry Blyth]Release date: 2022-05-09
Release date: 2022-05-07
<base> element in rack-test driver - ISsue #2544Element#shadow_root support. Requires selenium-webdriver 4.1+. Only currently supported with Chrome when using the selenium driver. Note: only CSS can be used to find elements from the shadow root. Therefore you won't be able to use most Capybara helper methods (fill_in, click_link, find_field, etc) directly from the shadow root since those locators are built using XPath. If you first locate a descendant from the shadow root using CSS then you should be able to use all the Capybara methods from there.exact_text finder optionRelease date: 2021-10-24
allow_label_click accepts click options to be used when clicking an associated labelallow_gumbo= in favor of use_html5_parsing= to enable use of Nokogiri::HTML5 when availableSession#active_element returns the element with focus - Not supported by the RackTest driver [Sean Doyle]focused: filter for finding interactive elements - Not supported by the RackTest driver [Sean Doyle]Node#all_text always returns a string - Issue #2477have_any_of_selectors negated match - Issue #2473Document#scroll_to fixed for standards behavior - pass quirks: true if you need the older behavior [Eric Anderson]Release date: 2021-01-29
Release date: 2021-01-29
Release date: 2021-01-26
Release date: 2021-01-25
enable_aria_role [Sean Doyle]Release date: 2020-11-26
scroll-behavior: auto; [Nathan Broadbent]Session#send_keys to send keys to the current element with focus in drivers that support the
concept of a current element [Sean Doyle]readonly? added to Node::Simpleallow_label_click now works if there are multiple labels (Issue #2421)drop with Pathname (Issue #2424)[Máximo Mussini]Release date: 2020-06-21
within_session now receives the new and old sessionvalidation_message filter with :field and :fillable_field selectorsassert_text [Eileen M. Uchitelle]Release date: 2020-05-16
have_text description [Juan Pablo Rinaldi]Release date: 2020-04-05
Release date: 2020-03-29
delay setting on click with SeleniumRelease date: 2020-01-26
enabled_options and disabled options filters for select selectorall results to be reloaded when stable - Beta feature - may be removed in
future version if problems occurRelease date: 2019-12-24
Release date: 2019-09-02
attach_file with Chrome and Firefoxleft_of, right_of, above, below, near)Release date: 2019-08-03
:html5 option to drag_to when using Selenium with Chrome or Firefox:valid node filter added to :field and :fillable_field selectorsqueue_requests setting - Issue #2227Release date: 2019-07-28
is_element_displayed endpoint via Selenium
driver native_displayed option for performance reasons. Disabled by default due to endpoints
currently not handling <details> element descendants visibility correctly.ancestor and siblingqueue_requests: false when using SSLRelease date: 2019-07-15
w3c_click_offset configuration option applies to right_click and double_click as well as clicknil to the text/content assertions/expectationsSession#server_url returns the base url the AUT is being run at (when controlled by Capybara)option selector type accepts an integer as locatorqueue_requests: false - Issue #2227Release date: 2019-06-27
w3c_click_offset configuration option to determine whether click offsets are calculated from element
center or top left cornerRelease date: 2019-06-13
attach_file will be assumed to be relative to the current working directory when using the
Selenium driverRelease date: 2019-06-10
<input type="color"> elements with the selenium driverRelease date: 2019-05-29
ancestor/sibling assertions and matchers added:with alias for :option filter on :checkbox and :radio_button selectorsRelease date: 2019-05-24
attach_file make_visible: true now includes auto for
height and width to handle more ways of hiding the file input elementRelease date: 2019-05-19
uglifier from runtime to development dependency [miyucy]Release date: 2019-05-17
Release date: 2019-05-14
Node#obscured? to check viewport presence and element overlap:obscured system filter to check whether elements are obscured in finders, assertions, and expectationsisDisplayed/getAttribute atoms for selenium driver. If these produce issues you can disable their use
by setting an environment variable named 'DISABLE_CAPYBARA_SELENIUM_OPTIMIZATIONS' (Please also report any issues).href: false option with find_link/click_link/:link selector ignores href presence/absenceRelease date: 2019-05-11
Release date: 2019-05-09
#once, #twice, #thrice, #exactly, #at_least, #at_most, and #times
added to have_selector, have_css, have_xpath, and have_text RSpec matchersRelease date: 2019-04-22
Release date: 2019-04-18
name attributeRelease date: 2019-04-10
Release date: 2019-03-30
Release date: 2019-03-28
true to selectively override when Capybara.predicates_wait == falseRelease date: 2019-03-19
attach_file now supports a block mode on JS capable drivers to more accurately test user behavior when file inputs are hidden (beta)with_rows, 'rows', with_cols, and 'cols' filtersCapybara.test_id is set - Issue #2166 [bingjyang]Release date: 2019-02-25
Release date: 2019-01-24
Release date: 2019-01-24
Release date: 2019-01-23
assert_style/has_style/have_style deprecated in favor of assert_matches_style/matches_styles?/match_styleRelease date: 2018-11-28
:between optionsessionStorage and localStorage. To disable pass clear_local_storage: false and/or clear_session_storage: false when creating Capybara::Selenium::Driver instance in your driver registrationRelease date: 2018-11-16
Release date: 2018-11-14
Capybara::HTML Will use nokogumbo for HTML parsing if installedSelector#locator_filter added to allow for dynamic locator in selectorsRelease date: 2018-11-03
aria-label and test_id matching for link_or_button selector type - Issue #2125Release date: 2018-10-23
xpath/css expression definitions will get filter names from block parameters if not explicitly providedany_of_selectors assertions and matchers to complement all_of_selectors and none_of_selectorscss expression definition declared filters now work againRelease date: 2018-10-03
using_session now accepts a session object as well as the name of the session for users who manually manage sessions:field selector will now find type = "hidden" fields if the type: "hidden" filter option is providedRelease date: 2018-09-26
Release date: 2018-09-22
Release date: 2018-09-20
Release date: 2018-09-12
Fix MatchQuery based matchers when used on a root element found using any type of parent/ancestor query - Issue #2097
Fix Chrome/FF HTML5 drag simulation for elements (a, img) which default to draggable - Issue #2098
Release date: 2018-09-05
has_css?/have_css/etc - Issue #2093Release date: 2018-09-02
Capybara.disable_animation can be set to a CSS selector to identify which elements will have animation disabled [Michael Glass]Capybara.default_normalize_ws option which sets whether or not text predicates and matchers (has_text?, has_content?, assert_text, etc) use normalize_ws option by default. Defaults to false. [Stegalin Ivan]:normalize_ws option for the :text/:exact_text filters. Defaults to the Capybara.default_normalize_wssetting above.choose/check/uncheck/attach_file/fill_in can now operate on the element they're called on or a descendant if no locator is passed.Element#attach_file :make_visible option will now have !important priority set to ensure they override any other specified style.Release date: 2018-08-14
Capybara.predicates_wait option which sets whether or not Capybaras matcher predicate methods (has_css?, has_selector?, has_text?, etc.) default to using waiting/retrying behavior (defaults to true)Release date: 2018-08-03
refute_matches_elector => refute_matches_selectorRelease date: 2018-08-01
has_text?, has_content?, assert_text, etc) now support a normalize_ws optionattach_file with Selenium and local Firefox 62+ now correctly generates only one change event when attaching multiple filesRelease date: 2018-07-24
match_xxx selectors and matches_xxx? predicates work correctly with elements found using a sibling selector - Issue #2073Release date: 2018-07-20
Session#evaluate_script now strips the script in Session rather than only in the Selenium driverRelease date: 2018-07-19
Session#evaluate_script and Element#evaluate_script now strip leading/trailing whitespace from scripts [Ian Lesperance]file_detector with remote geckodriver#within_frame locator is optional when only one frame existsCapybara.test_id option that allows for matching the Capybara provided selector types on an arbitrary attribute
(defaults to nil), set to your test id attribute ('data-test-id, etc) if using test id attributes in your projectRelease date: 2018-06-27
selenium-webdriver version check [ahorek]disabled? for fieldset elements - Issue #2059 [Thomas Walpole]Release date: 2018-06-25
execute_async_script can now be called on elements to run the JS in the context of the element:download filter option on `:link' selectorWindow#fullscreenElement#style and associated matchersselenium-webdriver is raised to 3.5.0 (but you really should be using newer than that)#path - Issue #2048Release date: 2018-06-04
Release date: 2018-06-01
ElementNotFound errors raised in selector filters are interpreted as non-matchesdefault_set_options used in Capybara::Node::Element#set as default options hash [Champier Cyril]execute_script and evaluate_script can now be called on elements to run the JS in the context of the element [Thomas Walpole]matcher Regexp to handle multiple filter options [Thomas Walpole]:element selector type which will match on any attribute (other than the reserved names) passed as a filter option [Thomas Walpole]:class filter option now supports preceding class names with ! to indicate not having that class [Thomas Walpole]:class and :id filter options now accept XPath::Expression objects to allow for more flexibility in matching [Thomas Walpole]Capybara.disable_animation setting which triggers loading of a middleware that attempts to disable animations in pages.
This is very much a beta feature and may change/disappear in the future. [Thomas Walpole]Release date: 2018-05-25
Release date: 2018-05-10
select with text inputs associated with a datalist elementtype filter on :button selectorRelease date: 2018-04-30
check where the locator string could not be omittedRelease date: 2018-04-13
Release date: 2018-04-06
Capybara.server= to accept a proc which was accidentally removed in 3.0.0Release date: 2018-04-05
Release date: 2018-03-23
current_url returns the url for the top level browsing contexttitle returns the title for the top level browsing contextDriver#frame_url returns the url for the current frameDriver#frame_title returns the title for the current frameRelease date: 2018-03-02
#to_capybara_node methodfirst now raises ElementNotFound, by default, instead of returning nil when no matches are found - Issue #1507wait: false if you want the previous
behavior where an empty result would be returned immediately if no matching elements exist yet.Capybara.exact_options no longer exists. Just use exact: true on relevant actions/finders if necessary.field_labeled alias for find_fieldRelease date: 2018-02-12
Release date: 2018-01-02
have_all_of_selectors, have_none_of_selectors RSpec matchers for parity with minitest assertions [Thomas Walpole]current_path and a matcher was used with a Regexp [Thomas Walpole]Release date: 2017-11-20
accept_prompt response text can contain quotes when using selenium with headless chrome [Thomas Walpole]Release date: 2017-11-13
current_path matchers will now autodetect path vs url based on string to be matched. Deprecates
:only_path in favor of :ignore_query option [Thomas Walpole]respond_to? on the object passed to Capybara.configure block - Issue #1935Release date: 2017-10-07
Release date: 2017-10-03
Release date: 2017-10-02
Release date: 2017-08-04
attach_file with no extension/MIME type when using the :rack_test driver [Thomas Walpole]Release date: 2017-08-04
sibling and ancestor finders added [Thomas Walpole]:selenium_chrome and :selenium_chrome_headless [Thomas Walpole]and_then to Capybara RSpec matchers which behaves like the previous and compounder. [Thomas Walpole]#or more performant and confirm
both conditions are true "simultaneously" for and. [Thomas Walpole]
If you still want theSession#refresh [Thomas Walpole]Session#within_window can be called from [Thomas Walpole]mime-types dependency to mini_mime [Jason Frey]Release date: 2017-06-27
Release date: 2017-06-15
Release date: 2017-06-09
Release date: 2017-06-07
puma server registration to encourage it to run in single mode [Thomas Walpole]all [Thomas Walpole]with_selected option to the :select selector to match options/with_options options - Issue #1865 [Bartosz Nowak]Release date: 2017-05-01
:type filter added to the :fillable_field selectorall/within that call either the Capybara::DSL or RSpec matchers
depending on arguments passedRelease date: 2017-03-16
Release date: 2017-02-16
Release date: 2017-01-22
within_element as an alias of within due to RSpec collisionRelease date: 2016-12-05
Enumerator when called without a block - Issue #1777 [Thomas Walpole]Release date: 2016-11-30
Release date: 2016-10-08
Release date: 2016-10-05
<button> elements with descendant images with alt attributes matching the locator [Ian Lesperance]Release date: 2016-09-29
Release date: 2016-09-23
Release date: 2016-09-19
#attach_file - Issue #1756 [Thomas Walpole]:class option to many of the built-in selectors [Thomas Walpole]:boolean filter type in custom selectors [Thomas Walpole]Element#matches_xpath? and Element#matches_css? [Thomas Walpole]Release date: 2016-08-25
Release date: 2016-08-16
:with option for the field selector now accepts a regular expression for matching the field value [Uwe Kubosch].all[idx] [Thomas Walpole]Release date: 2016-05-01
Release date: 2016-04-07
Release date: 2016-01-27
Release date: 2016-01-27
Release date: 2016-01-17
Release date: 2015-08-25
:fill_options => { :clear => :backspace } [Joe Lencioni]Release date: 2014-10-13
Release date: 2014-09-21
Release date: 2014-09-20
Release date: 2014-07-03
Release date: 2014-06-02
Release date: 2014-01-06
reset.
Capybara, now visits about:blank like it did before. [Jonas Nicklas]Release date: 2013-11-21
go_back and go_forward methods. [Vasiliy Ermolovich]has_button?, has_checked_field? and has_unchecked_field? accept
options, like other matchers. [Carol Nichols]assert_selector and has_text? methods now support the :wait option
[Vasiliy Ermolovich]hidden attribute.#all now delegate the sample method. [Phil Lee]set method now works for contenteditable attributes under Selenium.
[Jon Rowe]about:blank, fixing hanging issues in JRuby. [Jonas Nicklas]on under RackTest [Nigel Sheridan-Smith]within_window and within_frame inside within resets the scope
so that they behave like a user would expect [Thomas Walpole]Capybara::Result delegates its inspect method, so as not to confuse users
[Sam Rawlins]quit method does nothing when browser hasn't been loaded
[randoum]Release date: 2013-04-09
selenium-webdriver gem. Add it to
your Gemfile if you wish to use the Selenium driver. [Jonas Nicklas]Capybara.ignore_hidden_elements defaults to true. [Jonas Nicklas]smart matching is used by default. Set
Capybara.match = :one to revert to old behaviour. [Jonas Nicklas].Capybara.exact_options = false to revert to old behaviour.
[Jonas Nicklas].Capybara.ignore_hidden_elements instead of
always returning only visible text. Set Capybara.visible_text_only = true
to revert to old behaviour. [Jonas Nicklas]reset!.
[Jonas Nicklas]click_link, fill_in, etc...) and finders now take an options
hash, which is passed through to find. [Jonas Nicklas]invalid
in some drivers. [Thomas Walpole]Capybara.asset_host option, which inserts a base tag into the page on
save_and_open_page, eases debugging with the Rails asset pipeline.
[Steve Hull]exact option, can specify whether to match substrings or entire text.
[Jonas Nicklas]match option, can specify behaviour in case of multiple matches.
[Jonas Nicklas]wait option, can specify how long to wait for a given action/finder.
[Jonas Nicklas]text now takes a parameter which makes it possible to return either all
text or only visible text. The default depends on
Capybara.ignore_hidden_elements. Capybara.visible_text_only option is
available for compatibility. [Jonas Nicklas]has_content? and has_text? now take the same count options as has_selector?
[Andrey Botalov]current_scope is now public API, returns the current element when within
is used. [Martijn Walraven]find("input").disabled? returns true if a node is disabled. [Ben Lovell]:disabled => false. [Jonas Nicklas]find("input").hover moves the mouse to the element in supported drivers.
[Thomas Walpole]form attribute on form elements.
[Thomas Walpole]page.title returns the page title. [Terry Progetto]has_title? matcher to assert on page title. [Jonas Nicklas]:select and :textarea are valid options for the :type filter on find_field
and has_field?. [Yann Plancqueel]within_frame, where selecting multiple nested frames didn't
work as intended. [Thomas Walpole]Release date: 2013-03-26
Release date: 2012-12-31
Release date: 2012-12-21
:respect_data_method option
enabled from capybara/rspec to capybara/rails, so that it is enabled in
Rails projects that don't use RSpec. [Carlos Antonio da Silva]source is now an alias for html. RackTest no longer returns modifications
to html. This basically codifies the behaviour which we've had for a while
anyway, and should have minimal impact for end users. For driver authors, it
means that they only have to implement html, and not source. [Jonas
Nicklas]app_host is set and no server is running works
as expected. [Jonas Nicklas]fill_in works properly under Selenium again when the caret is not at the
end of the field before the method is called. [Douwe Maan, Jonas Nicklas, Jari
Bakken]attach_file can once again be given a Pathname [Jake Goulding]Release date: 2012-11-05
respect_data_method default to false for the RackTest driver in non-rails
applications. That means that Capybara no longer picks up data-method="post"
et. al. from links by default when you haven't required capybara/rails
[Jonas Nicklas]find now raises an error if more than one element was found. Since find is
used by most actions, like click_link under the surface, this means that all
actions need to unambiguous in the future. [Jonas Nicklas]find(:foo), use find("#foo") or
find_by_id("foo") instead. [Jonas Nicklas]Element#text on RackTest now only returns visible text and normalizes
(strips) whitespace, as with Selenium [Mark Dodwell, Jo Liss]has_content? now checks the text value returned by Element#text, as opposed to
querying the DOM. Which means it does not match hidden text.
[Ryan Montgomery, Mark Dodwell, Jo Liss]#body now returns the unmodified source (like #source), not the current
state of the DOM (like #html), by popular request [Jonas Nicklas]Node#all no longer returns an array, but rather an enumerable Capybara::Result
[Jonas Nicklas]select and unselect needs to be the exact text of an option
in a select box, substrings are no longer allowed [Jonas Nicklas]options option to has_select? must match the exact set of options. Use
with_options for the old behaviour. [Gonzalo Rodriguez]selected option to has_select? must match all selected options for multiple
selects. [Gonzalo Rodriguez]Driver#body to Driver#html (relevant only for driver authors) [Jo
Liss]failure_message for custom selectors. [Jonas Nicklas]Capybara.server_boot_timeout has been removed in favor of a higher
(60-second) hard-coded timeout [Jo Liss]Capybara.prefer_visible_elements has been removed, as it is no longer needed
with the changed find semantics [Jonas Nicklas]Node#wait_until and Session#wait_until have been removed. See Node#synchronize
for an alternative [Jonas Nicklas]Capybara.timeout has been removed [Jonas Nicklas]:resynchronize option has been removed from the Selenium driver [Jonas Nicklas]rows option to has_table? has been removed without replacement.
[Jonas Nicklas]field, link, button,
etc... [Adam McCrea, Jonas Nicklas]has_text? has been added as an alias for has_content? [Jonas Nicklas]Capybara.server_host option (default: 127.0.0.1) [David Balatero]:type option for page.has_field? [Gonzalo Rodríguez]Node#synchronize method to rerun a block of code if certain errors are raised
[Jonas Nicklas]Capybara.always_include_port config option always includes the server port in
URLs when using visit. Facilitates testing different domain names. [Douwe Maan]has_content? and has_text? can be given a regular expression [Vasiliy Ermolovich]attach_file [Jarl Friis]all are no longer reloaded. This fixes weird quirks where
nodes would seemingly randomly replace themselves with other nodes [Jonas Nicklas]require 'capybara/dsl' is no longer necessary [Jo Liss]Rack::Test now respects ports when changing hosts [Jo Liss]Rack::Test now preserves the original referer URL when following a
redirect [Rob van Dijk]visit multiple times
[Jo Liss]respect_data_method is true, the data-method attribute can be capitalized
[Marco Antonio]#source returns an empty string instead of nil if no pages have been visited
[Jonas Nicklas]within_frame returns the value of the given block [Alistair Hutchison]Node.set on text fields will not trigger more than one change event
[Andrew Kasper]all or
has_selector? which Capybara doesn't understand [Jonas Nicklas]==
[Jonas Nicklas]has_text (has_content) now accepts non-string arguments, like numbers.
[Jo Liss]has_text and text now correctly normalize Unicode whitespace, such as
. [Jo Liss]click_link(:foo) works
as expected. [Jonas Nicklas]:count => 0 now works as expected [Jarl Friis]Release date: 2012-11-28
Release date: 2012-10-30
all and first are never reloaded. This fixes issues where
a node would sometimes magically turn into a completely different node.
[Jonas Nicklas]find were ignored. [Jonas Nicklas]Release date: 2011-11-15
Release date: 2011-09-02
Release date: 2011-08-12
Release date: 2011-06-14
include Capybara has been deprecated in favour of include Capybara::DSL [Jonas Nicklas]Release date: 2011-01-21
Release date: 2010-10-22
Release date: 2010-10-12
find('#foo').fill_in(...)find(:id, 'foo') or find(:foo)Release date: 2010-07-03
Release date: 2010-05-12
select under rack-test and Selenium.Release date: 2010-04-09
This is a drop in compatible maintenance release. It's mostly important for driver authors.
Release date: 2010-03-22
This is a maintenance release with minor bug fixes, should be drop in compatible.
Release date: 2010-02-26
This is a mostly backwards compatible release, it does break the API in some minor places, which should hopefully not affect too many users, please read the release notes carefully!
visit now accepts fully qualified URLs for drivers that support it.