From c1d1bf1422ea58af71b93c211e7a880c978a4ab2 Mon Sep 17 00:00:00 2001
From: Web Access <web@web-desktop.(none)>
Date: Thu, 27 Mar 2014 19:43:50 +0530
Subject: [PATCH] Webtest fixes

---
 tests/phpunit/CiviTest/CiviSeleniumTestCase.php      | 2 +-
 tests/phpunit/WebTest/Contact/AddTest.php            | 8 ++++++--
 tests/phpunit/WebTest/Contact/SearchBuilderTest.php  | 2 +-
 tests/phpunit/WebTest/Contribute/AddPricesetTest.php | 2 +-
 4 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php
index 7a7ce98c61..fa2273116b 100644
--- a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php
+++ b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php
@@ -1646,7 +1646,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
     else {
       $this->click("xpath=id('ltype')/div/table/tbody/tr/td[1][text()='$financialType[oldname]']/../td[7]/span/a[text()='Edit']");
     }
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->waitForElementPresent("name");
     $this->type('name', $financialType['name']);
     if ($option == 'new') {
       $this->type('description', $financialType['name'] . ' description');
diff --git a/tests/phpunit/WebTest/Contact/AddTest.php b/tests/phpunit/WebTest/Contact/AddTest.php
index 519273a768..66eeca074b 100644
--- a/tests/phpunit/WebTest/Contact/AddTest.php
+++ b/tests/phpunit/WebTest/Contact/AddTest.php
@@ -257,13 +257,17 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase {
     $this->select("preferred_language", "value=fr_FR");
 
     //Notes section
-    $this->click("notesBlock");
+    $this->clickAt("xpath=//div[text()='
+   
+    Notes
+  ']");
     $this->waitForElementPresent("subject");
     $this->type("subject", "Grant's note");
     $this->type("note", "This is a household contact webtest note.");
 
     // select group
-    $this->select("crmasmSelect0", "label=$groupName");
+    $this->clickAt("xpath=//div[text()='Tags and Groups']");
+    $this->select("group", "label=$groupName");
 
     //tags section
     $this->click("tag[{$this->webtestGetValidEntityID('Tag')}]");
diff --git a/tests/phpunit/WebTest/Contact/SearchBuilderTest.php b/tests/phpunit/WebTest/Contact/SearchBuilderTest.php
index 6a708b0405..e2892c3069 100644
--- a/tests/phpunit/WebTest/Contact/SearchBuilderTest.php
+++ b/tests/phpunit/WebTest/Contact/SearchBuilderTest.php
@@ -268,7 +268,7 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase {
     //advanced search by selecting the contactType
     $this->openCiviPage("contact/search/advanced", "reset=1");
     if (isset($contactType)) {
-      $this->select("id=crmasmSelect0", "value=$contactType");
+      $this->select("id=contact_type", "value=$contactType");
     }
     if (substr($field, 0, 5) == 'note_') {
       $this->click("notes");
diff --git a/tests/phpunit/WebTest/Contribute/AddPricesetTest.php b/tests/phpunit/WebTest/Contribute/AddPricesetTest.php
index 5aafe757b7..f53a0d92af 100644
--- a/tests/phpunit/WebTest/Contribute/AddPricesetTest.php
+++ b/tests/phpunit/WebTest/Contribute/AddPricesetTest.php
@@ -180,7 +180,7 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase {
     $this->openCiviPage("admin/price", "reset=1");
 
     // Use the price set id ($sid) to pick the correct row
-    $this->clickLink("css=tr#row_{$sid} a[title='View and Edit Price Fields']", 'Link=Add Price Field');
+    $this->clickLink("//*[@id='price_set-{$sid}']/td[4]/span[1]/a[1]", 'Link=Add Price Field');
     // Check for expected price set field strings
     $this->assertStringsPresent($validateStrings);
   }
-- 
GitLab