Then the segment "Newsletter readers" should have 2 contacts

Assert the count of contacts a segment has, as the list of segments shows it ("View 2 Contacts"). A segment of filters is built by the site's scheduled tasks: the step opens the list again every five seconds until the count is there (180 seconds at most, SCHEDULED_TASKS_TIMEOUT), and fails with what it shows ("Building").

Examples

Then the segment "Newsletter readers" should have 2 contacts
Then the segment "Webship test segment" should have 1 contact
And the segment "Amman contacts" should have 2 contacts
Then the segment "Webship test segment" should have 0 contacts
Then the segment "Newsletter readers" should have 3 contacts

Pattern

Then(/^the segment "([^"]*)" should have (\d+) contacts?$/, …)

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