Add acceptance test

This commit is contained in:
Amine Ben hammou
2019-08-21 12:26:35 +01:00
committed by M. Shull
parent d444a02feb
commit dfc7ffd4b6
2 changed files with 12 additions and 1 deletions

View File

@ -192,7 +192,7 @@ class NewsletterTypes extends React.Component {
</h3> </h3>
<p>{type.description}</p> <p>{type.description}</p>
{type.disabled && ( {type.disabled && (
<p> <p data-automation-id={`${type.slug}_premium_feature_notice`}>
<span style={{ color: 'red' }}>{MailPoet.I18n.t('premiumFeature')}</span> <span style={{ color: 'red' }}>{MailPoet.I18n.t('premiumFeature')}</span>
{' '} {' '}
<a href="?page=mailpoet-premium">{MailPoet.I18n.t('learnMore')}</a> <a href="?page=mailpoet-premium">{MailPoet.I18n.t('learnMore')}</a>

View File

@ -78,4 +78,15 @@ class NewsletterCreationCest {
$I->click('Send'); $I->click('Send');
} }
function seePremiumFeatureNotice(\AcceptanceTester $I) {
$I->wantTo('See the premium feature notice in the WooCommerce type');
$I->login();
$I->amOnMailpoetPage('Emails');
$I->click('[data-automation-id="new_email"]');
$premium_notice = '[data-automation-id="woocommerce_premium_feature_notice"]';
$I->waitForElement($premium_notice);
$I->see("This is a Premium feature.", $premium_notice);
}
} }