Assert the page's canonical URL (link[rel="canonical"]), by its path, either exactly or by what it ends with. A path alias, a redirect and the node id all leave their trace here.
Examples
Then the page should have the canonical URL "/sample-article"
And the page should not have the canonical URL "/node/1"
Then the canonical URL should end with "/sample-article"
And the canonical URL should not end with "/node/1"
Then the page should have the canonical URL "/"
Pattern
Then(/^(?:(?:the )?page should( not)* have the canonical URL "([^"]*)"|(?:the )?canonical URL should( not)* end with "([^"]*)")$/, …)
Part of @webship-js/drupal-core-steps (github.com/webship/drupal-core-steps), a step pack for Webship-js 2.0.x.