Use of flexible selectors
authorWeb Access <rohan.katkar@webaccessglobal.com>
Tue, 17 Mar 2015 10:14:30 +0000 (15:44 +0530)
committerWeb Access <rohan.katkar@webaccessglobal.com>
Tue, 17 Mar 2015 10:14:30 +0000 (15:44 +0530)
tests/phpunit/WebTest/Campaign/ActivityTest.php
tests/phpunit/WebTest/Campaign/MembershipTest.php
tests/phpunit/WebTest/Event/AddPricesetTest.php
tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php

index b8c015405b30446d91a1fffe9ffba38330f9a29a..8fb39de06cfdf2d764edb4465ea882e21ddd96ae 100644 (file)
@@ -199,8 +199,7 @@ class WebTest_Campaign_ActivityTest extends CiviSeleniumTestCase {
 
     // click through to the Activity view screen
     $this->click("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody//tr[2]/td[8]/span/a[text()='View']");
-    $this->waitForElementPresent('_qf_Activity_cancel-bottom');
-    $this->waitForElementPresent("xpath=//form[@id='Activity']/div[2]/table/tbody/tr[5]/td[2]/span");
+    $this->waitForElementPresent("xpath=//button//span[contains(text(),'Done')]");
 
     // verify Activity created
     $this->verifyText("xpath=//form[@id='Activity']/div[2]/table/tbody/tr[5]/td[2]/span", $campaignTitle);
index 27c82c6222b92306735ffda9302cb1ec7528a064..64077356702568604972869c0da4e5b9beb3dbd6 100644 (file)
@@ -103,9 +103,8 @@ class WebTest_Campaign_MembershipTest extends CiviSeleniumTestCase {
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     $this->waitForText('crm-notification-container', "Campaign $title");
-
-    $this->waitForElementPresent("//div[@id='campaignList']/div/table[@class='campaigns dataTable no-footer']/tbody/tr/td[3]/div[text()='{$campaignTitle}']/../../td[1]");
-    $id = (int) $this->getText("//div[@id='campaignList']/div/table[@class='campaigns dataTable no-footer']/tbody/tr/td[3]/div[text()='{$campaignTitle}']/../../td[1]");
+    $this->waitForElementPresent("//div[@id='campaignList']/div/table[@class='campaigns dataTable no-footer']/tbody//tr//td/div[contains(text(),'{$campaignTitle}')]/../../td[1]");
+    $id = (int) $this->getText("//div[@id='campaignList']/div/table[@class='campaigns dataTable no-footer']/tbody//tr//td/div[contains(text(),'{$campaignTitle}')]/../../td[1]");
     $this->memberAddTest($campaignTitle, $id);
   }
 
index c1b312d6bbd2591848f64a981bfa136e1918a8c5..a064bf28218ea0bbd869dd064c789a0f252703c0 100644 (file)
@@ -494,7 +494,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase {
 
     //click through to the participant view screen
     $this->click("xpath=//form[@class='CRM_Event_Form_Search crm-search-form']/table/tbody/tr[1]/td[8]/span/a[text()='View']");
-    $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button[3]/span[2]");
+    $this->waitForElementPresent("xpath=//button//span[contains(text(),'Done')]");
   }
 
   /**
index 27d349b477f0089050f7a0ccfba2af716328578a..204cb4600a1f5a8027f4b3c4cb24ea04f2043ef7 100644 (file)
@@ -95,13 +95,12 @@ class WebTest_Member_OfflineMembershipRenewTest extends CiviSeleniumTestCase {
 
     // page was loaded
     $this->waitForTextPresent($sourceText);
-
-    $this->waitForElementPresent("xpath=//div[@id='memberships']/div/table[@class='display dataTable no-footer']/tbody/tr/td[9]/span[1]/a[1][text()='View']");
+    $this->waitForElementPresent("xpath=//div[@id='memberships']/div//table//tbody/tr/td[9]/span[1]/a[1][contains(text(),'View')]");
 
     // click through to the membership view screen
-    $this->click("xpath=//div[@id='memberships']/div/table[@class='display dataTable no-footer']/tbody/tr/td[9]/span[1]/a[1][text()='View']");
+    $this->click("xpath=//div[@id='memberships']/div//table//tbody/tr/td[9]/span[1]/a[1][contains(text(),'View')]");
 
-    $this->waitForElementPresent('_qf_MembershipView_cancel-bottom');
+    $this->waitForElementPresent("xpath=//button//span[contains(text(),'Done')]");
 
     $joinDate = $startDate = date('F jS, Y', strtotime("-2 year"));
     $endDate = date('F jS, Y', strtotime("+2 year -1 day"));