<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
parent::setUp();
}
- function testAdvanceSearch() {
+ public function testAdvanceSearch() {
$this->webtestLogin();
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->select2("relationship_type_id", "Employee of");
$this->waitForElementPresent("xpath=//input[@id='related_contact_id'][@placeholder='- select organization -']");
$this->select2("related_contact_id", "Default", TRUE);
+ $this->waitForAjaxContent();
$this->webtestFillDate("start_date", "-1 day");
$this->webtestFillDate("end_date", "+1 day");
$this->clickAjaxLink('_qf_Relationship_upload-bottom', NULL);
'CiviEvent' => array('participant_fee_amount_high', 'addParticipantSearchDetail'),
'CiviMember' => array('member_end_date_high', 'addMemberSearchDetail'),
'CiviPledge' => array('pledge_frequency_interval', 'addPledgeSearchDetail'),
- 'relationship' => array("xpath=//div[@id='relationship']/table/tbody/tr//td/label[text()='Relationship Status']/../label[text()='All']", ''),
+ 'relationship' => array(
+ "xpath=//div[@id='relationship']/table/tbody/tr//td/label[text()='Relationship Status']/../label[text()='All']",
+ ''
+ ),
);
foreach ($searchBlockValues as $block => $blockValues) {
/*
* Check for CRM-9873
*/
- function testActivitySearchByTypeTest() {
+ public function testActivitySearchByTypeTest() {
$this->webtestLogin();
$this->openCiviPage('contact/search/advanced', 'reset=1');
$this->clickAjaxLink("activity", 'activity_subject');
$cal = $count / $perPageRow;
$mod = $count % $perPageRow;
$j = 1;
- for ($i=1; $i<=$cal; $i++) {
+ for ($i = 1; $i <= $cal; $i++) {
$subTotal = $i * $perPageRow;
$lastPageSub = $subTotal + 1;
//function to check match for sumbit Advance Search
/**
- * @param $firstName
+ * @param string $firstName
*/
- function submitSearch($firstName) {
+ public function submitSearch($firstName) {
$this->clickLink("_qf_Advanced_refresh");
// verify unique name
+ $this->waitForAjaxContent();
$this->waitForText("xpath=//div[@class='crm-search-results']/table/tbody", preg_quote("adv$firstName, $firstName"));
// should give 1 result only as we are searching with unique name
$this->waitForText("xpath=//div[@id='search-status']/table/tbody/tr/td", preg_quote("1 Contact"));
/*
* Check for CRM-14952
*/
- function testStateSorting() {
+ public function testStateSorting() {
$this->webtestLogin();
$this->openCiviPage('contact/search/advanced', 'reset=1', 'group');
$this->select2("group", "Newsletter", TRUE);
+ $this->select2("group", "Summer", TRUE);
$this->select2("group", "Advisory", TRUE);
$this->clickAjaxLink("location", 'country');
- $this->select2("country", "United States", False);
- $this->clickLink("_qf_Advanced_refresh");
-
- $stateBeforeSort = $this->getText("xpath=//div[@class='crm-search-results']//table/tbody/tr[1]/td[6]");
- $this->click("xpath=//div[@class='crm-search-results']//table/thead/tr//th/a[contains(text(),'State')]");
- $this->waitForElementPresent("xpath=//div[@class='crm-search-results']//table/thead/tr//th/a[contains(text(),'State')]");
- $this->assertElementNotContainsText("xpath=//div[@class='crm-search-results']//table/tbody/tr[1]/td[6]", $stateBeforeSort);
- $this->clickAjaxLink("xpath=//form[@id='Advanced']//div//div[contains(text(),'Edit Search Criteria')]/../div", 'group');
- $this->select2("group", "Summer", TRUE);
+ $this->select2("country", "United States", FALSE);
$this->waitForElementPresent('state_province');
- $this->select2("state_province", "Ohio", TRUE);
- $this->select2("state_province", "New York", TRUE);
- $this->select2("state_province", "New Mexico", TRUE);
- $this->select2("state_province", "Mississippi", TRUE);
- $this->select2("state_province", "Connecticut", TRUE);
- $this->select2("state_province", "Georgia", TRUE);
- $this->select2("state_province", "New Jersey", TRUE);
- $this->select2("state_province", "Texas", TRUE);
- $this->clickLink("_qf_Advanced_refresh");
+ $this->multiselect2("state_province", array(
+ "Ohio",
+ "New York",
+ "New Mexico",
+ "Connecticut",
+ "Georgia",
+ "New Jersey",
+ "Texas"
+ ));
+ $this->clickLink("_qf_Advanced_refresh", "xpath=//div[@class='crm-search-results']//table/tbody/tr[1]/td[6]");
$stateBeforeSort = $this->getText("xpath=//div[@class='crm-search-results']//table/tbody/tr[1]/td[6]");
- $this->click("xpath=//div[@class='crm-search-results']//table/thead/tr//th/a[contains(text(),'State')]");
+ $this->clickAjaxLink("xpath=//div[@class='crm-search-results']//table/thead/tr//th/a[contains(text(),'State')]");
$this->waitForElementPresent("xpath=//div[@class='crm-search-results']//table/thead/tr//th/a[contains(text(),'State')]");
$this->assertElementNotContainsText("xpath=//div[@class='crm-search-results']//table/tbody/tr[1]/td[6]", $stateBeforeSort);
}
// function to fill basic search detail
/**
- * @param $firstName
- * @param $groupName
+ * @param string $firstName
+ * @param string $groupName
* @param $tagName
*/
- function addBasicSearchDetail($firstName, $groupName, $tagName) {
+ public function addBasicSearchDetail($firstName, $groupName, $tagName) {
// fill partial sort name
$this->type("sort_name", "$firstName");
// select subtype
/**
* @param $firstName
*/
- function addAddressSearchDetail($firstName) {
+ public function addAddressSearchDetail($firstName) {
// select location type (home and main)
$this->multiselect2('location_type', array('Home', 'Main'));
// fill street address
/**
* @param $firstName
*/
- function addActivitySearchDetail($firstName) {
+ public function addActivitySearchDetail($firstName) {
// check activity types
$checkActivityTypes = array("Contribution", "Event Registration", "Membership Signup");
foreach ($checkActivityTypes as $labels) {
$this->click("xpath=//div[@id='activity']/table/tbody/tr[2]/td[1]/div[1]//div/label[text()=\"$labels\"]");
}
// fill date range
- $this->select("activity_date_relative","value=0");
+ $this->select("activity_date_relative", "value=0");
$this->webtestFillDate("activity_date_low", "-1 day");
$this->webtestFillDate("activity_date_high", "+1 day");
$this->type("activity_subject", "Student - membership source$firstName - Status: New");
}
// function to fill demographic search details
- function addDemographicSearchDetail() {
+ public function addDemographicSearchDetail() {
// fill birth date range
- $this->select("birth_date_relative","value=0");
+ $this->select("birth_date_relative", "value=0");
$this->webtestFillDate("birth_date_low", "-3 year");
$this->webtestFillDate("birth_date_high", "now");
// fill deceased date range
$this->click("xpath=//div[@id='demographics']/table/tbody//tr/td/label[text()='Deceased']/../label[text()='Yes']");
- $this->select("deceased_date_relative","value=0");
+ $this->select("deceased_date_relative", "value=0");
$this->webtestFillDate("deceased_date_low", "-1 month");
$this->webtestFillDate("deceased_date_high", "+1 month");
// fill gender (male)
/**
* @param $firstName
*/
- function addContributionSearchDetail($firstName) {
+ public function addContributionSearchDetail($firstName) {
// fill contribution date range
- $this->select("contribution_date_relative","value=0");
+ $this->select("contribution_date_relative", "value=0");
$this->webtestFillDate("contribution_date_low", "-1 day");
$this->webtestFillDate("contribution_date_high", "+1 day");
// fill amount range
$this->type("contribution_check_number", "chqNo$firstName");
// fill transaction id
$this->type("contribution_transaction_id", "trid$firstName");
- // fill financial type
- $this->select("financial_type_id", "Event Fee");
+ // fill financial type
+ $this->select("financial_type_id", "Event Fee");
// fill currency type
$this->select("contribution_currency_type", "USD");
}
// function to fill participant search details
- function addParticipantSearchDetail() {
+ public function addParticipantSearchDetail() {
// fill event name
$this->select2("event_id", "Fall Fundraiser Dinner");
// fill event type
/**
* @param $firstName
*/
- function addMemberSearchDetail($firstName) {
+ public function addMemberSearchDetail($firstName) {
// check membership type (Student)
$this->click("xpath=//div[@id='memberForm']/table/tbody/tr[1]/td[1]/div[1]//div/label[text()='Student']");
// check membership status (completed)
// check to search primary member
$this->click("xpath=//div[@id='memberForm']/table/tbody/tr[2]/td[2]/p/input");
// add join date range
- $this->select("member_join_date_relative","value=0");
+ $this->select("member_join_date_relative", "value=0");
$this->webtestFillDate("member_join_date_low", "-1 day");
$this->webtestFillDate("member_join_date_high", "+1 day");
// add start date range
- $this->select("member_start_date_relative","value=0");
+ $this->select("member_start_date_relative", "value=0");
$this->webtestFillDate("member_start_date_low", "-1 day");
$this->webtestFillDate("member_start_date_high", "+1 day");
// add end date range
- $this->select("member_end_date_relative","value=0");
+ $this->select("member_end_date_relative", "value=0");
$this->webtestFillDate("member_end_date_low", "-1 year");
$this->webtestFillDate("member_end_date_high", "+2 year");
}
/**
* @param $firstName
*/
- function addPledgeSearchDetail($firstName) {
+ public function addPledgeSearchDetail($firstName) {
// fill pledge schedule date range
- $this->select("pledge_payment_date_relative","value=0");
+ $this->select("pledge_payment_date_relative", "value=0");
$this->webtestFillDate("pledge_payment_date_low", "-1 day");
$this->webtestFillDate("pledge_payment_date_high", "+1 day");
// fill Pledge payment status
/**
* @param null $firstName
*/
- function createDetailContact($firstName = NULL) {
+ public function createDetailContact($firstName = NULL) {
if (!$firstName) {
$firstName = substr(sha1(rand()), 0, 7);
}
$this->assertElementContainsText('css=.crm-summary-display_name', "$firstName adv$firstName");
}
}
-