function MediaLibraryTestBase::saveAnd

Same name in other branches
  1. 9 core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php \Drupal\Tests\media_library\FunctionalJavascript\MediaLibraryTestBase::saveAnd()
  2. 8.9.x core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php \Drupal\Tests\media_library\FunctionalJavascript\MediaLibraryTestBase::saveAnd()
  3. 10 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.

4 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.
WidgetOverflowTest::testUnlimitedCardinality in core/modules/media_library/tests/src/FunctionalJavascript/WidgetOverflowTest.php
Tests that unlimited fields' selection count is not constrained.
WidgetOverflowTest::testWidgetOverflow in core/modules/media_library/tests/src/FunctionalJavascript/WidgetOverflowTest.php
Tests that the Media Library constrains the number of selected items.
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 233

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.