Fixed webtest for civi-4.6
authorpratikshad <pratiksha.dubey@webaccess.co.in>
Tue, 14 Apr 2015 05:07:42 +0000 (10:37 +0530)
committerpratikshad <pratiksha.dubey@webaccess.co.in>
Tue, 14 Apr 2015 05:07:42 +0000 (10:37 +0530)
tests/phpunit/WebTest/Contribute/UpdateContributionTest.php
tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php

index d79fb2e4f57d8df85138583cbde828ed30a93439..78fc7d0b79804affe7f45ef21d7330c57f6f15b8 100755 (executable)
@@ -54,8 +54,10 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase {
     }
 
     $this->clickLink("xpath=//tr[@id='rowid{$contriIDOff}']/td[11]/span/a[2]", "total_amount", FALSE);
+    $this->waitForAjaxContent();
     $this->type("total_amount", "90");
     $this->clickLink('_qf_Contribution_upload', '', FALSE);
+    $this->waitForAjaxContent();
     $this->waitForText('crm-notification-container', "The sum of fee amount and net amount must be equal to total amount");
     $this->type("net_amount", "90");
     $this->clickLink('_qf_Contribution_upload', '', FALSE);
@@ -177,10 +179,10 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase {
 
     //Assertions
     $actualAmount = $this->_getPremiumActualCost($contId, $to, $from, $cost2, "'civicrm_contribution'");
-    $this->assertEquals($actualAmount, NULL, "Verify actual cost for changed premium");
+    $this->assertEquals($actualAmount, $cost2, "Verify actual cost for changed premium");
 
     $deletedAmount = $this->_getPremiumActualCost($contId, $from, $to, $cost, "'civicrm_contribution'");
-    $this->assertEquals($deletedAmount, NULL, "Verify actual cost for deleted premium");
+    $this->assertEquals($deletedAmount, $cost, "Verify actual cost for deleted premium");
   }
 
   public function testDeletePremium() {
@@ -242,7 +244,7 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase {
 
     //Assertions
     $actualAmount = $this->_getPremiumActualCost($contId, $from, $to, NULL, "'civicrm_contribution'");
-    $this->assertEquals($actualAmount, NULL, "Verify actual cost for deleted premium");
+    $this->assertEquals($actualAmount, $cost, "Verify actual cost for deleted premium");
   }
 
   public function testChangePaymentInstrument() {
index 32ef68a4b1b5ce8453e67b3c37aab7e859149fee..021e4c3214c22d355acf5d10aa044fcdcf386a87 100644 (file)
@@ -94,6 +94,7 @@ class WebTest_Member_OfflineMembershipRenewTest extends CiviSeleniumTestCase {
     $this->click('_qf_MembershipRenewal_upload-bottom');
 
     // page was loaded
+    $this->waitForAjaxContent();
     $this->waitForTextPresent($sourceText);
     $this->waitForElementPresent("xpath=//div[@id='memberships']/div/table[@class='display dataTable no-footer']/tbody/tr/td[9]/span[1]/a[1][contains(text(),'View')]");