From 4cbbec008f78667b2f5ef57acc6ed2313f120b2b Mon Sep 17 00:00:00 2001 From: Rohan Katkar Date: Mon, 15 Dec 2014 19:02:43 +0530 Subject: [PATCH] Webtest Fix --- tests/phpunit/WebTest/Contribute/AddPricesetTest.php | 2 +- tests/phpunit/WebTest/Event/AddPricesetTest.php | 3 ++- tests/phpunit/WebTest/Event/ParticipantSearchTest.php | 4 +++- .../phpunit/WebTest/Member/OfflineMembershipRenewTest.php | 8 ++++---- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/phpunit/WebTest/Contribute/AddPricesetTest.php b/tests/phpunit/WebTest/Contribute/AddPricesetTest.php index 12e8f0cbf6..58d2c3e678 100644 --- a/tests/phpunit/WebTest/Contribute/AddPricesetTest.php +++ b/tests/phpunit/WebTest/Contribute/AddPricesetTest.php @@ -535,7 +535,7 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase { //Find Contribution $this->openCiviPage("contribute/search", "reset=1", 'contribution_date_low'); - $this->type('sort_name', "$firstName $lastName"); + $this->type('sort_name', "$lastName $firstName"); $this->clickLink('_qf_Search_refresh', "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", FALSE); $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", '_qf_ContributionView_cancel-bottom', FALSE); diff --git a/tests/phpunit/WebTest/Event/AddPricesetTest.php b/tests/phpunit/WebTest/Event/AddPricesetTest.php index 8a4afc860b..5ad105a2b1 100644 --- a/tests/phpunit/WebTest/Event/AddPricesetTest.php +++ b/tests/phpunit/WebTest/Event/AddPricesetTest.php @@ -600,7 +600,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { $this->type('source', 'Event StandaloneAddTest Webtest'); // Select an event fee - $this->waitForElementPresent("xpath=//div[@id='priceset']/div[2]/div[2]"); + $this->waitForElementPresent("xpath=//div[@id='priceset']/div[2]/div[2]/input"); $this->type("xpath=//div[@id='priceset']/div[2]/div[2]/input", '5'); $this->fireEvent("xpath=//div[@id='priceset']/div[2]/div[2]/input", 'blur'); $this->waitForElementPresent("xpath=//div[@id='priceset']/div[3]/div[2]/div[1]/span/input"); @@ -726,6 +726,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { //check the delete for price field $this->openCiviPage("admin/price/field", "reset=1&action=browse&sid={$sid}"); + $this->waitForElementPresent("xpath=//table[@id='options']/tbody/tr/td[9]/span[2]"); $this->click("xpath=//table[@id='options']/tbody/tr/td[9]/span[2]/ul/li[2]/a"); //assert the message $this->waitForText('price_set_used_by', diff --git a/tests/phpunit/WebTest/Event/ParticipantSearchTest.php b/tests/phpunit/WebTest/Event/ParticipantSearchTest.php index 324c6f8c15..65cada1df5 100644 --- a/tests/phpunit/WebTest/Event/ParticipantSearchTest.php +++ b/tests/phpunit/WebTest/Event/ParticipantSearchTest.php @@ -104,6 +104,7 @@ class WebTest_Event_ParticipantSearchTest extends CiviSeleniumTestCase { // visit event search page $this->openCiviPage("event/search", "reset=1"); + $this->waitForElementPresent('_qf_Search_refresh'); $eventName = "Fall Fundraiser Dinner"; $this->select2("event_id", $eventName); @@ -158,7 +159,8 @@ class WebTest_Event_ParticipantSearchTest extends CiviSeleniumTestCase { $this->webtestFillDate('event_end_date_high', '+1 year'); - $this->clickLink("_qf_Search_refresh", "search-status"); + $this->click("_qf_Search_refresh"); + $this->waitForElementPresent("search-status"); $stringsToCheck = array( "Start Date - greater than or equal to", diff --git a/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php b/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php index abc614f2d3..908e6ddd15 100644 --- a/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php +++ b/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php @@ -97,10 +97,10 @@ class WebTest_Member_OfflineMembershipRenewTest extends CiviSeleniumTestCase { // page was loaded $this->waitForTextPresent($sourceText); - $this->waitForElementPresent("xpath=//div[@id='memberships']//table/tbody/tr/td[9]/span/a[text()='View']"); + $this->waitForElementPresent("xpath=//div[@id='memberships']/div/table/tbody/tr/td[9]/span/a[1][text()='View']"); // click through to the membership view screen - $this->click("xpath=//div[@id='memberships']//table/tbody/tr/td[9]/span/a[text()='View']"); + $this->click("xpath=//div[@id='memberships']/div/table/tbody/tr/td[9]/span/a[1][text()='View']"); $this->waitForElementPresent('_qf_MembershipView_cancel-bottom'); @@ -200,10 +200,10 @@ class WebTest_Member_OfflineMembershipRenewTest extends CiviSeleniumTestCase { // page was loaded $this->waitForTextPresent($sourceText); - $this->waitForElementPresent("xpath=//div[@id='memberships']/div/table/tbody/tr/td[9]/span[1]/a[1][text()='View']"); + $this->waitForElementPresent("xpath=//div[@id='memberships']/div/table/tbody/tr/td[9]/span/a[1][text()='View']"); // click through to the membership view screen - $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[9]/span[1]/a[1][text()='View']"); + $this->click("xpath=//div[@id='memberships']/div/table/tbody/tr/td[9]/span/a[1][text()='View']"); $this->waitForElementPresent('_qf_MembershipView_cancel-bottom'); -- 2.25.1