Fixed some contribution pages
[civicrm-core.git] / tests / phpunit / WebTest / Member / SeperateMembershipPaymentTest.php
index 70724c0201a239b2d7dc80dfdb89a9f31ba47623..f3b038bb1a7ab6b7ac2dbef0472c52ccffc3e03a 100644 (file)
@@ -36,11 +36,6 @@ class WebTest_Member_SeperateMembershipPaymentTest extends CiviSeleniumTestCase
     // a random 7-char string and an even number to make this pass unique
     $hash = substr(sha1(rand()), 0, 7);
     $rand = 2 * rand(2, 50);
-    // This is the path where our testing install resides.
-    // The rest of URL is defined in CiviSeleniumTestCase base class, in
-    // class attributes.
-    $this->open($this->sboxPath);
-
     // Log in using webtestLogin() method
     $this->webtestLogin();
 
@@ -152,20 +147,16 @@ class WebTest_Member_SeperateMembershipPaymentTest extends CiviSeleniumTestCase
 
   function _testOnlineMembershipSignup($pageId, $memTypeId, $cid = NULL) {
     //Open Live Contribution Page
+    $args = array('reset' => 1, 'id' => $pageId);
     if ($cid) {
-      $contribUrl = array('url' => "contribute/transact", 'args' => "reset=1&id=$pageId&cid=$cid");
-    }
-    else {
-      $contribUrl = array('url' => "contribute/transact", 'args' => "reset=1&id=$pageId");
+      $args['cid'] = $cid;
     }
-    $this->openCiviPage($contribUrl['url'], $contribUrl['args'], '_qf_Main_upload-bottom');
+    $this->openCiviPage("contribute/transact", $args, '_qf_Main_upload-bottom');
 
     // Select membership type 1
     $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label/span[2][contains(text(),'$memTypeId')]");
     $this->type("xpath=//div[@class='crm-section other_amount-section']//div[2]/input", 60);
-    $this->click("_qf_Main_upload-bottom");
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
-    $this->click("_qf_Confirm_next-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Confirm_next-bottom", NULL);
   }
-}
\ No newline at end of file
+}