CRM-15031 Event Webtest Fix
[civicrm-core.git] / tests / phpunit / CiviTest / CiviSeleniumTestCase.php
index 1c1a6cd2d6b49ab4e066c309d8aaf034c24b3fd7..a8f3853ccb808620629d5c52d899e7d9fd662f1f 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>');");
     }
@@ -2080,7 +2083,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
 
       $fieldLabel = "custom_field_for_{$customSet['entity']}_{$customSet['subEntity']}" . substr(sha1(rand()), 0, 4);
       $this->type('label', $fieldLabel);
-      $this->click('_qf_Field_next-bottom');
+      $this->click('_qf_Field_next_new-bottom');
       $this->waitForPageToLoad($this->getTimeoutMsec());
       $customGroupTitle = preg_replace('/\s/', '_', trim($customGroupTitle));
 
@@ -2095,10 +2098,10 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
    */
   function select2($fieldName,$label, $multiple = FALSE, $xpath=FALSE) {
     if ($multiple) {
-      $this->clickAt("//*[@id='$fieldName']/../div/ul/li[1]");
-      $this->keyDown("//*[@id='$fieldName']/../div/ul/li[1]/input", " ");
-      $this->type("//*[@id='$fieldName']/../div/ul/li[1]/input", $label);
-      $this->typeKeys("//*[@id='$fieldName']/../div/ul/li[1]/input", $label);
+      $this->clickAt("//*[@id='$fieldName']/../div/ul/li");
+      $this->keyDown("//*[@id='$fieldName']/../div/ul/li//input", " ");
+      $this->type("//*[@id='$fieldName']/../div/ul/li//input", $label);
+      $this->typeKeys("//*[@id='$fieldName']/../div/ul/li//input", $label);
       $this->waitForElementPresent("//*[@class='select2-result-label']");
       $this->clickAt("//*[@class='select2-results']/li[1]/div");
     }