You are here

public function WysiwygSubContext::assertContentInWysiwygEditor in Panopoly 7

Same name and namespace in other branches
  1. 8.2 modules/panopoly/panopoly_test/behat/steps/panopoly_test_wysiwyg.behat.inc \WysiwygSubContext::assertContentInWysiwygEditor()

@Then I should see :text in the :instanceId WYSIWYG editor

File

modules/panopoly/panopoly_test/behat/steps/panopoly_test_wysiwyg.behat.inc, line 172
Provide Behat step-definitions for WYSIWYG editor.

Class

WysiwygSubContext

Code

public function assertContentInWysiwygEditor($text, $instanceId) {
  $instance = $this
    ->getWysiwygInstance($instanceId);
  $content = $this
    ->evaluateScript("return {$instance}.getContent()");
  if (strpos($text, $content) === FALSE) {
    throw new \Exception(sprintf('The text "%s" was not found in the "%s" WYSWIYG editor on the page %s', $text, $instanceId, $this
      ->getSession()
      ->getCurrentUrl()));
  }
}