From 38653166b70b6b49f9cbcf86d4a8a4179a8d4415 Mon Sep 17 00:00:00 2001 From: pratikshad Date: Tue, 21 Apr 2015 16:02:00 +0530 Subject: [PATCH] Fixed webtest for civicrm4.6 --- tests/phpunit/WebTest/Contact/AdvancedSearchTest.php | 2 +- tests/phpunit/WebTest/Event/AddPricesetTest.php | 3 ++- tests/phpunit/WebTest/Event/AddRecurringEventTest.php | 2 +- tests/phpunit/WebTest/Event/ParticipantCountTest.php | 2 +- tests/phpunit/WebTest/Event/ParticipantSearchTest.php | 4 +++- tests/phpunit/WebTest/Pledge/AddCancelPaymentTest.php | 1 + 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php b/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php index fb4b0e3f65..7b77ba2b01 100644 --- a/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php +++ b/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php @@ -222,7 +222,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { $this->clickLink("_qf_Advanced_refresh"); // verify unique name $this->waitForAjaxContent(); - $this->waitForText("xpath=//div[@class='crm-search-results']/table/tbody", preg_quote("adv$firstName, $firstName")); + $this->waitForElementPresent("xpath=//div[@class='crm-search-results']/table/tbody/tr//td/a[text()='adv$firstName, $firstName']"); // should give 1 result only as we are searching with unique name $this->waitForText("xpath=//div[@id='search-status']/table/tbody/tr/td", preg_quote("1 Contact")); // click to edit search diff --git a/tests/phpunit/WebTest/Event/AddPricesetTest.php b/tests/phpunit/WebTest/Event/AddPricesetTest.php index 0d0f2d9a72..94d3e94fd8 100644 --- a/tests/phpunit/WebTest/Event/AddPricesetTest.php +++ b/tests/phpunit/WebTest/Event/AddPricesetTest.php @@ -579,6 +579,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { $this->click('_qf_Fee_upload-bottom'); $this->waitForText("crm-notification-container", "'Fees' information has been saved."); + $this->waitForAjaxContent(); $this->openCiviPage('participant/add', 'reset=1&action=add&context=standalone', '_qf_Participant_upload-bottom'); @@ -731,7 +732,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { $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', "Unable to delete the 'Test Field' Price Field - it is currently in use by one or more active events or contribution pages or contributions or event templates. If you no longer want to use this price set, click the event title below, and modify the fees for that event."); + $this->waitForText('price_set_used_by', "it is currently in use by one or more active events or contribution pages or contributions or event templates. If you no longer want to use this price set, click the event title below, and modify the fees for that event."); //check the delete for priceset $this->openCiviPage("admin/price", "reset=1"); diff --git a/tests/phpunit/WebTest/Event/AddRecurringEventTest.php b/tests/phpunit/WebTest/Event/AddRecurringEventTest.php index 1e05fa8763..4ad550f388 100644 --- a/tests/phpunit/WebTest/Event/AddRecurringEventTest.php +++ b/tests/phpunit/WebTest/Event/AddRecurringEventTest.php @@ -84,7 +84,7 @@ class WebTest_Event_AddRecurringEventTest extends CiviSeleniumTestCase { $this->click('event-configure-1'); $this->waitForElementPresent("xpath=//span[@id='event-configure-1']/ul[@class='panel']/li/a[text()='Info and Settings']"); $this->click("xpath=//span[@id='event-configure-1']/ul[@class='panel']/li/a[text()='Info and Settings']"); - $this->waitForElementPresent('_qf_EventInfo_cancel-bottom'); + $this->waitForTextPresent("Event Title"); $this->type('title', 'CiviCon'); $this->click('_qf_EventInfo_upload_done-top'); $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()='Cancel']"); diff --git a/tests/phpunit/WebTest/Event/ParticipantCountTest.php b/tests/phpunit/WebTest/Event/ParticipantCountTest.php index 6532c6cf90..f48a17fa35 100644 --- a/tests/phpunit/WebTest/Event/ParticipantCountTest.php +++ b/tests/phpunit/WebTest/Event/ParticipantCountTest.php @@ -106,7 +106,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); // verify number of registered participants - $this->assertElementContainsText("xpath=//div[@class='crm-block crm-content-block']/div//div/div/table/tbody/tr[1]/td", '2 Results'); + $this->assertElementContainsText("xpath=//div[@class='crm-results-block']//div/table/tbody/tr/td", '2 Results'); } public function testParticipantCountWithPriceset() { diff --git a/tests/phpunit/WebTest/Event/ParticipantSearchTest.php b/tests/phpunit/WebTest/Event/ParticipantSearchTest.php index 866ca4451a..cd797ce0a5 100644 --- a/tests/phpunit/WebTest/Event/ParticipantSearchTest.php +++ b/tests/phpunit/WebTest/Event/ParticipantSearchTest.php @@ -110,7 +110,8 @@ class WebTest_Event_ParticipantSearchTest extends CiviSeleniumTestCase { $this->waitForElementPresent("event_id"); $this->select2("event_id", $eventName); - $this->clickLink("_qf_Search_refresh", "search-status"); + $this->click("_qf_Search_refresh"); + $this->waitForPageToLoad($this->getTimeoutMsec()); $stringsToCheck = array( "Event = $eventName", @@ -161,6 +162,7 @@ class WebTest_Event_ParticipantSearchTest extends CiviSeleniumTestCase { $this->webtestFillDate('event_end_date_high', '+1 year'); $this->click("_qf_Search_refresh"); + $this->waitForPageToLoad($this->getTimeoutMsec()); $this->waitForElementPresent("xpath=//form[@id='Search']/div[3]/div/div[1]/div"); $stringsToCheck = array( diff --git a/tests/phpunit/WebTest/Pledge/AddCancelPaymentTest.php b/tests/phpunit/WebTest/Pledge/AddCancelPaymentTest.php index f5b599a48e..a923d331a4 100644 --- a/tests/phpunit/WebTest/Pledge/AddCancelPaymentTest.php +++ b/tests/phpunit/WebTest/Pledge/AddCancelPaymentTest.php @@ -89,6 +89,7 @@ class WebTest_Pledge_AddCancelPaymentTest extends CiviSeleniumTestCase { $this->click("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a"); //Check whether the next two payments are done or not + $this->waitForAjaxContent(); $this->waitForElementPresent("xpath=//form[@id='Search']//div/table/tbody//tr//td/table/tbody/tr[2]/td[8]/a[text()='View Payment']"); $this->verifyText("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td[7]", "Completed"); $this->verifyText("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[4]/td[7]", "Completed"); -- 2.25.1