diff --git a/tests/src/FunctionalJavascript/ParagraphsFeaturesAddInBetweenTest.php b/tests/src/FunctionalJavascript/ParagraphsFeaturesAddInBetweenTest.php index 185dec1..329580e 100644 --- a/tests/src/FunctionalJavascript/ParagraphsFeaturesAddInBetweenTest.php +++ b/tests/src/FunctionalJavascript/ParagraphsFeaturesAddInBetweenTest.php @@ -37,8 +37,6 @@ public function testAddInBetweenFeature() { // Check that add in between option is available for modal add mode. $page->selectFieldOption('fields[field_paragraphs][settings_edit_form][settings][add_mode]', 'modal'); $session->executeScript("jQuery('[name=\"fields[field_paragraphs][settings_edit_form][settings][add_mode]\"]').trigger('change');"); - $this->assertSession()->assertWaitOnAjaxRequest(); - $is_option_visible = $session->evaluateScript("Array.from(document.querySelectorAll('.paragraphs-features__add-in-between__option')).filter((item) => { return !item.disabled }).length === 1"); $this->assertEquals(TRUE, $is_option_visible, 'After modal add mode is selected, "add in between" option should be available.'); $page->checkField('fields[field_paragraphs][settings_edit_form][third_party_settings][paragraphs_features][add_in_between]'); @@ -49,7 +47,6 @@ public function testAddInBetweenFeature() { // Check that add in between option is not available for non modal add mode. $page->selectFieldOption('fields[field_paragraphs][settings_edit_form][settings][add_mode]', 'dropdown'); $session->executeScript("jQuery('[name=\"fields[field_paragraphs][settings_edit_form][settings][add_mode]\"]').trigger('change');"); - $this->assertSession()->assertWaitOnAjaxRequest(); $is_option_visible = $session->evaluateScript("Array.from(document.querySelectorAll('.paragraphs-features__add-in-between__option')).filter((item) => { return item.offsetParent }).length === 0"); $this->assertEquals(TRUE, $is_option_visible, 'After add mode is change to non modal, "add in between" option should not be visible.'); @@ -59,9 +56,7 @@ public function testAddInBetweenFeature() { // Set modal add mode without add in between option. $page->selectFieldOption('fields[field_paragraphs][settings_edit_form][settings][add_mode]', 'modal'); $session->executeScript("jQuery('[name=\"fields[field_paragraphs][settings_edit_form][settings][add_mode]\"]').trigger('change');"); - $this->assertSession()->assertWaitOnAjaxRequest(); $page->uncheckField('fields[field_paragraphs][settings_edit_form][third_party_settings][paragraphs_features][add_in_between]'); - $this->assertSession()->assertWaitOnAjaxRequest(); $this->submitForm([], 'Update'); $this->assertSession()->assertWaitOnAjaxRequest(); @@ -107,21 +102,18 @@ public function testAddInBetweenFeature() { // Check first add in between button. $page->find('xpath', '(//*[contains(concat(" ", normalize-space(@class), " "), " paragraphs-features__add-in-between__button ")])[1]')->click(); - $this->assertSession()->assertWaitOnAjaxRequest(); $this->assertSession()->hiddenFieldValueEquals('field_paragraphs[add_more][add_more_delta]', '0'); $page->find('xpath', '//*[contains(@class, "paragraphs-add-dialog") and contains(@class, "ui-dialog-content")]//*[contains(@name, "test_1")]')->click(); $this->assertSession()->assertWaitOnAjaxRequest(); // Check last add in between button. $this->scrollClick('xpath', '(//*[contains(@class, "paragraphs-features__add-in-between__button ")])[last()]'); - $this->assertSession()->assertWaitOnAjaxRequest(); $this->assertSession()->hiddenFieldValueEquals('field_paragraphs[add_more][add_more_delta]', '2'); $page->find('xpath', '//*[contains(@class, "paragraphs-add-dialog") and contains(@class, "ui-dialog-content")]//*[contains(@name, "test_1")]')->click(); $this->assertSession()->assertWaitOnAjaxRequest(); // Check add in between button between existing paragraphs. $page->find('xpath', '(//*[contains(@class, "paragraphs-features__add-in-between__button ")])[3]')->click(); - $this->assertSession()->assertWaitOnAjaxRequest(); $this->assertSession()->hiddenFieldValueEquals('field_paragraphs[add_more][add_more_delta]', '2'); $page->find('xpath', '//*[contains(@class, "paragraphs-add-dialog") and contains(@class, "ui-dialog-content")]//*[contains(@name, "test_1")]')->click(); $this->assertSession()->assertWaitOnAjaxRequest(); @@ -151,7 +143,6 @@ public function testAddInBetweenFeature() { $this->assertSession()->assertWaitOnAjaxRequest(); $page->selectFieldOption('fields[field_paragraphs][settings_edit_form][settings][add_mode]', 'modal'); $session->executeScript("jQuery('[name=\"fields[field_paragraphs][settings_edit_form][settings][add_mode]\"]').trigger('change');"); - $this->assertSession()->assertWaitOnAjaxRequest(); $page->checkField('fields[field_paragraphs][settings_edit_form][third_party_settings][paragraphs_features][add_in_between]'); $page->fillField('fields[field_paragraphs][settings_edit_form][third_party_settings][paragraphs_features][add_in_between_link_count]', '0'); $this->submitForm([], 'Update'); @@ -178,21 +169,18 @@ public function testAddInBetweenFeature() { // Check first add in between button. $page->find('xpath', '(//*[contains(concat(" ", normalize-space(@class), " "), " paragraphs-features__add-in-between__button ")])[1]')->click(); - $this->assertSession()->assertWaitOnAjaxRequest(); $this->assertSession()->hiddenFieldValueEquals('field_paragraphs[0][subform][field_paragraphs][add_more][add_more_delta]', '0'); $page->find('xpath', '//*[contains(@class, "paragraphs-add-dialog") and contains(@class, "ui-dialog-content")]//*[contains(@name, "test_1")]')->click(); $this->assertSession()->assertWaitOnAjaxRequest(); // Check last add in between button. $this->scrollClick('xpath', '(//*[contains(concat(" ", normalize-space(@class), " "), " paragraphs-features__add-in-between__button ")])[last()]'); - $this->assertSession()->assertWaitOnAjaxRequest(); $this->assertSession()->hiddenFieldValueEquals('field_paragraphs[0][subform][field_paragraphs][add_more][add_more_delta]', '1'); $page->find('xpath', '//*[contains(@class, "paragraphs-add-dialog") and contains(@class, "ui-dialog-content")]//*[contains(@name, "test_1")]')->click(); $this->assertSession()->assertWaitOnAjaxRequest(); // Check add in between button between existing paragraphs. $page->find('xpath', '(//*[contains(concat(" ", normalize-space(@class), " "), " paragraphs-features__add-in-between__button ")])[2]')->click(); - $this->assertSession()->assertWaitOnAjaxRequest(); $this->assertSession()->hiddenFieldValueEquals('field_paragraphs[0][subform][field_paragraphs][add_more][add_more_delta]', '1'); $page->find('xpath', '//*[contains(@class, "paragraphs-add-dialog") and contains(@class, "ui-dialog-content")]//*[contains(@name, "test_1")]')->click(); $this->assertSession()->assertWaitOnAjaxRequest(); @@ -209,7 +197,6 @@ public function testAddInBetweenFeature() { // Check status after cardinality is exceeded. $page->find('xpath', '(//*[contains(concat(" ", normalize-space(@class), " "), " paragraphs-features__add-in-between__button ")])[2]')->click(); - $this->assertSession()->assertWaitOnAjaxRequest(); $page->find('xpath', '//*[contains(@class, "paragraphs-add-dialog") and contains(@class, "ui-dialog-content")]//*[contains(@name, "test_1")]')->click(); $this->assertSession()->assertWaitOnAjaxRequest(); diff --git a/tests/src/FunctionalJavascript/ParagraphsFeaturesExtendedParagraphsWidgetTest.php b/tests/src/FunctionalJavascript/ParagraphsFeaturesExtendedParagraphsWidgetTest.php index cd414f7..1f1585b 100644 --- a/tests/src/FunctionalJavascript/ParagraphsFeaturesExtendedParagraphsWidgetTest.php +++ b/tests/src/FunctionalJavascript/ParagraphsFeaturesExtendedParagraphsWidgetTest.php @@ -39,7 +39,6 @@ public function testAddInBetweenFeature() { // Check that add in between option is available for modal add mode. $page->selectFieldOption('fields[field_paragraphs][settings_edit_form][settings][add_mode]', 'modal'); $session->executeScript("jQuery('[name=\"fields[field_paragraphs][settings_edit_form][settings][add_mode]\"]').trigger('change');"); - $this->assertSession()->assertWaitOnAjaxRequest(); $is_option_visible = $session->evaluateScript("Array.from(document.querySelectorAll('.paragraphs-features__add-in-between__option')).filter((item) => { return item.offsetParent }).length === 2"); $this->assertEquals(TRUE, $is_option_visible, 'After modal add mode is selected, "add in between" option should be available.'); $page->checkField('fields[field_paragraphs][settings_edit_form][third_party_settings][paragraphs_features][add_in_between]'); @@ -75,21 +74,18 @@ public function testAddInBetweenFeature() { // Check first add in between button. $page->find('xpath', '(//*[contains(@class, "paragraphs-features__add-in-between__button")])[1]')->click(); - $this->assertSession()->assertWaitOnAjaxRequest(); $this->assertSession()->hiddenFieldValueEquals('field_paragraphs[add_more][add_more_delta]', '0'); $page->find('xpath', '//*[contains(@class, "paragraphs-add-dialog") and contains(@class, "ui-dialog-content")]//*[contains(@name, "test_1")]')->click(); $this->assertSession()->assertWaitOnAjaxRequest(); // Check last add in between button. $this->scrollClick('xpath', '(//*[contains(@class, "paragraphs-features__add-in-between__button")])[last()]'); - $this->assertSession()->assertWaitOnAjaxRequest(); $this->assertSession()->hiddenFieldValueEquals('field_paragraphs[add_more][add_more_delta]', '2'); $page->find('xpath', '//*[contains(@class, "paragraphs-add-dialog") and contains(@class, "ui-dialog-content")]//*[contains(@name, "test_1")]')->click(); $this->assertSession()->assertWaitOnAjaxRequest(); // Check add in between button between existing paragraphs. $page->find('xpath', '(//*[contains(concat(" ", normalize-space(@class), " "), " paragraphs-features__add-in-between__button ")])[3]')->click(); - $this->assertSession()->assertWaitOnAjaxRequest(); $this->assertSession()->hiddenFieldValueEquals('field_paragraphs[add_more][add_more_delta]', '2'); $page->find('xpath', '//*[contains(@class, "paragraphs-add-dialog") and contains(@class, "ui-dialog-content")]//*[contains(@name, "test_1")]')->click(); $this->assertSession()->assertWaitOnAjaxRequest(); diff --git a/tests/src/FunctionalJavascript/ParagraphsFeaturesSplitTextTest.php b/tests/src/FunctionalJavascript/ParagraphsFeaturesSplitTextTest.php index 1c7a763..02f922d 100644 --- a/tests/src/FunctionalJavascript/ParagraphsFeaturesSplitTextTest.php +++ b/tests/src/FunctionalJavascript/ParagraphsFeaturesSplitTextTest.php @@ -142,7 +142,6 @@ public function testSplitTextFeature() { // Check that split text option is available for modal add mode. $page->selectFieldOption('fields[field_paragraphs][settings_edit_form][settings][add_mode]', 'modal'); $session->executeScript("jQuery('[name=\"fields[field_paragraphs][settings_edit_form][settings][add_mode]\"]').trigger('change');"); - $this->assertSession()->assertWaitOnAjaxRequest(); $this->submitForm([], 'Update'); $this->assertSession()->assertWaitOnAjaxRequest(); @@ -385,12 +384,10 @@ public function testSplitTextFeature() { // Set edit mode to closed. $page->selectFieldOption('fields[field_paragraphs][settings_edit_form][settings][edit_mode]', 'closed'); $session->executeScript("jQuery('[name=\"fields[field_paragraphs][settings_edit_form][settings][edit_mode]\"]').trigger('change');"); - $this->assertSession()->assertWaitOnAjaxRequest(); // Set auto-collapse mode. $page->selectFieldOption('fields[field_paragraphs][settings_edit_form][settings][autocollapse]', 'all'); $session->executeScript("jQuery('[name=\"fields[field_paragraphs][settings_edit_form][settings][autocollapse]\"]').trigger('change');"); - $this->assertSession()->assertWaitOnAjaxRequest(); $this->submitForm([], 'Update'); $this->assertSession()->assertWaitOnAjaxRequest(); @@ -439,12 +436,10 @@ public function testSplitTextFeature() { // Disable auto-collapse. $page->selectFieldOption('fields[field_paragraphs][settings_edit_form][settings][autocollapse]', 'none'); $session->executeScript("jQuery('[name=\"fields[field_paragraphs][settings_edit_form][settings][autocollapse]\"]').trigger('change');"); - $this->assertSession()->assertWaitOnAjaxRequest(); // Set edit mode to open. $page->selectFieldOption('fields[field_paragraphs][settings_edit_form][settings][edit_mode]', 'open'); $session->executeScript("jQuery('[name=\"fields[field_paragraphs][settings_edit_form][settings][edit_mode]\"]').trigger('change');"); - $this->assertSession()->assertWaitOnAjaxRequest(); $this->submitForm([], 'Update'); $this->assertSession()->assertWaitOnAjaxRequest(); @@ -507,7 +502,6 @@ public function testSplitTwice() { // Check that split text option is available for modal add mode. $page->selectFieldOption('fields[field_paragraphs][settings_edit_form][settings][add_mode]', 'modal'); $session->executeScript("jQuery('[name=\"fields[field_paragraphs][settings_edit_form][settings][add_mode]\"]').trigger('change');"); - $this->assertSession()->assertWaitOnAjaxRequest(); $this->submitForm([], 'Update'); $this->assertSession()->assertWaitOnAjaxRequest();