From: monishdeb Date: Sat, 7 Nov 2015 16:40:17 +0000 (+0530) Subject: webtest fixes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=352c43f7f5bc69e1b4532241ae783a8702d1098d;p=civicrm-core.git webtest fixes --- diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index d3085edc7e..ea99fd3032 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -211,6 +211,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu foreach ($this->_priceSet['fields'] as $key => $val) { foreach ($val['options'] as $keys => $values) { $opMemTypeId = CRM_Utils_Array::value('membership_type_id', $values); + $priceFieldName = 'price_' . $values['price_field_id']; $priceFieldValue = CRM_Price_BAO_PriceSet::getPriceFieldValueFromURL($this, $priceFieldName); if (!empty($priceFieldValue)) { CRM_Price_BAO_PriceSet::setDefaultPriceSetField($priceFieldName, $priceFieldValue, $val['html_type'], $this->_defaults); @@ -603,7 +604,8 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu $self->_useForMember ) ) { - $lifeMember = CRM_Member_BAO_Membership::getAllContactMembership($self->_membershipContactID, FALSE, TRUE); + $isTest = ($self->_action & CRM_Core_Action::PREVIEW) ? TRUE : FALSE; + $lifeMember = CRM_Member_BAO_Membership::getAllContactMembership($self->_membershipContactID, $isTest, TRUE); $membershipOrgDetails = CRM_Member_BAO_MembershipType::getMembershipTypeOrganization(); diff --git a/tests/phpunit/WebTest/Contribute/PCPAddTest.php b/tests/phpunit/WebTest/Contribute/PCPAddTest.php index 2011e1091c..12efb80907 100755 --- a/tests/phpunit/WebTest/Contribute/PCPAddTest.php +++ b/tests/phpunit/WebTest/Contribute/PCPAddTest.php @@ -176,7 +176,7 @@ class WebTest_Contribute_PCPAddTest extends CiviSeleniumTestCase { //Find Contribution $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low"); $this->waitForElementPresent('contribution_pcp_made_through_id'); - $this->select2('pcp_made_through_id', $lastName . ', ' . $firstName); + $this->select2('contribution_pcp_made_through_id', $lastName . ', ' . $firstName); $this->clickLink("_qf_Search_refresh", "xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[11]/span/a[1][text()='View']"); $this->click("xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[11]/span/a[1][text()='View']"); diff --git a/tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php b/tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php index a857753ca7..e17b9104e4 100755 --- a/tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php +++ b/tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php @@ -120,7 +120,7 @@ class WebTest_Member_DefaultMembershipPricesetTest extends CiviSeleniumTestCase $this->_testDefaultSenarios("national_membership_{$title}-section", 1); $this->contactInfoFill($firstName, $lastName, $email, $contactParams, $streetAddress); - $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom"); + $this->clickLink("_qf_Main_upload-bottom", "_qf_Main_upload-bottom"); $this->assertTrue($this->isTextPresent("You already have a lifetime membership and cannot select a membership with a shorter term.")); }