function MediaTest::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 MediaTest::fillFieldInMetadataDialogAndSubmit()
MediaTest::testAlignment in core/modules/ckeditor/tests/src/FunctionalJavascript/MediaTest.php
Tests alignment integration.
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 1370

Class

MediaTest
@coversDefaultClass \Drupal\ckeditor\Plugin\CKEditorPlugin\DrupalMedia[[api-linebreak]] @group ckeditor @group legacy

Namespace

Drupal\Tests\ckeditor\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');
}

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