You are here

protected function CKEditorIntegrationTest::fillFieldInMetadataDialogAndSubmit in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/media/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php \Drupal\Tests\media\FunctionalJavascript\CKEditorIntegrationTest::fillFieldInMetadataDialogAndSubmit()

Fills in a field in the metadata dialog for an embedded media item.

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

Parameters

string $locator: The field ID, name, or label.

string $value: The value to set on the field.

2 calls to CKEditorIntegrationTest::fillFieldInMetadataDialogAndSubmit()
CKEditorIntegrationTest::testAlignment in core/modules/media/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php
Tests alignment integration.
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 1323

Class

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

Namespace

Drupal\Tests\media\FunctionalJavascript

Code

protected function fillFieldInMetadataDialogAndSubmit($locator, $value) {

  // Wait for the drupal-media which holds the "Edit media" button which
  // opens the dialog.
  $this
    ->openMetadataDialog();
  $this
    ->getSession()
    ->getPage()
    ->fillField($locator, $value);
  $this
    ->submitDialog();

  // Since ::waitforMetadataDialog() switches back to the main iframe, we'll
  // need to switch back.
  $this
    ->getSession()
    ->switchToIFrame('ckeditor');
}