X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fphpunit%2FWebTest%2FContribute%2FUpdateContributionTest.php;h=fdef735f3621e66a2ffc8243fd603d05360d412b;hb=HEAD;hp=47c3f50cffd96a9b25e8d3b42069928851000055;hpb=41f9932b28eee69c9057e909e4e7dec0867ddaaf;p=civicrm-core.git diff --git a/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php b/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php index 47c3f50cff..fdef735f36 100755 --- a/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php @@ -1,9 +1,9 @@ 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); // Is status message correct? $this->waitForText('crm-notification-container', "The contribution record has been saved."); @@ -174,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() { @@ -235,11 +240,12 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { $this->waitForElementPresent("product_name_0"); $this->select('product_name_0', "value=0"); // Clicking save. - $this->clickLink("_qf_Contribution_upload", "xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[7][not(text())]", FALSE); + $this->click("_qf_Contribution_upload"); + $this->waitForElementPresent("xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[8]//span/a[text()='View']"); //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() {