From 55f573617d23202b14a3ccbbf9b55a7cf321db1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lys=C3=BD?= Date: Thu, 19 Nov 2020 09:32:10 +0100 Subject: [PATCH] Add acceptance test for Undo and Redo [MAILPOET-3085] --- .../acceptance/FormEditorUndoAndRedoCest.php | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 tests/acceptance/FormEditorUndoAndRedoCest.php diff --git a/tests/acceptance/FormEditorUndoAndRedoCest.php b/tests/acceptance/FormEditorUndoAndRedoCest.php new file mode 100644 index 0000000000..bc0dc9a534 --- /dev/null +++ b/tests/acceptance/FormEditorUndoAndRedoCest.php @@ -0,0 +1,42 @@ +withName($segmentName)->create(); + $formName = 'My fancy form'; + $form = new Form(); + $form->withName($formName)->withSegments([$segment])->create(); + $i->wantTo('Add first and last name to the editor'); + $i->login(); + $i->amOnMailPoetPage('Forms'); + $i->waitForText($formName); + $i->clickItemRowActionByItemName($formName, 'Edit'); + $i->waitForElement('[data-automation-id="form_title_input"]'); + // Add First name block + $i->addFromBlockInEditor('First name'); + $firstNameSelector = '[data-automation-id="editor_first_name_input"]'; + $i->waitForElementVisible($firstNameSelector); + // Click on undo + $i->click('[data-automation-id="form_undo_button"]'); + $i->waitForElementNotVisible($firstNameSelector); + // Click on redo + $i->click('[data-automation-id="form_redo_button"]'); + $i->waitForElementVisible($firstNameSelector); + // Add Last name block + $i->addFromBlockInEditor('Last name'); + $lastNameSelector = '[data-automation-id="editor_last_name_input"]'; + $i->waitForElementVisible($lastNameSelector); + // Two clicks on undo and we should see form without last name and first name + $i->click('[data-automation-id="form_undo_button"]'); + $i->click('[data-automation-id="form_undo_button"]'); + $i->waitForElementNotVisible($lastNameSelector); + $i->waitForElementNotVisible($firstNameSelector); + } +}