function 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 1320

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');
}

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