From e7066c8ecf0e4243af51b4c2a08f813cf5e548b1 Mon Sep 17 00:00:00 2001 From: Web Access Date: Tue, 17 Mar 2015 15:44:30 +0530 Subject: [PATCH] Use of flexible selectors --- tests/phpunit/WebTest/Campaign/ActivityTest.php | 3 +-- tests/phpunit/WebTest/Campaign/MembershipTest.php | 5 ++--- tests/phpunit/WebTest/Event/AddPricesetTest.php | 2 +- .../phpunit/WebTest/Member/OfflineMembershipRenewTest.php | 7 +++---- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/tests/phpunit/WebTest/Campaign/ActivityTest.php b/tests/phpunit/WebTest/Campaign/ActivityTest.php index b8c015405b..8fb39de06c 100644 --- a/tests/phpunit/WebTest/Campaign/ActivityTest.php +++ b/tests/phpunit/WebTest/Campaign/ActivityTest.php @@ -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); diff --git a/tests/phpunit/WebTest/Campaign/MembershipTest.php b/tests/phpunit/WebTest/Campaign/MembershipTest.php index 27c82c6222..6407735670 100644 --- a/tests/phpunit/WebTest/Campaign/MembershipTest.php +++ b/tests/phpunit/WebTest/Campaign/MembershipTest.php @@ -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); } diff --git a/tests/phpunit/WebTest/Event/AddPricesetTest.php b/tests/phpunit/WebTest/Event/AddPricesetTest.php index c1b312d6bb..a064bf2821 100644 --- a/tests/phpunit/WebTest/Event/AddPricesetTest.php +++ b/tests/phpunit/WebTest/Event/AddPricesetTest.php @@ -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')]"); } /** diff --git a/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php b/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php index 27d349b477..204cb4600a 100644 --- a/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php +++ b/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php @@ -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")); -- 2.25.1