module Capybara::Node::DocumentMatchers
Public Instance Methods
Source
# File lib/capybara/node/document_matchers.rb, line 32 def assert_no_title(title, **options) _verify_title(title, options) do |query| raise Capybara::ExpectationNotMet, query.negative_failure_message if query.resolves_for?(self) end end
Asserts that the page doesn’t have the given title.
@macro title_query_params @raise [Capybara::ExpectationNotMet] if the assertion hasn’t succeeded during wait time @return [true]
Source
# File lib/capybara/node/document_matchers.rb, line 19 def assert_title(title, **options) _verify_title(title, options) do |query| raise Capybara::ExpectationNotMet, query.failure_message unless query.resolves_for?(self) end end
Asserts that the page has the given title.
@!macro title_query_params
@overload $0(string, **options) @param string [String] The string that title should include @overload $0(regexp, **options) @param regexp [Regexp] The regexp that title should match to @option options [Numeric] :wait (Capybara.default_max_wait_time) Maximum time that Capybara will wait for title to eq/match given string/regexp argument @option options [Boolean] :exact (false) When passed a string should the match be exact or just substring
@raise [Capybara::ExpectationNotMet] if the assertion hasn’t succeeded during wait time @return [true]
Source
# File lib/capybara/node/document_matchers.rb, line 54 def has_no_title?(title, **options) make_predicate(options) { assert_no_title(title, **options) } end
Checks if the page doesn’t have the given title.
@macro title_query_params @return [Boolean]
Source
# File lib/capybara/node/document_matchers.rb, line 44 def has_title?(title, **options) make_predicate(options) { assert_title(title, **options) } end
Checks if the page has the given title.
@macro title_query_params @return [Boolean]
Private Instance Methods
Source
# File lib/capybara/node/document_matchers.rb, line 60 def _verify_title(title, options) query = Capybara::Queries::TitleQuery.new(title, **options) synchronize(query.wait) { yield(query) } true end