public function FeatureContext::iFillInTheWysiwygEditor in Open Social 8
Same name and namespace in other branches
- 8.2 tests/behat/features/bootstrap/FeatureContext.php \FeatureContext::iFillInTheWysiwygEditor()
@When /^I fill in the "([^"]*)" WYSIWYG editor with "([^"]*)"$/
File
- tests/
behat/ features/ bootstrap/ FeatureContext.php, line 82
Class
- FeatureContext
- Defines application features from the specific context.
Code
public function iFillInTheWysiwygEditor($locator, $text) {
$field = $this
->getSession()
->getPage()
->findField($locator);
if (null === $field) {
throw new ElementNotFoundException($this
->getDriver(), 'form field', 'id|name|label|value|placeholder', $locator);
}
$id = $field
->getAttribute('id');
$instance = $this
->getWysiwygInstance($id);
$this
->getSession()
->executeScript("{$instance}.setData(\"{$text}\");");
}