function QuickEditJavascriptTestBase::typeInPlainTextEditor

Same name and namespace in other branches
  1. 9 core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditJavascriptTestBase.php \Drupal\Tests\quickedit\FunctionalJavascript\QuickEditJavascriptTestBase::typeInPlainTextEditor()

Simulates typing in a 'plain_text' in-place editor.

Parameters

string $css_selector: The CSS selector to find the DOM element (with the 'contenteditable=true' attribute set), to type in.

string $text: The text to type.

See also

\Drupal\quickedit\Plugin\InPlaceEditor\PlainTextEditor

1 call to QuickEditJavascriptTestBase::typeInPlainTextEditor()
QuickEditIntegrationTest::testArticleNode in core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditIntegrationTest.php
Tests if an article node can be in-place edited with Quick Edit.

File

core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditJavascriptTestBase.php, line 291

Class

QuickEditJavascriptTestBase
Base class for testing the QuickEdit.

Namespace

Drupal\Tests\quickedit\FunctionalJavascript

Code

protected function typeInPlainTextEditor($css_selector, $text) {
    $field = $this->getSession()
        ->getPage()
        ->find('css', $css_selector);
    $field->setValue(Key::END . $text);
}

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