Support passing an Integer to the :option selector type

This commit is contained in:
Thomas Walpole 2019-07-09 11:42:10 -07:00
parent 85bb55ed49
commit 03052637e5
1 changed files with 1 additions and 1 deletions

View File

@ -1,6 +1,6 @@
# 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 = XPath.descendant(:option)
xpath = xpath[XPath.string.n.is(locator.to_s)] unless locator.nil?