function MediaTest::waitForMetadataDialog

Waits for the form that allows editing metadata.

See also

\Drupal\media\Form\EditorMediaDialog

5 calls to MediaTest::waitForMetadataDialog()
MediaTest::openMetadataDialog in core/modules/ckeditor/tests/src/FunctionalJavascript/MediaTest.php
Clicks the `Edit media` button and waits for the metadata dialog.
MediaTest::openMetadataDialogWithKeyPress in core/modules/ckeditor/tests/src/FunctionalJavascript/MediaTest.php
Focuses on `Edit media` button and presses the given key.
MediaTest::testDialogAccess in core/modules/ckeditor/tests/src/FunctionalJavascript/MediaTest.php
Tests the EditorMediaDialog's form elements' #access logic.
MediaTest::testTranslationAlt in core/modules/ckeditor/tests/src/FunctionalJavascript/MediaTest.php
Tests that dialog loads appropriate translation's alt text.
MediaTest::testViewMode in core/modules/ckeditor/tests/src/FunctionalJavascript/MediaTest.php
Tests the EditorMediaDialog can set the data-view-mode attribute.

File

core/modules/ckeditor/tests/src/FunctionalJavascript/MediaTest.php, line 1348

Class

MediaTest
@coversDefaultClass \Drupal\ckeditor\Plugin\CKEditorPlugin\DrupalMedia @group ckeditor @group legacy

Namespace

Drupal\Tests\ckeditor\FunctionalJavascript

Code

protected function waitForMetadataDialog() {
    $page = $this->getSession()
        ->getPage();
    $this->getSession()
        ->switchToIFrame();
    // Wait for the dialog to open.
    $result = $page->waitFor(10, function ($page) {
        $metadata_editor = $page->find('css', 'form.editor-media-dialog');
        return !empty($metadata_editor);
    });
    $this->assertTrue($result);
}

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