You are here

protected function MediaLibraryTestBase::saveAnd in Drupal 9

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()

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

Parameters

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

2 calls to MediaLibraryTestBase::saveAnd()
WidgetOEmbedTest::testWidgetOEmbedAdvancedUi in core/modules/media_library/tests/src/FunctionalJavascript/WidgetOEmbedTest.php
Tests that oEmbed media can be added in the widget's advanced UI.
WidgetUploadTest::testWidgetUploadAdvancedUi in core/modules/media_library/tests/src/FunctionalJavascript/WidgetUploadTest.php
Tests that uploads in the widget's advanced UI works as expected.

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