From 5815ee4c56a73ab79270da430dcc71b3a88ba4f9 Mon Sep 17 00:00:00 2001 From: pratikshad Date: Tue, 14 Apr 2015 10:37:42 +0530 Subject: [PATCH] Fixed webtest for civi-4.6 --- .../phpunit/WebTest/Contribute/UpdateContributionTest.php | 8 +++++--- .../phpunit/WebTest/Member/OfflineMembershipRenewTest.php | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php b/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php index d79fb2e4f5..78fc7d0b79 100755 --- a/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php @@ -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() { diff --git a/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php b/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php index 32ef68a4b1..021e4c3214 100644 --- a/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php +++ b/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php @@ -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')]"); -- 2.25.1