Assert the shop sent an e-mail whose subject holds a text to an address (a handle of the users registry stands for its address) since the scenario began; the step waits for it to arrive.
Examples
Then an email with the subject "order has been received" should be sent to "guest@example.com"
And an email with the subject "New order" should be sent to "shop_manager"
Then an email with the subject "is on its way" should be sent to "customer"
And an email with the subject "has been received" should be sent to "customer"
Then an email with the subject "New order #" should be sent to "shop_manager@example.com"
Pattern
Then(/^an email with the subject "([^"]*)" should be sent to "([^"]*)"$/, …)
Part of @webship-js/woocommerce-steps (github.com/webship/woocommerce-steps), a step pack for Webship-js 2.0.x.