Then I should not be on (the) homepage

Asserts that the browser is currently not on the homepage of the site under test. The step compares the current URL against the launch URL configured for the test run and fails if the URL equals the launch URL or sits directly under it. Use it after an action that should have taken the visitor somewhere else, such as following a link or being redirected to a login page.

As with the positive form, homepage and frontpage are interchangeable, the pronoun can be I, we, or omitted, and the is optional. When the assertion fails, the error message includes the actual current URL so you can see where the browser really ended up.

Accepted phrasings

Then I should not be on homepage
Then I should not be on the homepage
Then I should not be on frontpage
Then we should not be on the homepage
Then should not be on homepage
Then should not be on the frontpage

Examples

Then I should not be on homepage
And I should not be on the homepage
Then we should not be on homepage
And should not be on the frontpage

In a real scenario

Scenario: Opening the login page takes the visitor away from the homepage
  Given I am an anonymous user
   When I go to the homepage
    And wait
   Then I should be on the homepage
   When I go to "/user/login"
    And wait
   Then I should see "Log in"
    And I should not be on the homepage

Related steps

Back to Navigation Steps