From a5104db19ef94b4cdff143f09c5682cea75affa7 Mon Sep 17 00:00:00 2001 From: Killesreiter Volker Date: Wed, 4 Sep 2024 08:45:39 +0200 Subject: [PATCH] use expected wait --- tests/src/FunctionalJavascript/ImageUploadTest.php | 10 +++++----- .../ThunderMediaLibraryTestTrait.php | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/src/FunctionalJavascript/ImageUploadTest.php b/tests/src/FunctionalJavascript/ImageUploadTest.php index 0acdd3997..87abb0177 100644 --- a/tests/src/FunctionalJavascript/ImageUploadTest.php +++ b/tests/src/FunctionalJavascript/ImageUploadTest.php @@ -18,19 +18,19 @@ class ImageUploadTest extends ThunderJavascriptTestBase { */ public function testWebpImageUpload(): void { $this->drupalGet('node/add/article'); - $this->assertWaitOnAjaxRequest(); $this->openMediaLibrary('field-teaser-media'); $this->uploadFile(__DIR__ . '/../../fixtures/reference.webp', TRUE); $this->clickCssSelector('.media-library-widget-modal .form-actions button.button--primary'); - $this->assertWaitOnAjaxRequest(); + $this->assertExpectedAjaxRequest(1); $this->clickCssSelector('.media-library-widget-modal .form-actions button.button--primary'); + $this->assertExpectedAjaxRequest(1); - /** @var \Drupal\FunctionalJavascriptTests\WebDriverWebAssert $assert_session */ - $assert_session = $this->assertSession(); - $assert_session->assertExpectedAjaxRequest(1); +// /** @var \Drupal\FunctionalJavascriptTests\WebDriverWebAssert $assert_session */ +// $assert_session = $this->assertSession(); +// $assert_session->assertExpectedAjaxRequest(1); $this->assertSession()->elementTextContains('css', '.media-library-item__name', 'reference.webp'); } diff --git a/tests/src/FunctionalJavascript/ThunderMediaLibraryTestTrait.php b/tests/src/FunctionalJavascript/ThunderMediaLibraryTestTrait.php index a8a0c7b2d..3f02e2552 100644 --- a/tests/src/FunctionalJavascript/ThunderMediaLibraryTestTrait.php +++ b/tests/src/FunctionalJavascript/ThunderMediaLibraryTestTrait.php @@ -64,10 +64,10 @@ public function uploadFile(string $filePath, bool $skipEditForm = FALSE): void { '(typeof jQuery === "undefined" || !jQuery(\'input[name="op"]\').is(":disabled"))' ); - $this->assertWaitOnAjaxRequest(); + $this->assertExpectedAjaxRequest(1); if (!$skipEditForm) { $this->assertSession()->elementExists('css', '.ui-dialog-buttonpane')->pressButton('Save and select'); - $this->assertWaitOnAjaxRequest(); + $this->assertExpectedAjaxRequest(1); } }