Asserts that the browser is currently not on a specific page. The quoted argument can be a relative path such as "/user/login" or a full URL such as "https://example.org". The step passes only when the current browser URL does not contain the quoted value anywhere. The pronoun can be I, we, or omitted, the is optional, and a trailing page keyword is also optional.
Gotcha: since this is a negative substring check, a short or generic value can make the assertion fail unexpectedly. For example, I should not be on "/user" fails on /user/login, /user/register, and any URL containing /user. Quote the most specific path that identifies the page the visitor must have left or been kept away from. On failure the error message shows the actual current URL.
Accepted phrasings
Then I should not be on "/path"
Then I should not be on the "/path" page
Then we should not be on "/path"
Then we should not be on the "/path" page
Then should not be on "/path"
Then should not be on the "/path" page
Examples
Then I should not be on "/user/login"
And we should not be on "/checkout/payment"
Then should not be on the "/admin" page
And I should not be on "https://example.org"
In a real scenario
Scenario: A successful login moves the user away from the login page
Given I am an anonymous user
When I go to "/user/login"
And wait
Then I should see "Log in"
When I fill in "Normal user" for "Username or email address"
And I fill in "dD.123123ddd" for "Password"
And I press the "Log in" button
And wait
Then I should see "Normal user"
And I should not be on "/user/login"