[MQ-105] tests adding social block to editor

This commit is contained in:
Michelle Shull
2019-04-11 15:10:55 -04:00
committed by wxa
parent 1923005897
commit 7cb861b16a
4 changed files with 37 additions and 1 deletions

View File

@@ -270,6 +270,7 @@ SocialBlockSettingsStylesView = Marionette.View.extend({
});
Module.SocialWidgetView = base.WidgetView.extend({
id: 'automation_editor_block_social',
getTemplate: function () { return window.templates.socialInsertion; },
behaviors: {
DraggableBehavior: {

View File

@@ -0,0 +1,34 @@
<?php
namespace MailPoet\Test\Acceptance;
use MailPoet\Test\DataFactories\Newsletter;
require_once __DIR__ . '/../DataFactories/Newsletter.php';
class EditorSocialBlockCest {
function addSocialBlock(\AcceptanceTester $I) {
$I->wantTo('add social block to newsletter');
$newsletterTitle = 'Social Block Newsletter';
$socialBlockInEditor = ('[data-automation-id="socialBlock"]');
$socialBlockSettingsAssertion = ('[data-automation-id="social_select_another_network"]');
(new Newsletter())
->withSubject($newsletterTitle)
->loadBodyFrom('newsletterWithText.json')
->create();
$I->login();
$I->amOnMailpoetPage('Emails');
$I->waitForText($newsletterTitle);
$I->clickItemRowActionByItemName($newsletterTitle, 'Edit');
// Create social block
$I->waitForText('Social');
$I->wait(1); // just to be sure
$I->dragAndDrop('#automation_editor_block_social', '#mce_1');
//Open settings by clicking on block
$I->moveMouseOver($socialBlockInEditor, 3, 2);
$I->click($socialBlockInEditor);
$I->waitForElementVisible($socialBlockSettingsAssertion);
$I->click('Done');
}
}

View File

@@ -1,6 +1,7 @@
<div class="mailpoet_tools"></div>
<div
class="mailpoet_content mailpoet_social"
data-automation-id="socialBlock"
style="text-align: {{model.styles.block.textAlign}}"
>
</div>

View File

@@ -1,2 +1,2 @@
<div id="mailpoet_social_icon_selector_contents"></div>
<input type="button" class="button button-secondary mailpoet_button_full mailpoet_add_social_icon" value="<%= __('Add another social network') %>" />
<input type="button" class="button button-secondary mailpoet_button_full mailpoet_add_social_icon" data-automation-id='social_select_another_network' value="<%= __('Add another social network') %>" />