webtest fixes
authormonishdeb <monish.deb@webaccessglobal.com>
Sat, 7 Nov 2015 16:40:17 +0000 (22:10 +0530)
committermonishdeb <monish.deb@webaccessglobal.com>
Sat, 7 Nov 2015 16:40:17 +0000 (22:10 +0530)
CRM/Contribute/Form/Contribution/Main.php
tests/phpunit/WebTest/Contribute/PCPAddTest.php
tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php

index d3085edc7eaac4f84522f9cb8200cb7b90e27e5c..ea99fd3032f2609ca826c420a8278116b13970f8 100644 (file)
@@ -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();
 
index 2011e1091c8cc51d8594c01b6ce3043dceb49e15..12efb8090719f75075f500fc294a07e9bf69f9fe 100755 (executable)
@@ -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']");
index a857753ca7f0fd60f037ca58e5a64b304553151d..e17b9104e4522dca738a25ad7e622e9fe96ef53e 100755 (executable)
@@ -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."));
   }