function MediaTest::openMetadataDialogWithKeyPress

Focuses on `Edit media` button and presses the given key.

Parameters

int $char: The character code to press.

This method assumes that the calling code has already switched into the CKEditor iframe.

2 calls to MediaTest::openMetadataDialogWithKeyPress()
MediaTest::testAlt in core/modules/ckeditor/tests/src/FunctionalJavascript/MediaTest.php
Tests the EditorMediaDialog can set the alt attribute.
MediaTest::testEditableCaption in core/modules/ckeditor/tests/src/FunctionalJavascript/MediaTest.php
Tests caption editing in the CKEditor widget.

File

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

Class

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

Namespace

Drupal\Tests\ckeditor\FunctionalJavascript

Code

protected function openMetadataDialogWithKeyPress($char) {
    $this->assertNotEmpty($button = $this->assertSession()
        ->waitForButton('Edit media'));
    $button->keyDown($char);
    $this->waitForMetadataDialog();
}

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