From 1361cc61d99068075adc6b58e6fec7d9f24d83db Mon Sep 17 00:00:00 2001 From: Web Access Date: Tue, 13 Jan 2015 16:44:49 +0530 Subject: [PATCH 1/2] Webtests fix-4.5 --- .../Campaign/CampaignDescriptionTest.php | 7 ++-- .../WebTest/Case/CaseCustomFieldsTest.php | 2 +- .../phpunit/WebTest/Event/AddPricesetTest.php | 2 +- .../WebTest/Event/MultiprofileEventTest.php | 10 +++--- tests/phpunit/WebTest/Export/ContactTest.php | 36 +++++++++---------- .../Member/OfflineMembershipRenewTest.php | 8 ++--- .../WebTest/Report/LoggingReportTest.php | 1 + 7 files changed, 33 insertions(+), 33 deletions(-) diff --git a/tests/phpunit/WebTest/Campaign/CampaignDescriptionTest.php b/tests/phpunit/WebTest/Campaign/CampaignDescriptionTest.php index 0694cf14b055..ca28f5f9cbf6 100644 --- a/tests/phpunit/WebTest/Campaign/CampaignDescriptionTest.php +++ b/tests/phpunit/WebTest/Campaign/CampaignDescriptionTest.php @@ -70,15 +70,14 @@ function testCreateCampaign() { // click save $this->click("_qf_Campaign_upload-bottom"); - $this->waitForPageToLoad($this->getTimeoutMsec()); $this->waitForText('crm-notification-container', "Campaign $title"); //Opening Edit Page of the created Campaign $this->waitForElementPresent("//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody//tr/td[text()='{$campaignTitle}']/../td[13]/span/a[text()='Edit']"); - $this->clickLink("//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody//tr/td[text()='{$campaignTitle}']/../td[13]/span/a[text()='Edit']", "//textarea[@id='description']"); - $fetchedVaue = $this->getValue('description'); - $this->assertEquals($campaignDescription, $fetchedVaue); + $this->click("//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody//tr/td[text()='{$campaignTitle}']/../td[13]/span/a[text()='Edit']"); + $this->waitForAjaxContent(); + $this->assertTrue($this->isTextPresent($campaignDescription), 'Missing text: ' . $campaignDescription); } function testAjaxCustomGroupLoad() { diff --git a/tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php b/tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php index 55d88df4b01c..c7980659ae31 100644 --- a/tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php +++ b/tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php @@ -137,7 +137,7 @@ function testAddCase() { // verify if custom data is present $this->openCiviPage('case', 'reset=1'); - $this->clickLink("xpath=//table[@class='caseSelector']/tbody//tr/td[2]/a[text()='{$client['sort_name']}']/../../td[9]/span/a[text()='Manage']"); + $this->clickLink("xpath=//table[@class='caseSelector']/tbody//tr/td[2]/a[text()='{$client['sort_name']}']/../../td[9]/span/a[1][text()='Manage']"); $this->clickAjaxLink("css=#{$customGrp1} .crm-accordion-header", "css=#{$customGrp1} a.button"); $cusId_1 = 'custom_' . $customId[0] . '_1'; diff --git a/tests/phpunit/WebTest/Event/AddPricesetTest.php b/tests/phpunit/WebTest/Event/AddPricesetTest.php index c958539a756b..6182d763fe47 100644 --- a/tests/phpunit/WebTest/Event/AddPricesetTest.php +++ b/tests/phpunit/WebTest/Event/AddPricesetTest.php @@ -260,7 +260,7 @@ function testRegisterWithPriceSet() { $this->click('link=Fees'); $this->waitForElementPresent('_qf_Fee_upload_done-bottom'); $this->click('CIVICRM_QFID_1_is_monetary'); - $this->click("xpath=//tr[@class='crm-event-manage-fee-form-block-payment_processor']/td[2]/label[text()='$processorName']"); + $this->click("xpath=//tbale[@id='paymentProcessor']/tbody/tr[1]/td[2]/label[text()='$processorName']"); $this->select('financial_type_id','label=Event Fee'); $this->select('price_set_id', 'label=' . $setTitle); diff --git a/tests/phpunit/WebTest/Event/MultiprofileEventTest.php b/tests/phpunit/WebTest/Event/MultiprofileEventTest.php index 75c892821a72..831d44b0be6c 100644 --- a/tests/phpunit/WebTest/Event/MultiprofileEventTest.php +++ b/tests/phpunit/WebTest/Event/MultiprofileEventTest.php @@ -324,10 +324,10 @@ function _testRemoveProfile($eventPageId) { // Go to Online Contribution tab $this->click("link=Online Registration"); $this->waitForElementPresent("_qf_Registration_upload-bottom"); - $this->click("xpath=//*[@id='additional_custom_post_id_multiple_1']/parent::td/span/a[text()='remove profile']"); - $this->click("xpath=//*[@id='additional_custom_post_id_multiple_2']/parent::td/span/a[text()='remove profile']"); - $this->click("xpath=//*[@id='additional_custom_post_id_multiple_3']/parent::td/span/a[text()='remove profile']"); - $this->click("xpath=//*[@id='additional_custom_post_id_multiple_4']/parent::td/span/a[text()='remove profile']"); + $this->click("xpath=//*[@id='additional_custom_post_id_multiple_1']/parent::td/span[1]/a"); + $this->click("xpath=//*[@id='additional_custom_post_id_multiple_2']/parent::td/span[1]/a"); + $this->click("xpath=//*[@id='additional_custom_post_id_multiple_3']/parent::td/span[1]/a"); + $this->click("xpath=//*[@id='additional_custom_post_id_multiple_4']/parent::td/span[1]/a"); $this->click("_qf_Registration_upload-bottom"); $this->waitForElementPresent("_qf_Registration_upload-bottom"); } @@ -710,7 +710,7 @@ function _testEventRegistration($eventPageId, $customId, $firstName, $lastName, $this->type("city-Primary", "primecity"); $this->type("phone-Primary-1", "98667764"); $this->type("postal_code-Primary", "6548"); - + $this->waitForElementPresent('nick_name'); $this->type("nick_name", "Nick1"); $this->type("url-1", "http://www.part.com"); diff --git a/tests/phpunit/WebTest/Export/ContactTest.php b/tests/phpunit/WebTest/Export/ContactTest.php index a385ee5cc80f..1389b2d6dc1c 100644 --- a/tests/phpunit/WebTest/Export/ContactTest.php +++ b/tests/phpunit/WebTest/Export/ContactTest.php @@ -120,16 +120,6 @@ function testPrefixGenderSuffix(){ // All other rows to be check. $checkRows = array( 1 => array( - 'First Name' => $firstContactName, - 'Last Name' => 'Smith', - 'Email' => ''.strtolower($emailContactFirst).'', - 'Sort Name' => $sortFirstName, - 'Display Name' => $prefixLabelContactFrst.' '.$displayFirstName.' '.$suffixLabelContactFrst, - 'Individual Prefix' => $prefixLabelContactFrst, - 'Individual Suffix' => $suffixLabelContactFrst, - 'Gender' => $genderLabelContactFrst, - ), - 2 => array( 'First Name' => $secondContactName, 'Last Name' => 'John', 'Email' => ''.strtolower($emailContactSecond).'', @@ -139,6 +129,16 @@ function testPrefixGenderSuffix(){ 'Individual Suffix' => $suffixLabelContactScnd, 'Gender' => $genderLabelContactScnd, ), + 2 => array( + 'First Name' => $firstContactName, + 'Last Name' => 'Smith', + 'Email' => '' . strtolower($emailContactFirst) . '', + 'Sort Name' => $sortFirstName, + 'Display Name' => $prefixLabelContactFrst . ' ' . $displayFirstName . ' ' . $suffixLabelContactFrst, + 'Individual Prefix' => $prefixLabelContactFrst, + 'Individual Suffix' => $suffixLabelContactFrst, + 'Gender' => $genderLabelContactFrst, + ), ); // Read CSV and fire assertions. @@ -239,19 +239,19 @@ function testContactExport() { // All other rows to be check. $checkRows = array( 1 => array( - 'First Name' => $firstName, - 'Last Name' => 'Smith', - 'Email' => "$firstName.smith@example.org", - 'Sort Name' => $sortName, - 'Display Name' => $displayName, - ), - 2 => array( 'First Name' => $childName, 'Last Name' => 'John', 'Email' => "$childName.john@example.org", 'Sort Name' => $childSortName, 'Display Name' => $childDisplayName, ), + 2 => array( + 'First Name' => $firstName, + 'Last Name' => 'Smith', + 'Email' => "$firstName.smith@example.org", + 'Sort Name' => $sortName, + 'Display Name' => $displayName, + ), ); // Read CSV and fire assertions. @@ -282,7 +282,7 @@ function testMergeHousehold() { $this->type("address_1_street_address", "121A Sherman St. Apt. 12"); $this->type("address_1_city", "Dumfries"); $this->type("address_1_postal_code", "1234"); - $this->assertElementContainsText('address_table_1', "- select - United States"); + $this->select("address_1_country_id", "United States"); $this->select("address_1_state_province_id", "value=1019"); $this->click('_qf_Contact_upload_view'); diff --git a/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php b/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php index c4e56352ccb7..51eaad27fdf1 100644 --- a/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php +++ b/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php @@ -97,10 +97,10 @@ function testOfflineMembershipRenew() { // page was loaded $this->waitForTextPresent($sourceText); - $this->waitForElementPresent("xpath=//div[@id='memberships']//table/tbody/tr/td[9]/span/a[text()='View']"); + $this->waitForElementPresent("xpath=//div[@id='memberships']//table/tbody/tr/td[9]/span[1]/a[text()='View']"); // click through to the membership view screen - $this->click("xpath=//div[@id='memberships']//table/tbody/tr/td[9]/span/a[text()='View']"); + $this->click("xpath=//div[@id='memberships']//table/tbody/tr/td[9]/span[1]/a[text()='View']"); $this->waitForElementPresent('_qf_MembershipView_cancel-bottom'); @@ -186,10 +186,10 @@ function testOfflineMemberRenewOverride() { // Is status message correct? $this->waitForText('crm-notification-container', "{$membershipTypes['membership_type']} membership for $firstName Memberson has been added."); - $this->waitForElementPresent("xpath=//div[@id='memberships']//table/tbody/tr/td[9]/span[2][text()='more']/ul/li/a[text()='Renew']"); + $this->waitForElementPresent("xpath=//div[@id='memberships']/div/table/tbody/tr/td[9]/span[2][text()='more']/ul/li[1]/a[text()='Renew']"); // click through to the Membership Renewal Link - $this->click("xpath=//div[@id='memberships']//table/tbody/tr/td[9]/span[2][text()='more']/ul/li/a[text()='Renew']"); + $this->click("xpath=//div[@id='memberships']/div/table/tbody/tr/td[9]/span[2][text()='more']/ul/li[1]/a[text()='Renew']"); $this->waitForElementPresent('_qf_MembershipRenewal_cancel-bottom'); diff --git a/tests/phpunit/WebTest/Report/LoggingReportTest.php b/tests/phpunit/WebTest/Report/LoggingReportTest.php index 5ce5c1938bb6..75dd98d717b9 100644 --- a/tests/phpunit/WebTest/Report/LoggingReportTest.php +++ b/tests/phpunit/WebTest/Report/LoggingReportTest.php @@ -177,6 +177,7 @@ function testLoggingReport() { //visit the logging contact summary report $this->openCiviPage('report/logging/contact/summary', 'reset=1'); + $this->waitForElementPresent('altered_contact_value'); $this->type('altered_contact_value', $firstName); $this->click("_qf_LoggingSummary_submit"); $this->waitForPageToLoad($this->getTimeoutMsec()); From aa8694283672ed6493cde75e91296db6ac47c178 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 13 Jan 2015 20:25:45 -0500 Subject: [PATCH 2/2] CRM-15817 - Fix merge error --- CRM/Core/Payment/BaseIPN.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Core/Payment/BaseIPN.php b/CRM/Core/Payment/BaseIPN.php index 3034ab939a40..6aa92b45f147 100644 --- a/CRM/Core/Payment/BaseIPN.php +++ b/CRM/Core/Payment/BaseIPN.php @@ -596,7 +596,7 @@ function completeTransaction(&$input, &$ids, &$objects, &$transaction, $recur = if ($contribution->id) { $contributionStatuses = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); if ((empty($input['prevContribution']) && $paymentProcessorId) || (!$input['prevContribution']->is_pay_later && -- $input['prevContribution']->contribution_status_id == array_search('Pending', $contributionStatuses))) { + $input['prevContribution']->contribution_status_id == array_search('Pending', $contributionStatuses))) { $input['payment_processor'] = $paymentProcessorId; } $input['contribution_status_id'] = array_search('Completed', $contributionStatuses);