You are here

protected function CKEditorIntegrationTest::openMetadataDialogWithKeyPress in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/media/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php \Drupal\Tests\media\FunctionalJavascript\CKEditorIntegrationTest::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 CKEditorIntegrationTest::openMetadataDialogWithKeyPress()
CKEditorIntegrationTest::testAlt in core/modules/media/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php
Tests the EditorMediaDialog can set the alt attribute.
CKEditorIntegrationTest::testEditableCaption in core/modules/media/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php
Tests caption editing in the CKEditor widget.

File

core/modules/media/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php, line 1391

Class

CKEditorIntegrationTest
@coversDefaultClass \Drupal\media\Plugin\CKEditorPlugin\DrupalMedia @group media

Namespace

Drupal\Tests\media\FunctionalJavascript

Code

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