<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
*/
require_once 'CiviTest/CiviSeleniumTestCase.php';
+
+/**
+ * Class WebTest_Member_FixedMembershipTypeTest
+ */
class WebTest_Member_FixedMembershipTypeTest extends CiviSeleniumTestCase {
protected function setUp() {
parent::setUp();
}
- function testMembershipTypeScenario1() {
+ public function testMembershipTypeScenario1() {
// Scenario 1
// Rollover Date < Start Date
// Join Date > Rollover Date and Join Date < Start Date
$this->waitForElementPresent('_qf_MembershipType_cancel-bottom');
$this->type('name', "Membership Type $title");
- $this->select2('member_of_contact_id',$title);
+ $this->select2('member_of_contact_id', $title);
$this->type('minimum_fee', '100');
- $this->select( 'financial_type_id', 'value=2' );
+ $this->select('financial_type_id', 'value=2');
$this->type('duration_interval', 1);
$this->select('duration_unit', "label=year");
$this->click('_qf_MembershipType_upload-bottom');
$this->waitForElementPresent('link=Add Membership Type');
- $this->waitForText('crm-notification-container',"The membership type 'Membership Type $title' has been saved.");
+ $this->waitForText('crm-notification-container', "The membership type 'Membership Type $title' has been saved.");
$this->openCiviPage("contact/add", "reset=1&ct=Individual");
require_once 'CRM/Core/Config.php';
require_once 'CRM/Utils/Array.php';
require_once 'CRM/Utils/Date.php';
- $currentYear = date('Y');
+ $currentYear = date('Y');
$currentMonth = date('m');
$previousYear = $currentYear - 1;
- $nextYear = $currentYear + 1;
+ $nextYear = $currentYear + 1;
$todayDate = date('Y-m-d');
$configVars = new CRM_Core_Config_Variables();
foreach (array(
- 'joinDate', 'startDate', 'endDate') as $date) {
+ 'joinDate',
+ 'startDate',
+ 'endDate',
+ ) as $date) {
$$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull);
}
// Clicking save.
$this->click('_qf_Membership_upload');
- $this->waitForPageToLoad($this->getTimeoutMsec());
// page was loaded
$this->waitForTextPresent($sourceText);
+ $this->waitForElementPresent("xpath=//div[@id='memberships']//table//tbody/tr[1]/td[9]/span/a[text()='View']");
// Is status message correct?
$this->assertTrue($this->isTextPresent("Membership Type $title membership for $firstName $lastName has been added."),
"Status message didn't show up after saving!"
);
}
- function testMembershipTypeScenario2() {
+ public function testMembershipTypeScenario2() {
// Scenario 2
// Rollover Date < Join Date
$this->waitForElementPresent('_qf_MembershipType_cancel-bottom');
$this->type('name', "Membership Type $title");
- $this->select2('member_of_contact_id',$title);
+ $this->select2('member_of_contact_id', $title);
$this->type('minimum_fee', '100');
- $this->select( 'financial_type_id', 'value=2' );
+ $this->select('financial_type_id', 'value=2');
$this->type('duration_interval', 2);
$this->select('duration_unit', "label=year");
$this->click('_qf_MembershipType_upload-bottom');
$this->waitForElementPresent('link=Add Membership Type');
- $this->waitForText('crm-notification-container',"The membership type 'Membership Type $title' has been saved.");
+ $this->waitForText('crm-notification-container', "The membership type 'Membership Type $title' has been saved.");
$this->openCiviPage("contact/add", "reset=1&ct=Individual");
require_once 'CRM/Core/Config.php';
require_once 'CRM/Utils/Array.php';
require_once 'CRM/Utils/Date.php';
- $currentYear = date('Y');
+ $currentYear = date('Y');
$currentMonth = date('m');
$previousYear = $currentYear - 1;
$endDate = date('Y-m-d', mktime(0, 0, 0, 8, 31, $currentYear + 2));
$configVars = new CRM_Core_Config_Variables();
foreach (array(
- 'joinDate', 'startDate', 'endDate') as $date) {
+ 'joinDate',
+ 'startDate',
+ 'endDate',
+ ) as $date) {
$$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull);
}
// Clicking save.
$this->click('_qf_Membership_upload');
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->waitForElementPresent("xpath=//div[@id='memberships']//table//tbody/tr[1]/td[9]/span/a[text()='View']");
// page was loaded
$this->waitForTextPresent($sourceText);
);
}
- function testMembershipTypeScenario3() {
+ public function testMembershipTypeScenario3() {
// Scenario 3
// Standard Fixed scenario - Jan 1 Fixed Period Start and October 31 rollover
// Join Date is later than Rollover Date
$this->waitForElementPresent('_qf_MembershipType_cancel-bottom');
$this->type('name', "Membership Type $title");
- $this->select2('member_of_contact_id',$title);
+ $this->select2('member_of_contact_id', $title);
$this->type('minimum_fee', '100');
- $this->select( 'financial_type_id', 'value=2' );
+ $this->select('financial_type_id', 'value=2');
$this->type('duration_interval', 1);
$this->select('duration_unit', "label=year");
$this->click('_qf_MembershipType_upload-bottom');
$this->waitForElementPresent('link=Add Membership Type');
- $this->waitForText('crm-notification-container',"The membership type 'Membership Type $title' has been saved.");
+ $this->waitForText('crm-notification-container', "The membership type 'Membership Type $title' has been saved.");
$this->openCiviPage("contact/add", "reset=1&ct=Individual");
$firstName = "John_" . substr(sha1(rand()), 0, 7);
require_once 'CRM/Core/Config.php';
require_once 'CRM/Utils/Array.php';
require_once 'CRM/Utils/Date.php';
- $currentYear = date('Y');
+ $currentYear = date('Y');
$currentMonth = date('m');
$previousYear = $currentYear - 1;
- $nextYear = $currentYear + 1;
- $todayDate = date('Y-m-d');
- $joinDate = date('Y-m-d', mktime(0, 0, 0, 11, 15, $currentYear));
- $startDate = date('Y-m-d', mktime(0, 0, 0, 1, 1, $currentYear));
- $endDate = date('Y-m-d', mktime(0, 0, 0, 12, 31, $nextYear));
- $configVars = new CRM_Core_Config_Variables();
+ $nextYear = $currentYear + 1;
+ $todayDate = date('Y-m-d');
+ $joinDate = date('Y-m-d', mktime(0, 0, 0, 11, 15, $currentYear));
+ $startDate = date('Y-m-d', mktime(0, 0, 0, 1, 1, $currentYear));
+ $endDate = date('Y-m-d', mktime(0, 0, 0, 12, 31, $nextYear));
+ $configVars = new CRM_Core_Config_Variables();
foreach (array(
- 'joinDate', 'startDate', 'endDate') as $date) {
+ 'joinDate',
+ 'startDate',
+ 'endDate',
+ ) as $date) {
$$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull);
}
// Clicking save.
$this->click('_qf_Membership_upload');
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->waitForElementPresent("xpath=//div[@id='memberships']//table//tbody/tr[1]/td[9]/span/a[text()='View']");
// page was loaded
$this->waitForTextPresent($sourceText);
);
}
- function testMembershipTypeScenario4() {
+ public function testMembershipTypeScenario4() {
// Scenario 4
// Standard Fixed scenario - Jan 1 Fixed Period Start and October 31 rollover
// Join Date is earlier than Rollover Date
$this->waitForElementPresent('_qf_MembershipType_cancel-bottom');
$this->type('name', "Membership Type $title");
- $this->select2('member_of_contact_id',$title);
+ $this->select2('member_of_contact_id', $title);
$this->type('minimum_fee', '100');
- $this->select( 'financial_type_id', 'value=2' );
+ $this->select('financial_type_id', 'value=2');
$this->type('duration_interval', 1);
$this->select('duration_unit', "label=year");
$this->click('_qf_MembershipType_upload-bottom');
$this->waitForElementPresent('link=Add Membership Type');
- $this->waitForText('crm-notification-container',"The membership type 'Membership Type $title' has been saved.");
+ $this->waitForText('crm-notification-container', "The membership type 'Membership Type $title' has been saved.");
$this->openCiviPage("contact/add", "reset=1&ct=Individual");
require_once 'CRM/Core/Config.php';
require_once 'CRM/Utils/Array.php';
require_once 'CRM/Utils/Date.php';
- $currentYear = date('Y');
+ $currentYear = date('Y');
$currentMonth = date('m');
- $nextYear = $currentYear + 1;
- $todayDate = date('Y-m-d');
+ $nextYear = $currentYear + 1;
+ $todayDate = date('Y-m-d');
// the member-since date we will type in to membership form
$joinDate = date('Y-m-d', mktime(0, 0, 0, 1, 15, $currentYear));
// expected calc'd start and end dates
- $startDate = date('Y-m-d', mktime(0, 0, 0, 1, 1, $currentYear));
- $endDate = date('Y-m-d', mktime(0, 0, 0, 12, 31, $currentYear));
+ $startDate = date('Y-m-d', mktime(0, 0, 0, 1, 1, $currentYear));
+ $endDate = date('Y-m-d', mktime(0, 0, 0, 12, 31, $currentYear));
$configVars = new CRM_Core_Config_Variables();
foreach (array(
- 'joinDate', 'startDate', 'endDate') as $date) {
+ 'joinDate',
+ 'startDate',
+ 'endDate',
+ ) as $date) {
$$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull);
}
// Clicking save.
$this->click('_qf_Membership_upload');
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->waitForElementPresent("xpath=//div[@id='memberships']//table//tbody/tr[1]/td[9]/span/a[text()='View']");
// page was loaded
$this->waitForTextPresent($sourceText);
)
);
}
-}
+}