Merge pull request #3731 from davecivicrm/CRM-15031
[civicrm-core.git] / tests / phpunit / CiviTest / CiviSeleniumTestCase.php
index f5a68ad68f70b2f03072f86fe1008e8e0524c396..14807d82dcea422b34ea4a0b0dec37bae99c9f23 100644 (file)
@@ -542,10 +542,13 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
    *
    * @return void
    */
-  function fillRichTextField($fieldName, $text = 'Typing this text into editor.', $editor = 'CKEditor') {
+  function fillRichTextField($fieldName, $text = 'Typing this text into editor.', $editor = 'CKEditor', $compressed = FALSE) {
     // make sure cursor focuses on the field
     $this->fireEvent($fieldName, 'focus');
     if ($editor == 'CKEditor') {
+      if ($compressed) {
+        $this->click("{$fieldName}-plain");        
+      }
       $this->waitForElementPresent("xpath=//div[@id='cke_{$fieldName}']//iframe");
       $this->runScript("CKEDITOR.instances['{$fieldName}'].setData('<p>{$text}</p>');");
     }