webtest fixes
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Tue, 5 Jan 2016 13:21:30 +0000 (18:51 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Tue, 5 Jan 2016 13:21:30 +0000 (18:51 +0530)
tests/phpunit/WebTest/Contribute/UpdateContributionTest.php
tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php
tests/phpunit/WebTest/Event/AddParticipationTest.php

index e682016b0f5893df80328b2f231f9fe96ad78a54..385a58960657a95830c5f2cbf79f54151a567a73 100755 (executable)
@@ -323,9 +323,10 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase {
     $defaults = array();
     $items = CRM_Financial_BAO_FinancialItem::retrieve($itemParams, $defaults);
     $this->assertEquals($items->amount, $itemParams['amount'], 'Verify Amount for financial Item');
-    $totalAmount = $this->_getPremiumActualCost($items->id, 'Accounts Receivable', NULL, "-100.00", "'civicrm_financial_item'");
+    // CRM-17183 - check Financial Trxn in $to_financial_account_id
+    $totalAmount = $this->_getPremiumActualCost($items->id, NULL, 'Accounts Receivable', "-100.00", "'civicrm_financial_item'");
     $this->assertEquals($totalAmount, "-$amount", 'Verify Amount for Financial Trxn');
-    $totalAmount = $this->_getPremiumActualCost($contId, 'Accounts Receivable', NULL, "-100.00", "'civicrm_contribution'");
+    $totalAmount = $this->_getPremiumActualCost($contId, NULL, 'Accounts Receivable', "-100.00", "'civicrm_contribution'");
     $this->assertEquals($totalAmount, "-$amount", 'Verify Amount for Financial Trxn');
   }
 
index 7c3cc09c0e3d733fc1a9e2d235936266c3a8554f..8e197b3f27b2554d5a0316bc765567b096f8a601 100644 (file)
@@ -50,8 +50,8 @@ class WebTest_Contribute_UpdatePendingContributionTest extends CiviSeleniumTestC
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     $this->click('radio_ts', 'ts_all');
-    $contriIDOff = explode('&', $this->getAttribute("xpath=//div[@id='contributionSearch']/table/tbody/tr[1]/td[11]/span/a@href"));
-    $contriIDOn = explode('&', $this->getAttribute("xpath=//div[@id='contributionSearch']/table/tbody/tr[1]/td[11]/span/a@href"));
+    $contriIDOff = explode('&', $this->getAttribute("xpath=//div[@id='contributionSearch']/table/tbody/tr[1]//td/span/a@href"));
+    $contriIDOn = explode('&', $this->getAttribute("xpath=//div[@id='contributionSearch']/table/tbody/tr[1]//td/span/a@href"));
     if (!empty($contriIDOff)) {
       $contriIDOff = substr($contriIDOff[1], (strrpos($contriIDOff[1], '=') + 1));
     }
@@ -69,8 +69,8 @@ class WebTest_Contribute_UpdatePendingContributionTest extends CiviSeleniumTestC
     $this->click("_qf_Result_done");
     $this->waitForPageToLoad($this->getTimeoutMsec());
     $status = 'Completed';
-    $this->verifyText("xpath=id('contributionSearch')/table[1]/tbody/tr[1]/td[9]", preg_quote($status));
-    $this->verifyText("xpath=id('contributionSearch')/table[1]/tbody/tr[2]/td[9]", preg_quote($status));
+    $this->verifyText("xpath=id('contributionSearch')/table[1]/tbody/tr[1]//td[@class='crm-contribution-status']", preg_quote($status));
+    $this->verifyText("xpath=id('contributionSearch')/table[1]/tbody/tr[2]//td[@class='crm-contribution-status']", preg_quote($status));
   }
 
   /**
@@ -237,7 +237,8 @@ class WebTest_Contribute_UpdatePendingContributionTest extends CiviSeleniumTestC
 
     $this->click("xpath=//div[@class='crm-section other_amount-section']//div[2]/input");
     $this->type("xpath=//div[@class='crm-section other_amount-section']//div[2]/input", 100);
-    $this->click("xpath=//div[@class='crm-section payment_processor-section']/div[2]//label[text()='Pay later label {$hash}']");
+    $this->click("xpath=//label[text()='Pay later label {$hash}']");
+    $this->waitForAjaxContent();
     $streetAddress = "100 Main Street";
     $this->type("street_address-1", $streetAddress);
     $this->type("city-1", "San Francisco");
@@ -257,8 +258,8 @@ class WebTest_Contribute_UpdatePendingContributionTest extends CiviSeleniumTestC
     $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low");
     $this->click("xpath=//tr/td[1]/label[contains(text(), 'Contribution is a Test?')]/../../td[2]/label[contains(text(), 'Yes')]/preceding-sibling::input[1]");
     $this->type("sort_name", $contact['sort_name']);
-    $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table/tbody/tr[1]/td[11]/span/a[text()='View']", FALSE);
-    $this->click("xpath=//div[@id='contributionSearch']//table/tbody/tr[1]/td[11]/span/a[text()='View']");
+    $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table/tbody/tr[1]//td/span/a[text()='View']", FALSE);
+    $this->click("xpath=//div[@id='contributionSearch']//table/tbody/tr[1]//td/span/a[text()='View']");
     // View Contribution Record and test for expected values
     $expected = array(
       'From' => $contact['display_name'],
index 7dadde372f99c39bbe62016df8d4f7ff931f80ff..523205f145008d49a44c4caae5c8ecec52da42e7 100644 (file)
@@ -229,9 +229,6 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase {
     //clicking save
     $this->clickAjaxLink('_qf_Field_done-bottom');
 
-    // Visit home page for a sec to give caches time to be cleared
-    $this->openCiviPage('');
-
     $this->openCiviPage("participant/add", "reset=1&action=add&context=standalone", "_qf_Participant_upload-bottom");
 
     // Type contact last name in contact auto-complete, wait for dropdown and click first result