From 0d5f88ea8bfc5d26c2684e7d8116025e5f55446c Mon Sep 17 00:00:00 2001 From: Killesreiter Volker Date: Tue, 3 Sep 2024 10:26:10 +0200 Subject: [PATCH] ajax waits --- tests/src/FunctionalJavascript/MediaGalleryModifyTest.php | 3 ++- tests/src/FunctionalJavascript/ThunderArticleTestTrait.php | 1 - tests/src/FunctionalJavascript/ThunderFormFieldTestTrait.php | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/src/FunctionalJavascript/MediaGalleryModifyTest.php b/tests/src/FunctionalJavascript/MediaGalleryModifyTest.php index 35b2bd615..6f791df5c 100644 --- a/tests/src/FunctionalJavascript/MediaGalleryModifyTest.php +++ b/tests/src/FunctionalJavascript/MediaGalleryModifyTest.php @@ -120,7 +120,8 @@ public function testAddRemove(): void { $this->uploadFile(__DIR__ . '/../../fixtures/reference.jpg', TRUE); - $this->submitMediaLibrary(); + $this->clickCssSelector('.media-library-widget-modal .form-actions button.button--primary'); + $this->assertWaitOnAjaxRequest(); // Move new image -> that's 5th image in list, to 3rd position. $this->sortableAfter('[data-media-library-item-delta="4"]', '[data-media-library-item-delta="1"]', '#field_media_images-media-library-wrapper-field_paragraphs-0-subform-field_media-0-inline_entity_form .js-media-library-selection'); diff --git a/tests/src/FunctionalJavascript/ThunderArticleTestTrait.php b/tests/src/FunctionalJavascript/ThunderArticleTestTrait.php index c09e8540d..e69bbd080 100644 --- a/tests/src/FunctionalJavascript/ThunderArticleTestTrait.php +++ b/tests/src/FunctionalJavascript/ThunderArticleTestTrait.php @@ -50,7 +50,6 @@ public function expandAllTabs(int $maxLevel = 3): void { $jsScript = "(() => { const elements = document.querySelectorAll('details.js-form-wrapper.form-wrapper:not([open]) > summary'); elements.forEach((elem) => { elem.click(); }); elements.length; })()"; $numOfOpen = $this->getSession()->evaluateScript($jsScript); - $this->assertWaitOnAjaxRequest(); for ($i = 0; $i < $maxLevel && $numOfOpen > 0; $i++) { $numOfOpen = $this->getSession()->evaluateScript($jsScript); diff --git a/tests/src/FunctionalJavascript/ThunderFormFieldTestTrait.php b/tests/src/FunctionalJavascript/ThunderFormFieldTestTrait.php index 6a6135ac7..366ca7c20 100644 --- a/tests/src/FunctionalJavascript/ThunderFormFieldTestTrait.php +++ b/tests/src/FunctionalJavascript/ThunderFormFieldTestTrait.php @@ -95,7 +95,6 @@ public function setFieldValue(string $fieldName, $value): void { $this->scrollElementInView('[name="' . $fieldName . '"]'); $page->fillField($fieldName, $value); - $this->assertWaitOnAjaxRequest(); } /**