Support passing an Integer to the :option selector type
This commit is contained in:
parent
85bb55ed49
commit
03052637e5
|
@ -1,6 +1,6 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
Capybara.add_selector(:option, locator_type: [String, Symbol]) do
|
Capybara.add_selector(:option, locator_type: [String, Symbol, Integer]) do
|
||||||
xpath do |locator|
|
xpath do |locator|
|
||||||
xpath = XPath.descendant(:option)
|
xpath = XPath.descendant(:option)
|
||||||
xpath = xpath[XPath.string.n.is(locator.to_s)] unless locator.nil?
|
xpath = xpath[XPath.string.n.is(locator.to_s)] unless locator.nil?
|
||||||
|
|
Loading…
Reference in New Issue