Skip to content

Commit

Permalink
Restrict when text match will be attempted in expression
Browse files Browse the repository at this point in the history
  • Loading branch information
twalpole committed Jun 4, 2019
1 parent 43365cd commit 22653e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/capybara/queries/selector_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ def xpath_text_conditions
def try_text_match_in_expression?
first_try? &&
(options[:text] || options[:exact_text]) &&
@resolved_node&.respond_to?(:session) &&
@resolved_node.session.driver.wait?
@resolved_node.is_a?(Capybara::Node::Base)
@resolved_node.session&.driver.wait?
end

def first_try?
Expand Down

0 comments on commit 22653e6

Please sign in to comment.