lib/capybara/selector/definition/button.rb in capybara-3.32.2 vs lib/capybara/selector/definition/button.rb in capybara-3.33.0
- old
+ new
@@ -2,9 +2,10 @@
Capybara.add_selector(:button, locator_type: [String, Symbol]) do
xpath(:value, :title, :type, :name) do |locator, **options|
input_btn_xpath = XPath.descendant(:input)[XPath.attr(:type).one_of('submit', 'reset', 'image', 'button')]
btn_xpath = XPath.descendant(:button)
+ btn_xpath += XPath.descendant[XPath.attr(:role).equals('button')] if enable_aria_role
image_btn_xpath = XPath.descendant(:input)[XPath.attr(:type) == 'image']
unless locator.nil?
locator = locator.to_s
locator_matchers = XPath.attr(:id).equals(locator) |