You are here

public function FeatureContext::iFillInTheWysiwygEditor in Open Social 8.6

Same name and namespace in other branches
  1. 8.9 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::iFillInTheWysiwygEditor()
  2. 8.3 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::iFillInTheWysiwygEditor()
  3. 8.4 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::iFillInTheWysiwygEditor()
  4. 8.5 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::iFillInTheWysiwygEditor()
  5. 8.7 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::iFillInTheWysiwygEditor()
  6. 8.8 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::iFillInTheWysiwygEditor()
  7. 10.3.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::iFillInTheWysiwygEditor()
  8. 10.0.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::iFillInTheWysiwygEditor()
  9. 10.1.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::iFillInTheWysiwygEditor()
  10. 10.2.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::iFillInTheWysiwygEditor()

@When /^I fill in the "([^"]*)" WYSIWYG editor with "([^"]*)"$/

File

tests/behat/features/bootstrap/FeatureContext.php, line 89

Class

FeatureContext
Defines application features from the specific context.

Namespace

Drupal\social\Behat

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}\");");
}