public function WysiwygSubContext::assertContentInWysiwygEditor in Panopoly 8.2
Same name and namespace in other branches
- 7 modules/panopoly/panopoly_test/behat/steps/panopoly_test_wysiwyg.behat.inc \WysiwygSubContext::assertContentInWysiwygEditor()
Asserts the text in a WYSIWYG editor.
@Then I should see :text in the :instanceId WYSIWYG editor
File
- modules/
panopoly/ panopoly_test/ behat/ steps/ panopoly_test_wysiwyg.behat.inc, line 265 - Provide Behat step-definitions for WYSIWYG editor.
Class
- WysiwygSubContext
- Behat subcontext for testing WYSIWYG.
Code
public function assertContentInWysiwygEditor($text, $instanceId) {
$instance = $this
->getWysiwygInstance($instanceId);
$content = $this
->getSession()
->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()));
}
}