Merge pull request #71 from dpradeep/merge-20140930
[civicrm-core.git] / tests / phpunit / WebTest / Contact / SearchTest.php
index 57e282a6ab4552f8ba34226b7c46590a19e78f1d..23009ca26a3f846976a319a0bd0f0208f19dfc47 100644 (file)
@@ -54,10 +54,10 @@ class WebTest_Contact_SearchTest extends CiviSeleniumTestCase {
     $this->typeKeys("css=input#sort_name_navigation", $sortName);
 
     // wait for result list
-    $this->waitForElementPresent("xpath=//*[@id='ui-id-1']/li");
+    $this->waitForElementPresent("xpath=//li[contains(text(), '$sortName :: $firstName.anderson@example.org')]");
 
     // visit contact summary page
-    $this->click("xpath=//*[@id='ui-id-1']/li");
+    $this->click("xpath=//li[contains(text(), '$sortName :: $firstName.anderson@example.org')]");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     // Is contact present?
@@ -125,8 +125,8 @@ class WebTest_Contact_SearchTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent("css=div#tagtree");
 
     // select tag
-    $this->click("xpath=//ul/li/label[text()=\"$tagName\"]");
-    $this->waitForElementPresent("css=.success");
+    $this->click("xpath=//ul/li/span/label[text()=\"$tagName\"]");
+    $this->checkCRMStatus();
 
     // visit contact search page
     $this->openCiviPage("contact/search", "reset=1");
@@ -236,8 +236,7 @@ class WebTest_Contact_SearchTest extends CiviSeleniumTestCase {
     $this->select("group", "label=$parentGroupName");
 
     // click to search
-    $this->click("_qf_Basic_refresh");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->clickLink("_qf_Basic_refresh");
 
     // Is contact present in search result?
     $this->assertElementContainsText('css=.crm-search-results > table.row-highlight', $sortName);
@@ -249,7 +248,6 @@ class WebTest_Contact_SearchTest extends CiviSeleniumTestCase {
     // Select the task action to export
     $this->click("task");
     $this->select("task", "label=Export Contacts");
-    $this->click("Go");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     $this->click("_qf_Select_next-bottom");