[MQ-110] tests image widget drag-n-drop
This commit is contained in:
@ -140,6 +140,7 @@ Module.ImageBlockSettingsView = base.BlockSettingsView.extend({
|
|||||||
});
|
});
|
||||||
|
|
||||||
ImageWidgetView = base.WidgetView.extend({
|
ImageWidgetView = base.WidgetView.extend({
|
||||||
|
id: 'automation_editor_block_image',
|
||||||
getTemplate: function () { return window.templates.imageInsertion; },
|
getTemplate: function () { return window.templates.imageInsertion; },
|
||||||
behaviors: {
|
behaviors: {
|
||||||
DraggableBehavior: {
|
DraggableBehavior: {
|
||||||
|
BIN
tests/_data/unicornsplaceholder.png
Normal file
BIN
tests/_data/unicornsplaceholder.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 109 KiB |
34
tests/acceptance/EditorImageBlockCest.php
Normal file
34
tests/acceptance/EditorImageBlockCest.php
Normal 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');
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user