Files
piratepoet/tests/acceptance/ExportSubscribersCest.php
Jan Jakeš 54549ff037 Convert variable names to camel case
[MAILPOET-1796]
2020-01-14 15:22:42 +01:00

30 lines
1.1 KiB
PHP

<?php
namespace MailPoet\Test\Acceptance;
use MailPoet\Test\DataFactories\Segment;
use MailPoet\Test\DataFactories\Subscriber;
class ExportSubscribersCest {
public function exportSubscribers(\AcceptanceTester $i) {
$segmentFactory = new Segment();
$segmentName = 'Hobbyists';
$segment = $segmentFactory->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();
}
}