teamcapybara/capybara · error · Capybara::ExpectationNotMet
expected #{@actual_title.inspect} not to #{verb} #{@expected
Error message
expected #{@actual_title.inspect} not to #{verb} #{@expected_title.inspect} What it means
Error "expected #{@actual_title.inspect} not to #{verb} #{@expected_title.inspect}" thrown in teamcapybara/capybara.
Source
Thrown at lib/capybara/node/document_matchers.rb:34
# @raise [Capybara::ExpectationNotMet] if the assertion hasn't succeeded during wait time
# @return [true]
#
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 doesn't have the given title.
#
# @macro title_query_params
# @raise [Capybara::ExpectationNotMet] if the assertion hasn't succeeded during wait time
# @return [true]
#
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
##
# Checks if the page has the given title.
#
# @macro title_query_params
# @return [Boolean]
#
def has_title?(title, **options)
make_predicate(options) { assert_title(title, **options) }
end
##
# Checks if the page doesn't have the given title.
#
# @macro title_query_params
# @return [Boolean]View on GitHub (pinned to 15b5fdb76e)
When it happens
Trigger: Thrown at lib/capybara/node/document_matchers.rb:34 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of teamcapybara/capybara@15b5fdb76e (2026-08-21).
Data as JSON: /api/errors/19f9485f2d942b1b.
Report an issue: GitHub.