mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Merge remote branch 'darrenhinderer/master'
This commit is contained in:
commit
c5e541b63d
1 changed files with 8 additions and 2 deletions
|
@ -33,8 +33,14 @@ module Capybara
|
|||
results = all_unfiltered(locator)
|
||||
|
||||
if options[:text]
|
||||
options[:text] = Regexp.escape(options[:text]) unless options[:text].kind_of?(Regexp)
|
||||
results = results.select { |n| n.text.match(options[:text]) }
|
||||
|
||||
if options[:text].kind_of?(Regexp)
|
||||
regexp = options[:text]
|
||||
else
|
||||
regexp = Regexp.escape(options[:text])
|
||||
end
|
||||
|
||||
results = results.select { |n| n.text.match(regexp) }
|
||||
end
|
||||
|
||||
if options[:visible] or Capybara.ignore_hidden_elements
|
||||
|
|
Loading…
Reference in a new issue