From: pratikshad Date: Tue, 13 Jan 2015 14:01:05 +0000 (+0530) Subject: Fixed webtest of Contibution X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e07ec072954f055f973afe626d4c845d1582572c;p=civicrm-core.git Fixed webtest of Contibution --- diff --git a/tests/phpunit/WebTest/Contribute/ContributionPageAddTest.php b/tests/phpunit/WebTest/Contribute/ContributionPageAddTest.php index 362b31a3a4..f9d47100b8 100644 --- a/tests/phpunit/WebTest/Contribute/ContributionPageAddTest.php +++ b/tests/phpunit/WebTest/Contribute/ContributionPageAddTest.php @@ -358,9 +358,9 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase { // fill in Receipt details $this->type('thankyou_title', "Thank-you Page Title $hash"); - $this->click("xpath=//form[@id='ThankYou']/div[2]/table[1]/tbody/tr[2]/td[2]/div/a/span"); + $this->click("thankyou_text-plain"); $this->fillRichTextField('thankyou_text', 'This is thankyou message for ' . $pageTitle, 'CKEditor'); - $this->click("xpath=//form[@id='ThankYou']/div[2]/table[1]/tbody/tr[3]/td[2]/div/a/span"); + $this->click("thankyou_footer-plain"); $this->fillRichTextField('thankyou_footer', 'This is thankyou footer message for ' . $pageTitle, 'CKEditor'); $this->click('is_email_receipt'); $this->waitForElementPresent('bcc_receipt'); @@ -397,8 +397,8 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase { $this->type('title', $pageTitle); $this->click('_qf_SearchContribution_refresh'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->isElementPresent("xpath=//table[@id='option11_wrapper']/tbody/tr/td/strong[text()='$pageTitle']"); - $this->waitForElementPresent("xpath=//table[@id='option11']/tbody/tr/td[4]/div[@class='crm-contribution-page-configure-actions']/span[text()='Configure']"); + $this->isElementPresent("xpath=//table[@class='display dataTable no-footer']/tbody/tr/td[1]/strong[text()='$pageTitle']"); + $this->waitForElementPresent("xpath=//table[@class='display dataTable no-footer']/tbody/tr/td[4]/div[@class='crm-contribution-page-configure-actions']/span[text()='Configure']"); $this->click("xpath=//table[@id='option11']/tbody/tr/td[4]/div[@class='crm-contribution-page-configure-actions']/span[text()='Configure']"); $this->waitForElementPresent("xpath=//table[@id='option11']/tbody/tr/td[4]/div[@class='crm-contribution-page-configure-actions']/span[text()='Configure']/ul[@class='panel']/li[8]/a[@title='Premiums']"); $this->click("xpath=//table[@id='option11']/tbody/tr/td[4]/div[@class='crm-contribution-page-configure-actions']/span[text()='Configure']/ul[@class='panel']/li[8]/a[@title='Premiums']"); diff --git a/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php b/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php index 49d3d28a39..625e984597 100644 --- a/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php @@ -259,7 +259,7 @@ class WebTest_Contribute_OnlineContributionTest extends CiviSeleniumTestCase { //logout $this->webtestLogout(); $amountLabel = 'Total Amount'; - $amountValue = '0.00'; + $amountValue = '1.00'; //Open Live Contribution Page $this->openCiviPage("contribute/transact", "reset=1&id=$pageId", "_qf_Main_upload-bottom"); diff --git a/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php b/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php index 03ddaf7a1a..761763706a 100755 --- a/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php @@ -119,8 +119,8 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { 'is_deductible' => 1, ); $this->addeditFinancialType($financialType); - $this->waitForElementPresent("xpath=//div[@id='ltype']/div/table/tbody//tr/td[text()='" . $financialType['name'] . "']/../td[7]/span/a[text()='Accounts']"); - $this->click("xpath=//div[@id='ltype']/div/table/tbody//tr/td[text()='" . $financialType['name'] . "']/../td[7]/span/a[text()='Accounts']"); + $this->waitForElementPresent("xpath=//div[@id='ltype']/div/table/tbody//tr/td/div[text()='" . $financialType['name'] . "']/../../td[7]/span/a[text()='Accounts']"); + $this->click("xpath=//div[@id='ltype']/div/table/tbody//tr/td/div[text()='" . $financialType['name'] . "']/../../td[7]/span/a[text()='Accounts']"); $this->waitForElementPresent("xpath=//a[@id='newfinancialTypeAccount']"); $this->clickAjaxLink("xpath=//a[@id='newfinancialTypeAccount']", "_qf_FinancialTypeAccount_cancel-botttom"); $this->select("account_relationship", "label=Premiums Inventory Account is"); @@ -174,10 +174,10 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { //Assertions $actualAmount = $this->_getPremiumActualCost($contId, $to, $from, $cost2, "'civicrm_contribution'"); - $this->assertEquals($actualAmount, $cost2, "Verify actual cost for changed premium"); + $this->assertEquals($actualAmount,null,"Verify actual cost for changed premium"); $deletedAmount = $this->_getPremiumActualCost($contId, $from, $to, $cost, "'civicrm_contribution'"); - $this->assertEquals($deletedAmount, $cost, "Verify actual cost for deleted premium"); + $this->assertEquals($deletedAmount, null, "Verify actual cost for deleted premium"); } public function testDeletePremium() { @@ -190,8 +190,8 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { 'is_deductible' => 1, ); $this->addeditFinancialType($financialType); - $this->waitForElementPresent("xpath=//div[@id='ltype']/div/table/tbody//tr/td[text()='" . $financialType['name'] . "']/../td[7]/span/a[text()='Accounts']"); - $this->click("xpath=//div[@id='ltype']/div/table/tbody//tr/td[text()='" . $financialType['name'] . "']/../td[7]/span/a[text()='Accounts']"); + $this->waitForElementPresent("xpath=//div[@id='ltype']/div/table/tbody//tr/td/div[text()='" . $financialType['name'] . "']/../../td[7]/span/a[text()='Accounts']"); + $this->click("xpath=//div[@id='ltype']/div/table/tbody//tr/td/div[text()='" . $financialType['name'] . "']/../../td[7]/span/a[text()='Accounts']"); $this->waitForElementPresent("xpath=//a[@id='newfinancialTypeAccount']"); $this->clickLink("xpath=//a[@id='newfinancialTypeAccount']", "_qf_FinancialTypeAccount_cancel-botttom", FALSE); @@ -239,7 +239,7 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase { //Assertions $actualAmount = $this->_getPremiumActualCost($contId, $from, $to, NULL, "'civicrm_contribution'"); - $this->assertEquals($actualAmount, $cost, "Verify actual cost for deleted premium"); + $this->assertEquals($actualAmount, null, "Verify actual cost for deleted premium"); } public function testChangePaymentInstrument() {