Webtest fixes
authorColeman Watts <coleman@civicrm.org>
Sun, 14 Sep 2014 01:40:53 +0000 (21:40 -0400)
committerColeman Watts <coleman@civicrm.org>
Sun, 14 Sep 2014 01:40:53 +0000 (21:40 -0400)
tests/phpunit/CiviTest/CiviSeleniumTestCase.php
tests/phpunit/WebTest/Contact/AdvancedSearchTest.php
tests/phpunit/WebTest/Contact/ContactTagTest.php
tests/phpunit/WebTest/Contact/SearchTest.php

index 65889ae620060995e1fd70cadd1a0db7b2f7f757..785feee753a33133067b7e516c044f134fd6e246 100644 (file)
@@ -2134,6 +2134,13 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
       $this->assertElementContainsText("xpath=//*[@id='$fieldid']/preceding-sibling::div[1]/", $value);
     }
   }
+
+  /**
+   * Wait for unobtrusive status message as set by CRM.status
+   */
+  function waitForStatusMsg() {
+    $this->waitForElementPresent("css=.crm-status-box-outer.status-success");
+  }
   
   /**
    * function to enable or disable Pop-ups via Display Preferences
@@ -2150,7 +2157,6 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
     else {
       $this->assertNotChecked('ajaxPopupsEnabled');
     }
-    $this->click("_qf_Display_next-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());    
+    $this->clickLink("_qf_Display_next-bottom");
   }
 }
index 9d5ad0fb94405a2de751c49c74a5f7a746eb90b8..7685a3b64c194c21bafecac3c49ad27033a0b938 100644 (file)
@@ -65,11 +65,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase {
     $this->click("css=li#tab_tag a");
     $this->waitForElementPresent("css=div#tagtree");
     $this->click("xpath=//ul/li/span/label[text()=\"$tagName\"]");
-    $this->waitForElementPresent("css=.success");
-
-    // is status message correct?
-    $this->waitForTextPresent("Saved");
-    $this->waitForText('crm-notification-container', "Saved");
+    $this->waitForStatusMsg();
 
     // go to event tab and register for event ( auto add activity and contribution )
     $this->click("css=li#tab_participant a");
index dcf4d0ec2d810d75c9246dc8cce35e51f02787ae..41ee7ad46c1ef6500f71c6989d05ce0f62d6bda7 100644 (file)
@@ -73,10 +73,7 @@ class WebTest_Contact_ContactTagTest extends CiviSeleniumTestCase {
 
     // check tag we have created
     $this->click("xpath=//ul/li/span/label[text()=\"$tagName\"]");
-    $this->waitForElementPresent("css=.success");
-
-    // Is status message correct?
-    $this->waitForText('crm-notification-container', "Saved");
+    $this->waitForStatusMsg();
   }
 
   function testTagSetContact() {
index fa51272095540c91b1c36494bb21e248c7162266..49722373328c313155c91984d70b2b0fe59a5564 100644 (file)
@@ -126,7 +126,7 @@ class WebTest_Contact_SearchTest extends CiviSeleniumTestCase {
 
     // select tag
     $this->click("xpath=//ul/li/span/label[text()=\"$tagName\"]");
-    $this->waitForElementPresent("css=.success");
+    $this->waitForStatusMsg();
 
     // visit contact search page
     $this->openCiviPage("contact/search", "reset=1");