32 lines
939 B
PHP
32 lines
939 B
PHP
<?php
|
|
|
|
namespace MailPoet\Test\Acceptance;
|
|
|
|
use MailPoet\Test\DataFactories\Newsletter;
|
|
|
|
class StatsPageCest {
|
|
|
|
function statsPage(\AcceptanceTester $I) {
|
|
$I->wantTo('Open stats page of a sent newsletter');
|
|
|
|
$newsletter_title = 'Stats Page Test';
|
|
(new Newsletter())->withSubject($newsletter_title)
|
|
->withSentStatus()
|
|
->withSendingQueue()
|
|
->create();
|
|
|
|
$I->login();
|
|
$I->amOnMailpoetPage('Emails');
|
|
$I->waitForText($newsletter_title);
|
|
$I->clickItemRowActionByItemName($newsletter_title, 'Statistics');
|
|
$I->waitForText('Stats: ' . $newsletter_title);
|
|
$I->see('Buy the Premium to see your stats');
|
|
|
|
$href = $I->grabAttributeFrom('//a[text()="Sign Up for Free"]', 'href');
|
|
expect($href)->equals('https://www.mailpoet.com/free-plan/');
|
|
$href = $I->grabAttributeFrom('//a[text()="Learn more about Premium"]', 'href');
|
|
expect($href)->endsWith('page=mailpoet-premium');
|
|
}
|
|
|
|
}
|