When I publish the post

Publish the post or page in the editor: the Publish button and, when WordPress asks, the confirmation of its pre-publish panel. It waits until the status is "publish".

Examples

When I publish the post
When we publish the page
And I publish the post
When I publish the page
And we publish the post

Pattern

When(/^(I |we )*publish the (post|page)$/, …)

Part of @webship-js/wordpress-steps (github.com/webship/wordpress-steps), a step pack for Webship-js 2.0.x.