public function ThunderJavascriptTestBase::selectCkEditorElement in Thunder 8.5
Same name and namespace in other branches
- 8.2 tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::selectCkEditorElement()
- 8.3 tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::selectCkEditorElement()
- 8.4 tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::selectCkEditorElement()
- 6.2.x tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::selectCkEditorElement()
- 6.0.x tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::selectCkEditorElement()
- 6.1.x tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::selectCkEditorElement()
Select CKEditor element.
Parameters
string $ckEditorCssSelector: CSS selector for CKEditor.
int $childIndex: The child index under the node.
3 calls to ThunderJavascriptTestBase::selectCkEditorElement()
- ParagraphSplitTest::testAddParagraphAfterSplitDataLoss in tests/
src/ FunctionalJavascript/ Integration/ ParagraphSplitTest.php - Test if a adding paragraph after split leads to data loss.
- ParagraphSplitTest::testParagraphSplitBefore in tests/
src/ FunctionalJavascript/ Integration/ ParagraphSplitTest.php - Test split of paragraph before a selection.
- ParagraphSplitTest::testParagraphSplitDataLoss in tests/
src/ FunctionalJavascript/ Integration/ ParagraphSplitTest.php - Test if a deleted paragraph leads to data loss.
File
- tests/
src/ FunctionalJavascript/ ThunderJavascriptTestBase.php, line 308
Class
- ThunderJavascriptTestBase
- Base class for Thunder Javascript functional tests.
Namespace
Drupal\Tests\thunder\FunctionalJavascriptCode
public function selectCkEditorElement($ckEditorCssSelector, $childIndex) {
$ckEditorId = $this
->getCkEditorId($ckEditorCssSelector);
$this
->getSession()
->getDriver()
->executeScript("let selection = CKEDITOR.instances[\"{$ckEditorId}\"].getSelection(); selection.selectElement(selection.root.getChild({$childIndex})); var ranges = selection.getRanges(); ranges[0].setEndBefore(ranges[0].getBoundaryNodes().endNode); selection.selectRanges(ranges);");
}