Assert the page-data of a route has (or has not) been prefetched by the current page. Gatsby prefetches the targets of links in the viewport and of links under the mouse, a few seconds after the page loads; the step looks for the <link rel="prefetch"> tag or the request of the page-data file. Without a prefetch the negative form waits 4 seconds before it passes.
Examples
Then the page "/page-2/" should be prefetched
And the page "/using-typescript/" should be prefetched
But the page "/page-2/" should not be prefetched
Then page "/using-dsg/" should be prefetched
And the page "/" should be prefetched
Pattern
Then(/^(?:the )?page "([^"]*)?" should( not)* be prefetched$/, …)
Part of @webship-js/gatsby-steps (github.com/webship/gatsby-steps), a step pack for Webship-js 2.0.x.