Then I should be on (the) homepage

Asserts that the browser is currently on the homepage of the site under test. The step compares the current URL against the launch URL configured for the test run: it passes when the current URL starts with the launch URL. The words homepage and frontpage are interchangeable, the pronoun can be I, we, or omitted, and the is optional.

Because the check is "current URL starts with the launch URL", it is a lenient homepage assertion: a URL that only adds a query string or fragment to the launch URL still passes. If you need to confirm a precise path instead, use the quoted form I should be on "...".

Accepted phrasings

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

Examples

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

In a real scenario

Scenario: Submitting the password reset form sends the visitor back to the homepage
  Given I am on the homepage
   When I go to "/user/password"
    And I wait 3s
   Then I should see "Username or email address"
   When I fill in "visitor@example.org" for "Username or email address"
    And I press the "Reset" button
    And I wait 3s
   Then I should be on the homepage

Related steps

Back to Navigation Steps