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); } }