Add acceptance test for free plan announcement

[MAILPOET-2051]
This commit is contained in:
Ján Mikláš
2019-05-15 15:36:14 +02:00
committed by M. Shull
parent 62052038af
commit 32bec92b04
2 changed files with 27 additions and 1 deletions

View File

@@ -27,7 +27,7 @@ class FreePlanAnnouncement extends React.Component {
return (
(!this.state.announcement_seen)
&& (
<div className="mailpoet_free_plan_announcement">
<div className="mailpoet_free_plan_announcement" data-automation-id="free-plan-announcement">
<h3>{MailPoet.I18n.t('freePlanTitle')}</h3>
<p>{MailPoet.I18n.t('freePlanDescription')}</p>
<a

View File

@@ -0,0 +1,26 @@
<?php
namespace MailPoet\Test\Acceptance;
use MailPoet\Features\FeaturesController;
use MailPoet\Test\DataFactories\Features;
require_once __DIR__ . '/../DataFactories/Features.php';
class FreePlanAnnouncementCest {
const NOTICE_SELECTOR = '[data-automation-id="free-plan-announcement"]';
function showAndCloseNotice(\AcceptanceTester $I) {
(new Features())->withFeatureEnabled(FeaturesController::FEATURE_NEW_FREE_PLAN);
$I->wantTo('Show and close free plan announcement');
$I->login();
$I->amOnMailPoetPage('Emails');
$I->waitForText('Add New');
$I->waitForElement(self::NOTICE_SELECTOR);
$I->click(self::NOTICE_SELECTOR . ' .notice-dismiss');
$I->waitForElementNotVisible(self::NOTICE_SELECTOR);
$I->amOnMailPoetPage('Emails');
$I->waitForText('Add New');
$I->waitForElementNotVisible(self::NOTICE_SELECTOR);
}
}