<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
+
+/**
+ * Class WebTest_Member_StandaloneAddTest
+ */
class WebTest_Member_StandaloneAddTest extends CiviSeleniumTestCase {
protected function setUp() {
function testStandaloneMemberAdd() {
- $this->open($this->sboxPath);
$this->webtestLogin();
// create contact
$membershipTypes = $this->webtestAddMembershipType();
// now add membership
- $this->open($this->sboxPath . "civicrm/member/add?reset=1&action=add&context=standalone");
-
- $this->waitForElementPresent("_qf_Membership_upload");
+ $this->openCiviPage("member/add", "reset=1&action=add&context=standalone", "_qf_Membership_upload");
// select contact
$this->webtestFillAutocomplete($firstName);
// fill in Status Override?
// fill in Record Membership Payment?
-
+ $this->click("send_receipt");
+ $this->assertTrue($this->isChecked("send_receipt"), 'Send Confirmation and Receipt checkbox should be checked.');
$this->click("_qf_Membership_upload");
//View Membership
$this->waitForElementPresent("xpath=//div[@id='memberships']//table//tbody/tr[1]/td[9]/span/a[text()='View']");
$this->click("xpath=//div[@id='memberships']//table/tbody/tr[1]/td[9]/span/a[text()='View']");
$this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
+
$expected = array(
- 2 => $membershipTypes['membership_type'],
- 3 => 'New',
- 4 => 'Membership StandaloneAddTest Webtest',
+ 'Membership Type' => $membershipTypes['membership_type'],
+ 'Status' => 'New',
+ 'Source' => 'Membership StandaloneAddTest Webtest',
);
- foreach ($expected as $label => $value) {
- $this->verifyText("xpath=id('MembershipView')/div[2]/div/table[1]/tbody/tr[$label]/td[2]", preg_quote($value));
- }
+ $this->webtestVerifyTabularData($expected);
}
function testStandaloneMemberOverrideAdd() {
- $this->open($this->sboxPath);
$this->webtestLogin();
// add contact
$membershipTypes = $this->webtestAddMembershipType();
// add membership
- $this->open($this->sboxPath . "civicrm/member/add?reset=1&action=add&context=standalone");
-
- $this->waitForElementPresent("_qf_Membership_upload");
+ $this->openCiviPage("member/add", "reset=1&action=add&context=standalone", "_qf_Membership_upload");
// select contact
$this->webtestFillAutocomplete($firstName);
$this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
$expected = array(
- 2 => $membershipTypes['membership_type'],
- 3 => 'Grace',
- 4 => 'Membership StandaloneAddTest Webtest',
+ 'Membership Type' => $membershipTypes['membership_type'],
+ 'Status' => 'Grace',
+ 'Source' => 'Membership StandaloneAddTest Webtest',
);
- foreach ($expected as $label => $value) {
- $this->verifyText("xpath=id('MembershipView')/div[2]/div/table[1]/tbody/tr[$label]/td[2]", preg_quote($value));
- }
+ $this->webtestVerifyTabularData($expected);
}
-}
+ function testAjaxCustomGroupLoad() {
+ $this->webtestLogin();
+ $triggerElement = array('name' => 'membership_type_id_1', 'type' => 'select');
+ $customSets = array(
+ array('entity' => 'Membership', 'subEntity' => 'General', 'triggerElement' => $triggerElement),
+ array('entity' => 'Membership', 'subEntity' => 'Student', 'triggerElement' => $triggerElement)
+ );
+
+ $pageUrl = array('url' => 'member/add', 'args' => 'reset=1&action=add&context=standalone');
+ //case where we should fire certain
+ //ui actions which helps triggering possible
+ $test = $this;
+ $this->customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl,
+ function() use ($test) {
+ $test->select('membership_type_id_0', 'value=1');
+ }
+ );
+ }
+}