<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
*/
require_once 'CiviTest/CiviSeleniumTestCase.php';
+
+/**
+ * Class WebTest_Member_OfflineAutoRenewMembershipTest
+ */
class WebTest_Member_OfflineAutoRenewMembershipTest extends CiviSeleniumTestCase {
protected function setUp() {
parent::setUp();
}
- function testOfflineAutoRenewMembership() {
+ public function testOfflineAutoRenewMembership() {
$this->webtestLogin();
// We need a payment processor
$this->click('css=li#tab_member a');
$this->waitForElementPresent('link=Submit Credit Card Membership');
- $this->click('link=Submit Credit Card Membership');
- $this->waitForPageToLoad($this->getTimeoutMsec());
// since we don't have live credentials we will switch to test mode
- $url = $this->getLocation();
+ $url = $this->getAttribute("xpath=//div[@class='view-content']//div[@class='action-link']/a[2]@href");
$url = str_replace('mode=live', 'mode=test', $url);
$this->open($url);
$this->waitForPageToLoad($this->getTimeoutMsec());
$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");
$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(
preg_quote($value)
);
}
- $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
}
}
-