You are here

protected function MediaLibraryTestBase::saveAnd in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php \Drupal\Tests\media_library\FunctionalJavascript\MediaLibraryTestBase::saveAnd()
  2. 9 core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php \Drupal\Tests\media_library\FunctionalJavascript\MediaLibraryTestBase::saveAnd()

Clicks "Save and select||insert" button and waits for AJAX completion.

Parameters

string $operation: The final word of the button to be clicked.

File

core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php, line 231

Class

MediaLibraryTestBase
Base class for functional tests of Media Library functionality.

Namespace

Drupal\Tests\media_library\FunctionalJavascript

Code

protected function saveAnd($operation) {
  $this
    ->assertElementExistsAfterWait('css', '.ui-dialog-buttonpane')
    ->pressButton("Save and {$operation}");

  // assertWaitOnAjaxRequest() required for input "id" attributes to
  // consistently match their label's "for" attribute.
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
}