public function VarbaseContext::iClickOnCommandButtonInTheRichTextEditorField in Varbase: The Ultimate Drupal CMS Starter Kit (Bootstrap Ready) 8.8
Same name and namespace in other branches
- 8.4 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iClickOnCommandButtonInTheRichTextEditorField()
- 8.5 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iClickOnCommandButtonInTheRichTextEditorField()
- 8.6 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iClickOnCommandButtonInTheRichTextEditorField()
- 8.7 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iClickOnCommandButtonInTheRichTextEditorField()
- 9.0.x tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iClickOnCommandButtonInTheRichTextEditorField()
Click a command button in the rich text editor.
Varbase Context #varbase.
Example 1: When I click on "bold" command button in the rich text editor field "Body" Example 2: When I click on "media" command button in the rich text editor field "Body".
@When /^I click on "([^"]*)" command button in the rich text editor field "([^"]*)"$/
File
- tests/
features/ bootstrap/ VarbaseContext.php, line 538
Class
- VarbaseContext
- Defines application features from the specific context.
Code
public function iClickOnCommandButtonInTheRichTextEditorField($selectorCommand, $locator) {
$el = $this
->getSession()
->getPage()
->findField($locator);
$fieldId = $el
->getAttribute('id');
if (empty($fieldId)) {
throw new \Exception('Could not find an id for the rich text editor field : ' . $locator);
}
$this
->getSession()
->executeScript("CKEDITOR.instances[\"{$fieldId}\"].execCommand( '{$selectorCommand}' );");
}