You are here

protected function FeatureContext::getWysiwygInstance 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::getWysiwygInstance()
  2. 8.3 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::getWysiwygInstance()
  3. 8.4 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::getWysiwygInstance()
  4. 8.5 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::getWysiwygInstance()
  5. 8.7 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::getWysiwygInstance()
  6. 8.8 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::getWysiwygInstance()
  7. 10.3.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::getWysiwygInstance()
  8. 10.0.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::getWysiwygInstance()
  9. 10.1.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::getWysiwygInstance()
  10. 10.2.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::getWysiwygInstance()

Get the wysiwyg instance variable to use in Javascript.

Parameters

string: The instanceId used by the WYSIWYG module to identify the instance.

Return value

string A Javascript expression representing the WYSIWYG instance.

Throws

Exception Throws an exception if the editor does not exist.

1 call to FeatureContext::getWysiwygInstance()
FeatureContext::iFillInTheWysiwygEditor in tests/behat/features/bootstrap/FeatureContext.php
@When /^I fill in the "([^"]*)" WYSIWYG editor with "([^"]*)"$/

File

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

Class

FeatureContext
Defines application features from the specific context.

Namespace

Drupal\social\Behat

Code

protected function getWysiwygInstance($instanceId) {
  $instance = "CKEDITOR.instances['{$instanceId}']";
  if (!$this
    ->getSession()
    ->evaluateScript("return !!{$instance}")) {
    throw new \Exception(sprintf('The editor "%s" was not found on the page %s', $instanceId, $this
      ->getSession()
      ->getCurrentUrl()));
  }
  return $instance;
}