From 5548f5f9352411b9b27c511cad8d3b8b52e95874 Mon Sep 17 00:00:00 2001 From: monishdeb Date: Mon, 9 Nov 2015 20:27:42 +0530 Subject: [PATCH] Core Bugs and Webtest fixes in 4.7beta1 --- CRM/Case/Form/Case.php | 9 ++------- CRM/Contribute/Form/Contribution/Main.php | 2 +- tests/phpunit/WebTest/Case/AddCaseTest.php | 4 +++- .../Contribute/OnlineMultiplePaymentProcessorTest.php | 8 ++++---- .../WebTest/Import/ImportCiviSeleniumTestCase.php | 6 +++--- tests/phpunit/WebTest/Mailing/MailingTest.php | 5 +++-- 6 files changed, 16 insertions(+), 18 deletions(-) diff --git a/CRM/Case/Form/Case.php b/CRM/Case/Form/Case.php index 059fe437c7..6d54dbae27 100644 --- a/CRM/Case/Form/Case.php +++ b/CRM/Case/Form/Case.php @@ -179,15 +179,10 @@ class CRM_Case_Form_Case extends CRM_Core_Form { $className::preProcess($this); $activityGroupTree = $this->_groupTree; - if (!$this->_caseTypeId) { - $params = CRM_Utils_Request::exportValues(); - if (isset($params['case_type_id'])) { - $this->_caseTypeId = $params['case_type_id']; - } - } // for case custom fields to populate with defaults if (!empty($_POST['hidden_custom'])) { - CRM_Custom_Form_CustomData::preProcess($this, NULL, $this->_caseTypeId, 1, 'Case', $this->_caseId); + $params = CRM_Utils_Request::exportValues(); + CRM_Custom_Form_CustomData::preProcess($this, NULL, CRM_Utils_Array::value('case_type_id', $params, $this->_caseTypeId), 1, 'Case', $this->_caseId); CRM_Custom_Form_CustomData::buildQuickForm($this); } diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index ea99fd3032..81995735bd 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -1039,7 +1039,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu if (($this->_values['is_pay_later'] && empty($this->_paymentProcessor) && !array_key_exists('hidden_processor', $params)) || - (!empty($params['payment_processor_id']) && $params['payment_processor_id'] == 0) + (CRM_Utils_Array::value('payment_processor_id', $params) == 0) ) { $params['is_pay_later'] = 1; } diff --git a/tests/phpunit/WebTest/Case/AddCaseTest.php b/tests/phpunit/WebTest/Case/AddCaseTest.php index 31b111cbae..89943c3d29 100644 --- a/tests/phpunit/WebTest/Case/AddCaseTest.php +++ b/tests/phpunit/WebTest/Case/AddCaseTest.php @@ -190,6 +190,8 @@ class WebTest_Case_AddCaseTest extends CiviSeleniumTestCase { */ public function _testVerifyCaseRoles($caseRoles, $creatorName) { $id = $this->urlArg('id'); + $this->click('css=div.crm-case-roles-block div.crm-accordion-header'); + $this->waitForElementPresent("xpath=//table[@id='caseRoles-selector-$id']/tbody/tr[4]/td[2]/a"); // check that expected roles are listed in the Case Roles pane foreach ($caseRoles as $role) { @@ -228,7 +230,7 @@ class WebTest_Case_AddCaseTest extends CiviSeleniumTestCase { // Probably don't need both tableId and prefix - but good examples for other situations where only one can be used $this->webtestVerifyTabularData($openCaseData, '', $activityViewTableId); - $this->click("xpath=//span[@class='ui-button-icon-primary ui-icon ui-icon-closethick']"); + $this->click("xpath=//span[@class='ui-button-icon-primary ui-icon fa-times']"); } /** diff --git a/tests/phpunit/WebTest/Contribute/OnlineMultiplePaymentProcessorTest.php b/tests/phpunit/WebTest/Contribute/OnlineMultiplePaymentProcessorTest.php index e2e63971f1..5913088d62 100644 --- a/tests/phpunit/WebTest/Contribute/OnlineMultiplePaymentProcessorTest.php +++ b/tests/phpunit/WebTest/Contribute/OnlineMultiplePaymentProcessorTest.php @@ -174,15 +174,15 @@ class WebTest_Contribute_OnlineMultiplePaymentProcessorTest extends CiviSelenium $xpath = "xpath=//label[text() = '{$payLaterText}']/preceding-sibling::input[1]"; $this->click($xpath); - $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom"); + $this->click("_qf_Main_upload-bottom"); + $this->waitForElementPresent("xpath=//div[@class='bold pay_later_receipt-section']"); $payLaterInstructionsText = "Pay later instructions $hash"; $this->verifyText("xpath=//div[@class='bold pay_later_receipt-section']/p", $payLaterInstructionsText); - $this->click("_qf_Confirm_next-bottom"); - $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->verifyText("xpath=//div[@id='help']/div/p", $payLaterInstructionsText); + $this->waitForElementPresent("xpath=//div[@class='help']/div/p"); + $this->verifyText("xpath=//div[@class='help']/div/p", $payLaterInstructionsText); //login to check contribution $this->openCiviPage("contribute/search", "reset=1", 'contribution_date_low'); diff --git a/tests/phpunit/WebTest/Import/ImportCiviSeleniumTestCase.php b/tests/phpunit/WebTest/Import/ImportCiviSeleniumTestCase.php index c6178f2f42..54e4c9d168 100644 --- a/tests/phpunit/WebTest/Import/ImportCiviSeleniumTestCase.php +++ b/tests/phpunit/WebTest/Import/ImportCiviSeleniumTestCase.php @@ -458,9 +458,9 @@ class ImportCiviSeleniumTestCase extends CiviSeleniumTestCase { public function _getImportComponentContactType($component, $contactType) { $importComponentMode = array( 'Event' => array( - 'Individual' => 'CIVICRM_QFID_1_18', - 'Household' => 'CIVICRM_QFID_2_20', - 'Organization' => 'CIVICRM_QFID_4_22', + 'Individual' => 'CIVICRM_QFID_1_20', + 'Household' => 'CIVICRM_QFID_2_22', + 'Organization' => 'CIVICRM_QFID_4_24', ), 'Contribution' => array( 'Individual' => 'CIVICRM_QFID_1_18', diff --git a/tests/phpunit/WebTest/Mailing/MailingTest.php b/tests/phpunit/WebTest/Mailing/MailingTest.php index fbe077547b..068d3d94dd 100644 --- a/tests/phpunit/WebTest/Mailing/MailingTest.php +++ b/tests/phpunit/WebTest/Mailing/MailingTest.php @@ -420,7 +420,8 @@ class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase { $summaryInfoLinks = array( 'Intended Recipients', 'Successful Deliveries', - 'Tracked Opens', + 'Unique Opens', //as per CRM-16506- Fixed and improve mailing stats changes + 'Total Opens', 'Click-throughs', 'Forwards', 'Replies', @@ -457,7 +458,7 @@ class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase { 'Mailing Delivery -' => "Successful", ), ), - 'Tracked Opens' => array( + 'Unique Opens' => array( 'report' => array('report_name' => 'Mail Opened', 'Mailing' => "Mailing $mailingName Webtest"), 'search' => array( 'Mailing Name IN' => "\"Mailing {$mailingName} Webtest", -- 2.25.1