Merge pull request #4875 from civicrm/minor-fix
[civicrm-core.git] / tests / phpunit / WebTest / Contact / TagSetSearchTest.php
index b634c611199c3594a75d4b3a0599c372d61221ce..69aa3bc607c0b106f6f61e7f25bca3a48e483757 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
 */
 
 require_once 'CiviTest/CiviSeleniumTestCase.php';
+
+/**
+ * Class WebTest_Contact_TagSetSearchTest
+ */
 class WebTest_Contact_TagSetSearchTest extends CiviSeleniumTestCase {
 
   protected function setUp() {
     parent::setUp();
   }
 
-  function testTagSetSearch() {
+  public function testTagSetSearch() {
     $this->webtestLogin();
 
     $tagSet1 = $this->_testAddTagSet();
@@ -113,7 +117,7 @@ class WebTest_Contact_TagSetSearchTest extends CiviSeleniumTestCase {
   /**
    * @return array
    */
-  function _testAddTagSet() {
+  public function _testAddTagSet() {
     // Go to add tag set url.
     $this->openCiviPage('admin/tag', 'action=add&reset=1&tagset=1');
 
@@ -144,13 +148,12 @@ class WebTest_Contact_TagSetSearchTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent("css=table.display tbody tr td");
 
     // verify text
-    $this->waitForElementPresent("xpath=//table//tbody/tr/td[1][text()= '$tagSetName']");
+    $this->assertTrue($this->isTextPresent($tagSetName), 'Missing text: ' . $tagSetName);
 
-    $tagid = explode('&id=', $this->getAttribute("xpath=//table//tbody/tr/td[1][text()= '$tagSetName']/following-sibling::td[7]/span/a[text()= 'Edit']@href"));
+    $tagid = explode('&id=', $this->getAttribute("xpath=//table[@class='display dataTable no-footer']/tbody//tr/td[1]/div[text()= '$tagSetName']/../../td[8]/span/a[text()= 'Edit']@href"));
     $tagid = explode('&', $tagid[1]);
     $tagid = $tagid[0];
 
     return $tagid;
   }
 }
-