INFRA-132 - Drupal.Classes.ClassDeclaration
[civicrm-core.git] / tests / phpunit / WebTest / Member / OfflineAutoRenewMembershipTest.php
index 4233c31d9e34a875260b62d08f8448c61a323f7e..aedf1fe040111d790ba5c6025c72222be9d3305d 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -35,7 +35,7 @@ class WebTest_Member_OfflineAutoRenewMembershipTest extends CiviSeleniumTestCase
     parent::setUp();
   }
 
-  function testOfflineAutoRenewMembership() {
+  public function testOfflineAutoRenewMembership() {
     $this->webtestLogin();
 
     // We need a payment processor
@@ -43,10 +43,10 @@ class WebTest_Member_OfflineAutoRenewMembershipTest extends CiviSeleniumTestCase
     $this->webtestAddPaymentProcessor($processorName, 'AuthNet');
 
     // Create a membership type to use for this test
-    $periodType        = 'rolling';
+    $periodType = 'rolling';
     $duration_interval = 1;
-    $duration_unit     = 'year';
-    $auto_renew        = "optional";
+    $duration_unit = 'year';
+    $auto_renew = "optional";
 
     $memTypeParams = $this->webtestAddMembershipType($periodType, $duration_interval, $duration_unit, $auto_renew);
 
@@ -84,18 +84,9 @@ class WebTest_Member_OfflineAutoRenewMembershipTest extends CiviSeleniumTestCase
 
     $this->webtestAddCreditCardDetails();
 
-    // since country is not pre-selected for offline mode
-    $this->select("billing_country_id-5", "label=United States");
-    //wait for states to populate the select box
-    // Because it tends to cause problems, all uses of sleep() must be justified in comments
-    // Sleep should never be used for wait for anything to load from the server
-    // Justification for this instance: FIXME
-    sleep(2);
-    $this->click('billing_state_province_id-5');
     $this->webtestAddBillingDetails($firstName, NULL, $lastName);
 
-    $this->click("_qf_Membership_upload-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->clickLink("_qf_Membership_upload-bottom");
 
     // Use Find Members to make sure membership exists
     $this->openCiviPage("member/search", "reset=1", "member_end_date_high");
@@ -103,8 +94,7 @@ class WebTest_Member_OfflineAutoRenewMembershipTest extends CiviSeleniumTestCase
     $this->type("sort_name", "$firstName $lastName");
     $this->click("member_test");
     $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='memberSearch']/table/tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->click("xpath=//div[@id='memberSearch']/table/tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
+    $this->clickAjaxLink("xpath=//div[@id='memberSearch']/table/tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_MembershipView_cancel-bottom");
 
     // View Membership Record
     $verifyData = array(
@@ -119,7 +109,6 @@ class WebTest_Member_OfflineAutoRenewMembershipTest extends CiviSeleniumTestCase
         preg_quote($value)
       );
     }
-    $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
   }
-}
 
+}