From: jitendrapurohit Date: Tue, 5 Jan 2016 13:21:30 +0000 (+0530) Subject: webtest fixes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2e27db7c2a5b3f3c6569d0599002b96798c5aab9;p=civicrm-core.git webtest fixes --- diff --git a/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php b/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php index e682016b0f..385a589606 100755 --- a/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/UpdateContributionTest.php @@ -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'); } diff --git a/tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php b/tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php index 7c3cc09c0e..8e197b3f27 100644 --- a/tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php @@ -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'], diff --git a/tests/phpunit/WebTest/Event/AddParticipationTest.php b/tests/phpunit/WebTest/Event/AddParticipationTest.php index 7dadde372f..523205f145 100644 --- a/tests/phpunit/WebTest/Event/AddParticipationTest.php +++ b/tests/phpunit/WebTest/Event/AddParticipationTest.php @@ -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