Files
piratepoet/tests/acceptance/EditorTextBlockCest.php
Jan Jakeš 54549ff037 Convert variable names to camel case
[MAILPOET-1796]
2020-01-14 15:22:42 +01:00

40 lines
1.4 KiB
PHP

<?php
namespace MailPoet\Test\Acceptance;
use MailPoet\Test\DataFactories\Newsletter;
class EditorTextBlockCest {
const TINYMCE_SELECTOR = '.tox-tinymce';
const TEXT_BLOCK_SELECTOR = '.mailpoet_text_block';
const CONTAINER_SELECTOR = '.mailpoet_container_horizontal';
public function addText(\AcceptanceTester $i) {
$i->wantTo('add Text block to newsletter');
$textInEditor = ('[data-automation-id="text_block_in_editor"]');
$newsletter = (new Newsletter())
->withSubject('Text Block Newsletter')
->loadBodyFrom('newsletterWithText.json')
->create();
$i->login();
$i->amEditingNewsletter($newsletter->id);
$i->dragAndDrop('#automation_editor_block_text', '#mce_1');
$i->waitForText('Edit this to insert text.');
}
public function toolbarIsClosing(\AcceptanceTester $i) {
$i->wantTo('Automatically close TinyMCE toolbar when clicked outside textarea');
$textInEditor = ('[data-automation-id="text_block_in_editor"]');
$newsletter = (new Newsletter())
->withSubject('TinyMCE toolbar Newsletter')
->loadBodyFrom('newsletterThreeCols.json')
->create();
$i->login();
$i->amEditingNewsletter($newsletter->id);
$i->click(self::TEXT_BLOCK_SELECTOR);
$i->waitForElementVisible(self::TINYMCE_SELECTOR);
$i->click(self::CONTAINER_SELECTOR);
$i->waitForElementNotVisible(self::TINYMCE_SELECTOR);
}
}