[MQ-110] tests image widget drag-n-drop

This commit is contained in:
Michelle Shull
2019-04-04 08:59:22 -04:00
committed by M. Shull
parent 19b1a6234f
commit a671aede6d
3 changed files with 35 additions and 0 deletions

View File

@ -140,6 +140,7 @@ Module.ImageBlockSettingsView = base.BlockSettingsView.extend({
});
ImageWidgetView = base.WidgetView.extend({
id: 'automation_editor_block_image',
getTemplate: function () { return window.templates.imageInsertion; },
behaviors: {
DraggableBehavior: {

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

View File

@ -0,0 +1,34 @@
<?php
namespace MailPoet\Test\Acceptance;
use MailPoet\Test\DataFactories\Newsletter;
require_once __DIR__ . '/../DataFactories/Newsletter.php';
class EditorImageBlockCest {
function addImage(\AcceptanceTester $I) {
$I->wantTo('add image block to newsletter');
$I->cli('media import /wp-core/wp-content/plugins/mailpoet/tests/_data/unicornsplaceholder.png --allow-root');
$newsletterTitle = 'Image Block Newsletter';
(new Newsletter())
->withSubject($newsletterTitle)
->loadBodyFrom('newsletterWithText.json')
->create();
$I->login();
$I->amOnMailpoetPage('Emails');
$I->waitForText($newsletterTitle);
$I->clickItemRowActionByItemName($newsletterTitle, 'Edit');
// Create image block
$I->waitForText('Image');
$I->wait(1); // just to be sure
$I->dragAndDrop('#automation_editor_block_image', '#mce_0');
$I->waitForText('Add images');
$I->click('Media Library');
$I->click('.thumbnail');
$I->waitForElementClickable('.media-button-insert', 10);
$I->click('Select Image');
$I->waitForText('IMAGE');
$I->click('Done');
}
}