Add acceptance test for free plan announcement
[MAILPOET-2051]
This commit is contained in:
@@ -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
|
||||
|
26
tests/acceptance/FreePlanAnnouncementCest.php
Normal file
26
tests/acceptance/FreePlanAnnouncementCest.php
Normal 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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user