Merge pull request #6232 from sudhabisht/WebtestFix1
authorcolemanw <coleman@civicrm.org>
Thu, 16 Jul 2015 14:06:02 +0000 (10:06 -0400)
committercolemanw <coleman@civicrm.org>
Thu, 16 Jul 2015 14:06:02 +0000 (10:06 -0400)
Import and CKEditor webtest failure fix

tests/phpunit/CiviTest/CiviSeleniumTestCase.php
tests/phpunit/WebTest/Import/ImportCiviSeleniumTestCase.php

index 41b90aacd43494a2af9d1ed48fa8cc6a91e06018..cc518caba29a5cd37e50f9bb7c2097a1abe9c96d 100644 (file)
@@ -635,7 +635,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
     $this->fireEvent($fieldName, 'focus');
     if ($editor == 'CKEditor') {
       if ($compressed) {
-        $this->click("{$fieldName}-plain");
+        $this->click("xpath=//textarea[@id='{$fieldName}']/../div[1]");
       }
       $this->waitForElementPresent("xpath=//div[@id='cke_{$fieldName}']//iframe");
       $this->runScript("CKEDITOR.instances['{$fieldName}'].setData('<p>{$text}</p>');");
@@ -1369,7 +1369,6 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
 
     if ($widget) {
       // fill in step 8 (Widget Settings)
-      $this->waitForPageToLoad($this->getTimeoutMsec());
       $this->click('link=Widgets');
       $this->waitForElementPresent('_qf_Widget_next-bottom');
 
@@ -1389,7 +1388,6 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
 
     if ($pcp) {
       // fill in step 9 (Enable Personal Campaign Pages)
-      $this->waitForPageToLoad($this->getTimeoutMsec());
       $this->click('link=Personal Campaigns');
       $this->waitForElementPresent('_qf_Contribute_next-bottom');
       $this->click('pcp_active');
index bca68bcefb811d72b02349430ef8d84702487054..e9fb4b4ebbcdb2fe45233024953eefb1a820be9e 100644 (file)
@@ -362,7 +362,7 @@ class ImportCiviSeleniumTestCase extends CiviSeleniumTestCase {
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     // Check confirmation alert.
-    $this->assertTrue((bool) preg_match("/^Are you sure you want to Import now[\s\S]$/", $this->getConfirmation()));
+    $this->assertTrue((bool) preg_match("/^Backing up your database before importing is recommended, as there is no Undo for this. Are you sure you want to Import now[\s\S]$/", $this->getConfirmation()));
     $this->chooseOkOnNextConfirmation();
     $this->waitForPageToLoad($this->getTimeoutMsec());