Test that settings close when another block is clicked

[MAILPOET-1974]
This commit is contained in:
Ján Mikláš
2019-05-02 16:22:16 +02:00
committed by M. Shull
parent cfb4861ac5
commit e6c0de9deb
2 changed files with 415 additions and 1 deletions

View File

@ -9,13 +9,18 @@ require_once __DIR__ . '/../DataFactories/Newsletter.php';
class EditorSettingsBehaviourCest {
const ALC_OVERLAY_SELECTOR = '[data-automation-id="alc_overlay"]';
const BUTTON_SELECTOR = 'Click me';
const DUPLICATE_BUTTON_SELECTOR = '[data-automation-id="duplicate_tool"]';
const SETTINGS_PANEL_SELECTOR = '#mailpoet_panel';
function testSettingsBehaviour(\AcceptanceTester $I) {
$I->wantTo('Test settings behaviour');
$newsletterTitle = 'Settings Newsletter';
(new Newsletter())->withSubject($newsletterTitle)->create();
(new Newsletter())
->withSubject($newsletterTitle)
->loadBodyFrom('newsletterWithALCAndButton.json')
->withSubject($newsletterTitle)
->create();
$I->login();
$I->amOnMailpoetPage('Emails');
$I->waitForText($newsletterTitle);
@ -35,6 +40,13 @@ class EditorSettingsBehaviourCest {
// Check settings are closed when block is duplicated
$I->click(self::DUPLICATE_BUTTON_SELECTOR);
$I->waitForElementNotVisible(self::SETTINGS_PANEL_SELECTOR);
// Check settings are closed when clicked on another block
$I->click(self::ALC_OVERLAY_SELECTOR);
$I->waitForElementVisible(self::SETTINGS_PANEL_SELECTOR);
$I->wait(0.35); // CSS animation
$I->click(self::BUTTON_SELECTOR);
$I->waitForElementNotVisible(self::SETTINGS_PANEL_SELECTOR);
}
}