webtest fixes 4.5
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Tue, 7 Oct 2014 13:03:25 +0000 (18:33 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Tue, 7 Oct 2014 13:03:25 +0000 (18:33 +0530)
tests/phpunit/WebTest/Event/AddEventTest.php

index 5cf3610f265a3c5d6f975960dd678132abe7b2db..16741183356e9895c1697a2083b0905b6553f426 100644 (file)
@@ -808,6 +808,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase {
     $this->select2("event_id", $eventTitle, FALSE);
     $this->click("xpath=//td[@class='crm-event-form-block-participant_status']/div[@class='listing-box']//div/label[text()='Pending from pay later']");
     $this->clickLink('_qf_Search_refresh');
+    $this->waitForElementPresent("xpath=//div[@id='participantSearch']/table/tbody//tr/td[11]/span/a[text()='Edit']");
 
     $uRL = $this->getAttribute("xpath=//div[@id='participantSearch']/table/tbody//tr/td[11]/span/a[text()='Edit']@href");
     $this->click("xpath=//div[@id='participantSearch']/table/tbody//tr/td[11]/span/a[text()='Edit']");
@@ -821,8 +822,10 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase {
     $contributionID = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_ParticipantPayment', $pID, 'contribution_id', 'participant_id');
     $this->click('_qf_Participant_upload-top');
     $this->waitForElementPresent("xpath=//div[@id='participantSearch']/table/tbody//tr/td[11]/span/a[text()='Edit']");
+    $this->waitForElementPresent("xpath=//div[@id='participantSearch']/table/tbody//tr/td[11]/span/a[text()='View']");
     $this->click("xpath=//div[@id='participantSearch']/table/tbody//tr/td[11]/span/a[text()='View']");
     $this->waitForElementPresent("css=.ui-dialog");
+    $this->waitForAjaxContent();
     $this->verifyFinancialRecords($contributionID);
 
     // add participant and 3 additional participant and change status of participant from edit contribution
@@ -832,8 +835,8 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase {
     $this->openCiviPage("event/search?reset=1", "reset=1");
     $this->select2("event_id", $eventTitle, FALSE);
     $this->click("xpath=//td[@class='crm-event-form-block-participant_status']/div[@class='listing-box']//div/label[text()='Pending from pay later']");
-    $this->click('_qf_Search_refresh');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->clickLink('_qf_Search_refresh');
+    $this->waitForElementPresent("xpath=//div[@id='participantSearch']/table/tbody//tr/td[11]/span/a[text()='View']");
     $uRL = $this->getAttribute("xpath=//div[@id='participantSearch']/table/tbody//tr/td[11]/span/a[text()='View']@href");
     $this->click("xpath=//div[@id='participantSearch']/table/tbody//tr/td[11]/span/a[text()='View']");
     $pID = $this->urlArg('id', $uRL);
@@ -843,6 +846,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent("_qf_Contribution_upload-bottom");
     $this->select('contribution_status_id', 'label=Completed');
     $this->clickLink('_qf_Contribution_upload-bottom', '_qf_ParticipantView_cancel-bottom', FALSE);
+    $this->waitForAjaxContent();
     $this->verifyFinancialRecords($contributionID);
   }