Skip to content

Commit

Permalink
ajax waits
Browse files Browse the repository at this point in the history
  • Loading branch information
ol0lll committed Sep 3, 2024
1 parent dbbceed commit 0d5f88e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tests/src/FunctionalJavascript/MediaGalleryModifyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
1 change: 0 additions & 1 deletion tests/src/FunctionalJavascript/ThunderArticleTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ public function setFieldValue(string $fieldName, $value): void {
$this->scrollElementInView('[name="' . $fieldName . '"]');
$page->fillField($fieldName, $value);

$this->assertWaitOnAjaxRequest();
}

/**
Expand Down

0 comments on commit 0d5f88e

Please sign in to comment.