Assert the page head is (or is not) written by Gatsby's Head API: the tags that the Head export renders carry data-gatsby-head="true", and Gatsby replaces them on every client-side navigation. Tags from react-helmet or a hand-written <head> do not carry it.
Examples
Then the page head should be set by the Head API
And the page head should be set by the Head API
But the page head should not be set by the Head API
Then page head should be set by the Head API
And the head should be set by the Head API
Pattern
Then(/^(?:the )?(?:page )?head should( not)* be set by the Head API$/, …)
Part of @webship-js/gatsby-steps (github.com/webship/gatsby-steps), a step pack for Webship-js 2.0.x.