function QuickEditJavascriptTestBase::typeInFormEditorTextInputField
Same name in other branches
- 8.9.x core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditJavascriptTestBase.php \Drupal\Tests\quickedit\FunctionalJavascript\QuickEditJavascriptTestBase::typeInFormEditorTextInputField()
Simulates typing in an input[type=text] inside a 'form' in-place editor.
Parameters
string $input_name: The "name" attribute of the input[type=text] to type in.
string $text: The text to type.
See also
\Drupal\quickedit\Plugin\InPlaceEditor\FormEditor
1 call to QuickEditJavascriptTestBase::typeInFormEditorTextInputField()
- LayoutBuilderIntegrationTest::testArticleNode in core/
modules/ quickedit/ tests/ src/ FunctionalJavascript/ LayoutBuilderIntegrationTest.php - Tests if an article node can be in-place edited with Quick Edit.
File
-
core/
modules/ quickedit/ tests/ src/ FunctionalJavascript/ QuickEditJavascriptTestBase.php, line 298
Class
- QuickEditJavascriptTestBase
- Base class for testing the QuickEdit.
Namespace
Drupal\Tests\quickedit\FunctionalJavascriptCode
protected function typeInFormEditorTextInputField($input_name, $text) {
$input = $this->cssSelect('.quickedit-form-container > .quickedit-form[role="dialog"] form.quickedit-field-form input[type=text][name="' . $input_name . '"]')[0];
$input->setValue($text);
$js_simulate_user_typing = <<<JS
function () {
var el = document.querySelector('.quickedit-form-container > .quickedit-form[role="dialog"] form.quickedit-field-form input[name="{<span class="php-variable">$input_name</span>}"]');
window.jQuery(el).trigger('formUpdated');
}()
JS;
$this->getSession()
->evaluateScript($js_simulate_user_typing);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.