Method: Capybara::Node::Matchers#has_text?
- Defined in:
- lib/capybara/node/matchers.rb
#has_text?(type, text, **options) ⇒ Boolean #has_text?(text, **options) ⇒ Boolean Also known as: has_content?
Checks if the page or current node has the given text content, ignoring any HTML tags.
By default it will check if the text occurs at least once, but a different number can be specified.
page.has_text?('lorem ipsum', between: 2..4)
This will check if the text occurs from 2 to 4 times.
738 739 740 |
# File 'lib/capybara/node/matchers.rb', line 738 def has_text?(*args, **) make_predicate() { assert_text(*args, **) } end |