withName($segmentName)->create(); $subscriberFactory = new Subscriber(); $subscriberFactory->withSegments([$segment])->withEmail('one@fake.fake')->create(); $subscriberFactory->withSegments([$segment])->withEmail('two@fake.fake')->create(); $subscriberFactory->withSegments([$segment])->withEmail('three@fake.fake')->create(); $i->wantTo('Export a list of subscribers'); $i->login(); $i->amOnMailPoetPage('Subscribers'); //export those users $i->click(['xpath' => '//*[@id="mailpoet_export_button"]']); //choose new list $i->selectOptionInSelect2($segmentName); //export $i->click('.button-primary.mailpoet_export_process'); $i->waitForText('3 subscribers were exported. Get the exported file here.'); $i->seeNoJSErrors(); } }