Assert a path of the site answers with a redirect to a target, or does not: the path is requested without following redirects, and the Location of the answer is compared with the target (a path, or an absolute URL). The request is anonymous, so it sees what a visitor and a search engine see.
Examples
Then the path "/old-address" should redirect to "/home"
And the path "/summer-2025" should redirect to "/campaigns"
Then the path "/press" should redirect to "https://example.com/press"
And the path "/old-address" should not redirect to "/home"
Then the path "/legal" should not redirect to "/privacy-policy"
Pattern
Then(/^the path "([^"]*)" should( not)* redirect to "([^"]*)"$/, …)
Part of @webship-js/drupal-cms-steps (github.com/webship/drupal-cms-steps), a step pack for Webship-js 2.0.x.