+--------------------------------------------------------------------+
*/
-
require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
/**
//$this->assertContains($sortName, $this->getValue('contact_1'), "autocomplete expected $sortName but didn’t find it in " . $this->getValue('contact_1'));
}
-
/*
* 1. By default, when no strtotime arg is specified, sets date to "now + 1 month"
* 2. Does not set time. For setting both date and time use webtestFillDateTime() method.
$this->assertTrue($this->isTextPresent($text), 'Missing text: ' . $text);
}
-
if ($widget) {
// fill in step 8 (Widget Settings)
$this->click('link=Widgets');
// click through to the Activity view screen
$this->click("xpath=//div[@id='Activities']//table/tbody/tr[2]/td[9]/span/a[text()='View']");
$this->waitForElementPresent('_qf_Activity_cancel-bottom');
-
+
// parse URL to grab the activity id
// pass id back to any other tests that call this class
return $this->urlArg('id');
$this->waitForPageToLoad($this->getTimeoutMsec());
}
-
/**
* Edit Financial Account
*/
$this->type('accounting_code', $accountingCode);
}
-
// Autofill Edit Organization
if ($firstName) {
$this->webtestOrganisationAutocomplete($firstName);
$this->waitForPageToLoad($this->getTimeoutMsec());
}
-
/**
* Delete Financial Account
*/
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_ACL_AssignUsersToRolesTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Activity_ContactContextAddTest extends CiviSeleniumTestCase {
// button at the end of this page to show up, to make sure it's fully loaded.
$this->waitForElementPresent("_qf_Activity_upload");
-
// ...and verifying if the page contains properly formatted display name for chosen contact.
$this->assertElementContainsText('css=tr.crm-activity-form-block-target_contact_id td ul li.token-input-token-facebook', 'Anderson, ' . $firstName2, 'Contact not found in line ' . __LINE__);
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
require_once 'CiviTest/CiviMailUtils.php';
require_once 'ezc/Base/src/ezc_bootstrap.php';
// This variable is a bit awkward, but the ezc callback function needed to walk through the email parts needs to be static, so use this variable to "report back" on whether we found what we're looking for or not.
private static $foundIt = false;
-
protected function setUp() {
parent::setUp();
}
$this->assertElementContainsText('crm-notification-container', "Activity '$subject' has been saved.", "Status message didn't show up after saving!");
// check the resulting email
- $mail = $mailer->getMostRecentEmail( 'ezc' );
- $this->assertNotNull( $mail, ts('Assignee email not generated or problem locating it.') );
- $this->assertEquals( $mail->subject, "$subject" );
- $context = new ezcMailPartWalkContext( array( get_class($this), 'mailWalkCallback' ) );
- $mail->walkParts( $context, $mail );
+ $mail = $mailer->getMostRecentEmail('ezc');
+ $this->assertNotNull($mail, ts('Assignee email not generated or problem locating it.'));
+ $this->assertEquals($mail->subject, "$subject");
+ $context = new ezcMailPartWalkContext(array(get_class($this), 'mailWalkCallback'));
+ $mail->walkParts($context, $mail);
$mailer->stop();
- $this->assertTrue( self::$foundIt, ts('Generated email does not contain an ical attachment.') );
+ $this->assertTrue(self::$foundIt, ts('Generated email does not contain an ical attachment.'));
}
- public static function mailWalkCallback( $context, $mailPart ) {
- // echo "Class: " . get_class($mailPart) . "\n";
+ public static function mailWalkCallback($context, $mailPart) {
+
$disp = $mailPart->contentDisposition;
- if ( $disp ) {
- if ( $disp->disposition == 'attachment' ) {
- if ( $mailPart instanceof ezcMailText ) {
- if ( $mailPart->subType == 'calendar' ) {
+ if ($disp) {
+ if ($disp->disposition == 'attachment') {
+ if ($mailPart instanceof ezcMailText) {
+ if ($mailPart->subType == 'calendar') {
// For now we just check for existence.
self::$foundIt = true;
- // echo $mailPart->generateBody() . "\n";
}
}
}
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Activity_StandaloneAddTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Admin_CustomAddTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Admin_Form_ScheduleReminderTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Admin_Form_Setting_LocalizationTest extends CiviSeleniumTestCase {
}
}
-
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase {
$pre_move_values[$cid_to_missing]['source'] = $this->_loadDataFromApi($cid_to_missing, $from_group_id);
$pre_move_values[$cid_to_missing]['destination'] = $this->_loadDataFromApi($cid_to_missing, $to_group_id);
-
//ok, so after all that setup, we are now good to actually move a field
//first, pick a random field from the source group to move
$post_move_values[$cid_to_missing]['source'] = $this->_loadDataFromApi($cid_to_missing, $from_group_id);
$post_move_values[$cid_to_missing]['destination'] = $this->_loadDataFromApi($cid_to_missing, $to_group_id);
-
//Make sure that only the appropriate values have changed
foreach (array(
$cid_all, $cid_from_missing, $cid_to_missing) as $cid) {
//assert that the success text is present
$this->assertElementContainsText('crm-notification-container', "has been moved", "Move field success message not displayed");
- //assert that the custom field not on old data set page
+ //assert that the custom field not on old data set page
+
$this->assertTrue(!$this->isElementPresent("CustomField-" . $field_to_move), "The moved custom field still displays on the old fieldset page");
//go to the destination fieldset and make sure the field is present
}
}
-
$params = array('contact_id' => $contact_id);
foreach ($field_ids[$group_id] as $id) {
$params['return.custom_' . $id] = 1;
return $results;
}
-
//creates a new custom group and fields in that group, and returns the group Id
function _buildCustomFieldset($prefix) {
$group_id = $this->_createCustomGroup($prefix);
$this->waitForPageToLoad($this->getTimeoutMsec());
//Is custom field created?
- $this->assertElementContainsText('crm-notification-container', "Your custom field '$fieldLabel' has been saved.", "Field was not created successfully");
+ $this->assertElementContainsText('crm-notification-container', "Your custom field '$fieldLabel' has been saved.", "Field was not created successfully");
//get the custom id of the custom field that was just created
$results = $this->webtest_civicrm_api("CustomField", "get", array('label' => $fieldLabel, 'custom_group_id' => $group_id));
//randomly generates data for a specific custom field
function _fillCustomDataForContact($contact_id, $group_id) {
//edit the given contact
- $this->openCiviPage('contact/add', "reset=1&action=update&cid={$contact_id}");
+ $this->openCiviPage('contact/add', "reset=1&action=update&cid={$contact_id}");
$this->click("expand");
$this->waitForElementPresent("address_1_street_address");
}
}
-
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Admin_RelationshipTypeAddTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Campaign_ActivityTest extends CiviSeleniumTestCase {
$this->click("_qf_Campaign_upload-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertElementContainsText('crm-notification-container', "Campaign Campaign $title has been saved.",
+ $this->assertElementContainsText('crm-notification-container', "Campaign Campaign $title has been saved.",
+
"Status message didn't show up after saving campaign!"
);
// button at the end of this page to show up, to make sure it's fully loaded.
$this->waitForElementPresent("_qf_Activity_upload");
-
// ...and verifying if the page contains properly formatted display name for chosen contact.
$this->assertElementContainsText('css=tr.crm-activity-form-block-target_contact_id td ul li.token-input-token-facebook','Anderson, ' . $firstName2, 'Contact not found in line ' . __LINE__);
// click through to the Activity view screen
$this->click("xpath=//div[@id='Activities']//table/tbody//tr/td[2][text()='This is subject of test activity being added through activity tab of contact summary screen.']/../td[9]/span/a[text()='View']");
$this->waitForElementPresent('_qf_Activity_cancel-bottom');
-
+
// verify Activity created
$this->verifyText("xpath=id( 'Activity' )/div[2]/table[1]/tbody/tr[5]/td[2]", preg_quote($campaignTitle));
}
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Campaign_CampaignDescriptionTest extends CiviSeleniumTestCase {
function testCreateCampaign() {
-
$this->webtestLogin();
// Create new group
}
}
-
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Campaign_MailingTest extends CiviSeleniumTestCase {
$this->openCiviPage('campaign/add', 'reset=1', '_qf_Campaign_upload-bottom');
-
$campaignTitle = "Campaign $title";
$this->type("title", $campaignTitle);
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Campaign_MembershipTest extends CiviSeleniumTestCase {
function memberAddTest($campaignTitle, $id) {
//Add new memebershipType
$memTypeParams = $this->webtestAddMembershipType();
-
+
// Adding Adding contact with randomized first name for test testContactContextActivityAdd
// We're using Quick Add block on the main page for this.
$firstName = substr(sha1(rand()), 0, 7);
$this->click("campaign_id");
$this->select("campaign_id", "value=$id");
-
// Let Join Date stay default
// fill in Start Date
$this->webtestFillDate('start_date');
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Campaign_OfflineContributionTest extends CiviSeleniumTestCase {
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->assertTrue($this->isTextPresent("Changes Saved."));
- $this->openCiviPage('contribute/search', 'reset=1', '_qf_Search_refresh');
+ $this->openCiviPage('contribute/search', 'reset=1', '_qf_Search_refresh');
$this->type('sort_name', $firstName);
$this->click("_qf_Search_refresh");
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Campaign_OfflineEventRegistrationTest extends CiviSeleniumTestCase {
// Select an event fee
$this->waitForElementPresent('priceset');
$this->click("xpath=//div[@id='priceset']//input[1][@class='form-radio']");
-
+
// Select 'Record Payment'
$this->click("record_contribution");
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Campaign_OnlineContributionTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Campaign_PetitionUsageScenarioTest extends CiviSeleniumTestCase {
foreach ($expected as $column => $value) {
$this->verifyText("xpath=//table[@class='selector']/tbody/tr[2]/td[$column]", preg_quote($value));
}
-
+
// ONCE MORE, NO EMAIL VERIFICATION AND CUSTOM THANK-YOU
$this->openCiviPage("petition/add", "reset=1", "_qf_Petition_next-bottom");
// click Sign the petition.
$this->click("_qf_Signature_next-bottom");
$this->waitForElementPresent("thankyou_text");
-
+
// check that thank-you page has appropriate title and message
$this->assertTrue($this->isTextPresent("Awesome $title donation"));
$this->assertTrue($this->isTextPresent("Thank you for your kind contribution to support $title"));
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Campaign_PledgeTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase {
$this->click("_qf_Main_upload-bottom");
$this->waitForElementPresent("_qf_Questions_upload_next-bottom");
-
+
// Select the profile for the survey
$this->select("//form[@id='Questions']/div[2]/table/tbody/tr[1]/td[2]/div/div/span/select", "label=New Individual");
- // select the question created for the survey
+ // select the question created for the survey
+
$this->select("//form[@id='Questions']/div[2]/table/tbody/tr[2]/td[2]/div/div/span/select", "label=Profile $title");
$this->click("_qf_Questions_upload_next-bottom");
$this->check('is_searchable');
$this->check('in_selector');
$this->clickLink('_qf_Field_next_new-bottom', '_qf_Field_cancel-bottom');
-
+
// Custom Data Fields
$this->select('field_name[0]', "value=Contact");
$this->select('field_name[1]', "label=$field1 :: $customGroup");
$this->click("_qf_Main_upload-bottom");
$this->waitForElementPresent("_qf_Questions_upload_next-bottom");
-
+
//Select the profile for the survey
$this->select("//form[@id='Questions']/div[2]/table/tbody/tr[1]/td[2]/div/div/span/select", "label=New Individual");
- // select the question created for the survey
+ // select the question created for the survey
+
$this->select("//form[@id='Questions']/div[2]/table/tbody/tr[2]/td[2]/div/div/span/select", "label=$surveyProfile");
$this->click("_qf_Questions_upload_next-bottom");
$this->assertTrue($this->isTextPresent("Is equal to Reserved"));
// commenting out the print assertion as print dialog which appears breaks the webtest
- // as it is OS-related and cannot be handled through webtest
+ // as it is OS-related and cannot be handled through webtest
// $this->click('_qf_SurveyDetails_submit_print');
// $this->waitForPageToLoad($this->getTimeoutMsec());
$this->assertTrue($this->isTextPresent("Is equal to Interviewed"));
// commenting out the print assertion as print dialog which appears breaks the webtest
- // as it is OS-related and cannot be handled through webtest
+ // as it is OS-related and cannot be handled through webtest
// $this->click('_qf_SurveyDetails_submit_print');
// $this->waitForPageToLoad($this->getTimeoutMsec());
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase {
// Using helper webtestFillDate function.
$this->webtestFillDate('start_date', 'now');
$today = date('F jS, Y', strtotime('now'));
- // echo 'Today is ' . $today;
+
$this->type('duration', "20");
$this->clickLink('_qf_Case_upload-bottom', '_qf_CaseView_cancel-bottom');
// button at the end of this page to show up, to make sure it's fully loaded.
$this->waitForElementPresent("_qf_Activity_upload-bottom");
-
// ...and verifying if the page contains properly formatted display name for chosen contact.
$this->assertElementContainsText('css=tr.crm-activity-form-block-target_contact_id td ul li.token-input-token-facebook', 'Anderson, ' . $firstName2, "Contact not found in line " . __LINE__);
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Case_AddCaseTest extends CiviSeleniumTestCase {
// Using helper webtestFillDate function.
$this->webtestFillDate('start_date', 'now');
$today = date('F jS, Y', strtotime('now'));
- // echo 'Today is ' . $today;
+
$this->type("duration", "20");
$this->clickLink("_qf_Case_upload-bottom", "_qf_CaseView_cancel-bottom");
);
$this->_testVerifyOpenCaseActivity($subject, $openCaseData);
-
+
//change the case status to Resolved to get the end date
$this->click("xpath=//form[@id='CaseView']/div[2]/table/tbody/tr/td[4]/a");
$this->waitForElementPresent("_qf_Activity_cancel-bottom");
$this->select("case_status_id","value=2");
$this->click("_qf_Activity_upload-top");
$this->waitForPageToLoad($this->getTimeoutMsec());
-
+
$this->_testSearchbyDate($firstName, $lastName, "this.quarter");
$this->_testSearchbyDate($firstName, $lastName, "0");
$this->_testSearchbyDate($firstName, $lastName, "this.year");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->assertElementContainsText('Search', "$lastName, $firstName");
}
-
+
//Advanced Search
$this->openCiviPage('contact/search/advanced', 'reset=1', '_qf_Advanced_refresh');
$this->click("CiviCase");
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase {
$this->webtestFillDate('start_date', 'now');
$today = date('F jS, Y', strtotime('now'));
- // echo 'Today is ' . $today;
$this->type("duration", "20");
$this->type("{$cusId_1}", $custFname);
$this->type("{$cusId_2}", $custMname);
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Case_CaseDashboardTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_AddCmsUserTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_AddContactsToEventAdvancedSearchTest extends CiviSeleniumTestCase {
$this->webtestLogin();
$this->waitForPageToLoad($this->getTimeoutMsec());
-
// Advanced Search
$this->openCiviPage('contact/search/advanced', 'reset=1', '_qf_Advanced_refresh');
$this->click('_qf_Advanced_refresh');
$this->assertElementContainsText('css=tr.crm-participant-form-block-source span.description', 'Source for this registration (if applicable).');
-
// Clicking save.
$this->click('_qf_Participant_upload-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_AddTest extends CiviSeleniumTestCase {
$this->click("address_1_country_id");
$this->select("address_1_country_id", "value=" . $this->webtestGetValidCountryID());
- if($this->assertElementContainsText('address_1', "Latitude")) {
+ if($this->assertElementContainsText('address_1', "Latitude")) {
+
$this->type("address_1_geo_code_1", "1234");
$this->type("address_1_geo_code_2", "5678");
}
$this->type("phone_1_phone", "444-4444");
$this->select("phone_1_phone_type_id", "value=" . $this->webtestGetFirstValueForOptionGroup('phone_type'));
-
//fill in IM
$this->assertElementContainsText('im_1_provider_id', "Yahoo MSN AIM GTalk Jabber Skype");
$this->type("im_1_name", "testSkype");
$this->waitForElementPresent("preferred_language");
$this->select("preferred_language", "value=fr_FR");
-
//Notes section
$this->click("notesBlock");
$this->waitForElementPresent("subject");
}
}
-
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_AddViaProfileTest extends CiviSeleniumTestCase {
}
}
-
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_AddressParsingTest extends CiviSeleniumTestCase {
}
}
-
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase {
'locator' => 'contribution_amount_high',
'values' => array('1000'),
),
- 'Financial Type' =>
+ 'Financial Type' =>
+
array(
'type' => 'select',
'locator' => 'financial_type_id',
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_AdvanceSearchPrivacyOptionsTest extends CiviSeleniumTestCase {
$this->click('_qf_Advanced_refresh');
$this->waitForPageToLoad($this->getTimeoutMsec());
-
if (!$this->_searchSortNameCriteria($contactsReffOptions['dn_phone_mail']['first_name'], $contactsReffOptions['dn_phone_mail']['last_name']) && $this->_searchSortNameCriteria($contactsReffOptions['dn_trade_sms']['first_name'], $contactsReffOptions['dn_trade_sms']['last_name'])) {
$assertCheck = TRUE;
}
$this->_addPrivacyCriteria('include', $privacyOptions['dn_trade_sms'], 'AND', $allPrivacyOptions);
$this->click('_qf_Advanced_refresh');
$this->waitForPageToLoad($this->getTimeoutMsec());
-
+
if (!$this->_searchSortNameCriteria($contactsReffOptions['dn_phone_mail']['first_name'], $contactsReffOptions['dn_phone_mail']['last_name']) && !$this->_searchSortNameCriteria($contactsReffOptions['dn_phone_email']['first_name'], $contactsReffOptions['dn_phone_email']['last_name']) && $this->_searchSortNameCriteria($contactsReffOptions['dn_trade_sms']['first_name'], $contactsReffOptions['dn_trade_sms']['last_name'])) {
$assertCheck = TRUE;
}
$this->select('privacy_operator', "{$privacyOperator}");
foreach ($privacyOptions as $privacyOption) {
$privacyOptionVal = $this->getOptionVal($privacyOption);
-
+
if (!$this->isElementPresent("xpath=//ul[@id='crmasmList4']//li//span[text()='{$privacyOptionVal}']")) {
$this->select('crmasmSelect4', "value={$privacyOption}");
$this->waitForElementPresent("xpath=//ul[@id='crmasmList4']//li//span[text()='{$privacyOptionVal}']");
}
}
-
+
foreach ($allPrivacyOptions as $allPrivacyOption) {
if (!in_array($allPrivacyOption, $privacyOptions)) {
$privacyOptionVal = $this->getOptionVal($allPrivacyOption);
}
}
}
-
+
function _searchSortNameCriteria($firstName, $lastName) {
//type in the criteria
- $this->type("sort_name", "{$lastName}, {$firstName}");
- $this->click("_qf_Advanced_refresh");
+ $this->type("sort_name", "{$lastName}, {$firstName}");
+
+ $this->click("_qf_Advanced_refresh");
+
$this->waitForPageToLoad($this->getTimeoutMsec());
-
+
//return its presence
return $this->isElementPresent("xpath=//div[@class='crm-search-results']/table/tbody/tr/td[3]/a[text()='{$lastName}, {$firstName}']");
}
-
+
function getOptionVal($privacyOption) {
if ($privacyOption == 'do_not_phone') {
$privacyOptionVal = 'Do not phone';
function _addIndividual($firstName, $lastName, $options) {
$this->openCiviPage('contact/add', 'reset=1&ct=Individual');
-
+
//fill in first name
$this->type("first_name", $firstName);
//Select preferred method for Privacy
$this->click("privacy_{$option}");
}
-
+
// Clicking save.
$this->click("_qf_Contact_upload_view");
$this->waitForPageToLoad($this->getTimeoutMsec());
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase {
$this->webtestFillDate("member_end_date_high", "+2 year");
}
-
// function to fill member search details
function addPledgeSearchDetail($firstName) {
// fill pledge schedule date range
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTestCase {
$this->select('relationship_type_id', "label={$relType}");
//fill in the individual
- $this->webtestFillAutocomplete($relatedName);
+ $this->webtestFillAutocomplete($relatedName);
$this->waitForElementPresent("quick-save");
function testAdvanceSearchForLog() {
$this->webtestLogin();
-
-
+
$Pdate = date('F jS, Y h:i:s A', mktime( 0, 0, 0, date( 'm' ), date( 'd' ) - 1, date( 'Y' )) );
$Ndate = date('F jS, Y h:i:s A', mktime( 0, 0, 0, date( 'm' ), date( 'd' ) + 1, date( 'Y' )) );
$url = $this->parseURL( );
$cid = $url['queryString']['cid'];
$this->assertType('numeric', $cid);
-
//advance search for created contacts
$this->openCiviPage('contact/search/advanced', 'reset=1', '_qf_Advanced_refresh');
$this->assertTrue(True, 'greater than or equal to "{$Pdate}" AND less than or equal to "{$Ndate}"');
$value = "$lastNameSoft, $firstNameSoft";
$this->verifyText("xpath= id('rowid{$cid}')/td[3]/a", preg_quote($value));
-
-}
-
+}
}
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_ContactReferenceFieldTest extends CiviSeleniumTestCase {
function testContactReferenceField() {
$this->webtestLogin();
-
/* add new group */
$this->openCiviPage('group/add', 'reset=1', '_qf_Edit_upload');
preg_match('/&id=([0-9]+)/', $this->getLocation(), $matches);
$contactRefFieldID1 = $matches[1];
-
$this->openCiviPage('admin/custom/group/field', "reset=1&action=browse&gid={$customGroupId}");
$this->click("xpath=//div[@id='field_page']//table/tbody/tr[2]/td[8]/span[1]/a[text()='Edit Field']");
$this->assertElementContainsText("css=div.ac_results-inner li", "{$contact1}@example.com");
$this->assertElementNotContainsText("css=div.ac_results-inner ul li", "{$contact2}@example.com");
-
$this->openCiviPage('admin/custom/group', "action=preview&reset=1&id={$customGroupId}");
$this->type("custom_{$contactRefFieldID2}_-1", $org1);
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_ContactTagTest extends CiviSeleniumTestCase {
}
}
-
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
-
//Tests for the ability to add a CMS user from a contact's record
//See http://issues.civicrm.org/jira/browse/CRM-8723
class WebTest_Contact_CreateCmsUserFromContactTest extends CiviSeleniumTestCase {
parent::setUp();
}
-
-
//Test that option to create a cms user is present on a contact who does not
//have a cms account already( in this case, a new contact )
function testCreateContactLinkPresent() {
$this->assertElementContainsText("msgbox", "This username is currently available", "Available username is indicated as being taken");
}
-
//Test form submission when the username is taken
function testTakenUsernameSubmission() {
list($cid, $firstName, $lastName, $email) = $this->_createUserAndGotoForm();
$password = 'abc123';
-
//submit the form with the bad username
$username = $this->settings->adminUsername;
$this->_fillCMSUserForm($username, $password, $password);
list($cid, $firstName, $lastName, $email) = $this->_createUserAndGotoForm();
$password = 'abc123';
-
//submit with mismatch passwords
$username = $this->settings->adminUsername;
$this->_fillCMSUserForm($username, $password, $password . "mismatch");
list($cid, $firstName, $lastName, $email) = $this->_createUserAndGotoForm();
$password = 'abc123';
-
//submit with mismatch passwords
$username = $this->settings->adminUsername;
$this->click("_qf_Useradd_next-bottom");
//the civicrm message should say password is required
$this->assertElementContainsText("css=#crm-notification-container", "Password is required", "The CiviCRM messae does not indicate that the password is required");
-
//check that no user was created;
$results = $this->webtest_civicrm_api("UFMatch", "get", array('contact_id' => $cid));
$this->assertTrue($results['count'] == 0);
list($cid, $firstName, $lastName, $email) = $this->_createUserAndGotoForm();
$password = 'abc123';
-
//submit with matching passwords
$this->_fillCMSUserForm($firstName, $password, $password);
$this->click("_qf_Useradd_next-bottom");
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_CustomDataAddTest extends CiviSeleniumTestCase {
$this->type("option_label_3", $checkboxOptionLabel3);
$this->type("option_value_3", "3");
-
//enter options per line
$this->type("options_per_line", "2");
}
-
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_DeceasedContactsAdvancedSearchTest extends CiviSeleniumTestCase {
$this->assertElementContainsText('search-status', '2 Contacts');
$this->click("toggleSelect");
$this->waitForTextPresent('2 Selected records only');
-
+
$this->select('task', 'label=Remove Contacts from Group');
$this->click("xpath=//div[@id='search-status']/table/tbody/tr[3]/td/ul/input[2]");
$this->waitForElementPresent('_qf_RemoveFromGroup_back-bottom');
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_DupeContactTest extends CiviSeleniumTestCase {
//contact details section
-
//fill in first name
$this->type("first_name", "$firstName");
}
}
-
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_GroupAddTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_InlineFieldsEditTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
// button at the end of this page to show up, to make sure it's fully loaded.
$this->waitForElementPresent("_qf_Activity_upload");
-
// ...and verifying if the page contains properly formatted display name for chosen contact.
$this->assertTrue($this->isTextPresent("Anderson, " . $withContact), "Contact not found in line " . __LINE__);
$this->assertTrue($this->isTextPresent("Activity '$subject' has been saved."), "Status message didn't show up after saving!");
}
-
function testMergeTest() {
$this->webtestLogin();
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_MultipleContactSubTypes extends CiviSeleniumTestCase {
}
}
-
-
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_PrevNextTest extends CiviSeleniumTestCase {
function testPrevNext() {
$this->webtestLogin();
-
/* add new group */
$this->openCiviPage('group/add', 'reset=1', '_qf_Edit_upload');
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_PrivacyOptionSearchTest extends CiviSeleniumTestCase {
$this->type('last_name', $lname1);
$email1 = $fname1 . '@example.org';
$this->type('email_1_email', $email1);
-
+
//click 'Communication Preferences' Panel
$this->click("commPrefs");
$this->waitForElementPresent("preferred_mail_format");
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_ProfileChecksumTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase {
}
}
-
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase {
parent::setUp();
}
-
function testSearchBuilderOptions() {
$this->webtestLogin();
$this->waitForElementPresent("css=#crm_search_value_{$set}_{$row} select option + option");
foreach ($value as $val) {
if ($op != 'IN') {
- $select = 'select';
+ $select = 'select';
+
}
else {
- $select = 'addSelection';
+ $select = 'addSelection';
+
}
$this->$select("css=#crm_search_value_{$set}_{$row} select", "label=$val");
}
// somewhere at the end of page and use waitForElementPresent on it - this assures you, that whole
// page contents loaded and you can continue your test execution.
$this->webtestLogin();
-
+
// add financial type
$financialTypeName1 = 'Financial Type' . substr(sha1(rand()), 0, 5);;
$financialTypeName2 = 'Financial Type' . substr(sha1(rand()), 0, 5);;
$this->clickLink('_qf_Contribution_upload_new', '_qf_Contribution_upload_new');
}
$this->openCiviPage("contact/search/builder", "reset=1", "_qf_Builder_refresh");
-
+
$this->enterValues(1, 1, 'Contribution', 'Financial Type', NULL, '=', array($financialTypeName1));
$this->click('_qf_Builder_refresh');
$this->waitForPageToLoad($this->getTimeoutMsec());
-
+
$this->assertTrue($this->isTextPresent('3 Contacts'), 'Missing text: ' . '3 Contacts');
-
+
$this->click("xpath=//div[@class='crm-accordion-header crm-master-accordion-header']");
$this->enterValues(1, 1, 'Contribution', 'Financial Type', NULL, '=', array($financialTypeName2));
$this->click('_qf_Builder_refresh');
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->assertTrue($this->isTextPresent('3 Contacts'), 'Missing text: ' . '3 Contacts');
-
+
$this->click("xpath=//div[@class='crm-accordion-header crm-master-accordion-header']");
$this->enterValues(1, 1, 'Contribution', 'Financial Type', NULL, 'IN', array($financialTypeName1, $financialTypeName2));
$this->click('_qf_Builder_refresh');
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_SearchTest extends CiviSeleniumTestCase {
$childGroupName = 'Childgroup_' . substr(sha1(rand()), 0, 7);
$this->WebtestAddGroup($childGroupName, $parentGroupName);
-
// Adding Parent group contact
$firstName = substr(sha1(rand()), 0, 7);
$this->webtestAddContact($firstName, "Smith", "$firstName.smith@example.org");
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_SearchbyDateFilterTest extends CiviSeleniumTestCase {
// check the opened panes.
$this->_checkOpenedPanes(array($pane));
}
-
+
}
function testIndividualSearchPage(){
$this->select("contribution_date_relative","value=earlier.quarter");
$this->click("_qf_Search_refresh");
$this->waitForPageToLoad(2 * $this->getTimeoutMsec());
- $this->select("contribution_date_relative","value=ending.year");
+ $this->select("contribution_date_relative","value=ending.year");
+
$this->click("_qf_Search_refresh");
$this->waitForPageToLoad(2 * $this->getTimeoutMsec());
),
),
),
-
+
'contribution' =>
array(
'headerLocator' => 'div#CiviContribute',
'locator' => 'member_join_date_relative',
'values' => array('Previous Year'),
),
-
+
),
),
'event' =>
),
),
),
-
-
+
);
}
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_SignatureTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_TagAddTest extends CiviSeleniumTestCase {
}
}
-
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_TagSetSearchTest extends CiviSeleniumTestCase {
function testTagSetSearch() {
$this->webtestLogin();
-
$tagSet1 = $this->_testAddTagSet();
$tagSet2 = $this->_testAddTagSet();
$this->mouseDownAt("css=li.token-input-dropdown-item2-facebook");
$this->waitForTextPresent($tag2);
-
// Individual 2
$contact2 = substr(sha1(rand()), 0, 7);
$this->webtestAddContact($contact2, "Anderson", "{$contact2}@example.com");
$this->mouseDownAt("css=li.token-input-dropdown-item2-facebook");
$this->waitForTextPresent($tag1);
-
// Go to Advance search.
$this->openCiviPage('contact/search/advanced', 'reset=1');
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_TaskActionAddToGroupTest extends CiviSeleniumTestCase {
}
}
-
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_TaskActionSendMassMailing extends CiviSeleniumTestCase {
}
}
-
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_TaskActionSendSMS extends CiviSeleniumTestCase {
}
}
-
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contact_UpdateProfileTest extends CiviSeleniumTestCase {
}
}
-
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contribute_AddBatchesTest extends CiviSeleniumTestCase {
'first_name' => 'Ma'.substr(sha1(rand()), 0, 7),
'last_name' => 'An'.substr(sha1(rand()), 0, 7),
'financial_type' => 'Donation',
- 'amount' => 100,
+ 'amount' => 100,
+
);
$this->_fillData($data[$i], $i, "Contribution");
- }
+ }
+
$this->click("_qf_Entry_cancel");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->_verifyData($data, "Contribution");
}
-
+
function testBatchAddMembership() {
$this->webtestLogin();
$itemCount = 5;
$this->type("total", 500);
$this->click("_qf_Batch_next");
$this->waitForPageToLoad($this->getTimeoutMsec());
-
+
// Add Contact Details
$data = array();
for ($i=1; $i<=$itemCount; $i++ ) {
'first_name' => 'Ma'.substr(sha1(rand()), 0, 7),
'last_name' => 'An'.substr(sha1(rand()), 0, 7),
'membership_type' => 'Default Organization',
- 'amount' => 100,
+ 'amount' => 100,
+
'financial_type' => 'Member Dues',
);
$this->_fillData($data[$i], $i, "Membership");
}
$this->click("_qf_Entry_cancel");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->waitForPageToLoad($this->getTimeoutMsec());
+
$this->_verifyData($data, "Membership");
}
-
-
function _fillData($data, $row, $type) {
$email = $data['first_name'] . '@example.com';
$this->webtestNewDialogContact($data['first_name'], $data['last_name'], $email, 4, "primary_profiles_{$row}", "primary_{$row}");
-
+
if ($type == "Contribution") {
$this->select("field_{$row}_financial_type", $data['financial_type']);
$this->type("field_{$row}_total_amount", $data['amount']);
$this->click("field[{$row}][send_receipt]");
$this->click("field_{$row}_invoice_id");
$this->type("field_{$row}_invoice_id", substr(sha1(rand()), 0, 10));
-
+
} elseif ($type == "Membership") {
$this->select("field[{$row}][membership_type][0]", $data['membership_type']);
$this->webtestFillDate("field_{$row}_join_date", "now");
$this->webtestFillDate("field_{$row}_membership_end_date", "+1 month");
$this->type("field_{$row}_membership_source", substr(sha1(rand()), 0, 10));
$this->click("field[{$row}][send_receipt]");
- $this->select("field_{$row}_financial_type", $data['financial_type']);
+ $this->select("field_{$row}_financial_type", $data['financial_type']);
+
$this->webtestFillDateTime("field_{$row}_receive_date", "+1 week");
$this->select("field_{$row}_payment_instrument", "Check");
$this->type("field_{$row}_check_number", rand());
'Financial Type' => $data['financial_type'],
'Total Amount' => $data['amount'],
'Contribution Status' => 'Completed',
- );
+ );
+
$this->webtestVerifyTabularData($expected);
}
elseif ($type == "Membership") {
$this->openCiviPage("member/search", "reset=1", "member_join_date_low");
-
+
// select contact
$this->type("sort_name", "{$data['first_name']} {$data['last_name']}");
$this->clickLink("_qf_Search_refresh", "xpath=//div[@id='memberSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
'Financial Type' => $data['financial_type'],
'Total Amount' => $data['amount'],
'Contribution Status' => 'Completed',
- );
+ );
+
$this->webtestVerifyTabularData($expected);
}
}
-
+
function _verifyData($data, $type) {
$this->waitForElementPresent("xpath=//div[@id='crm-batch-selector_wrapper']//table//tbody/tr[1]/td[7]/span/a[text()='Enter records']");
$this->clickLink("xpath=//div[@id='crm-batch-selector_wrapper']//table//tbody/tr[1]/td[7]/span/a[text()='Enter records']", "_qf_Entry_upload");
$this->type('first_name', $fname);
$this->type('last_name', $lname);
break;
-
+
case 5:
$this->type('organization_name', $fname);
break;
-
+
case 6:
$this->type('household_name', $fname);
break;
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase {
protected function setUp() {
parent::setUp();
}
-
+
function testAddPriceSet() {
// Log in using webtestLogin() method
$this->webtestLogin();
//add financial type of account type expense
-
+
$financialType = $this->_testAddFinancialType();
$setTitle = 'Conference Fees - ' . substr(sha1(rand()), 0, 7);
$validateStrings[] = $financialType;
foreach ($fields as $label => $type) {
$validateStrings[] = $label;
-
+
$this->type('label', $label);
$this->select('html_type', "value={$type}");
$this->check('is_required');
}
break;
-
+
case 'Select':
$options = array(
1 => array('label' => 'Chicken',
$this->webtestFillDateTime('expire_on', '-1 week');
}
break;
-
+
case 'Radio':
$options = array(
1 => array('label' => 'Yes',
$this->webtestFillDateTime('active_on', '-1 week');
}
break;
-
+
case 'CheckBox':
$options = array(
1 => array('label' => 'First Night',
$this->webtestFillDateTime('expire_on', '+1 week');
}
break;
-
+
default:
break;
}
$this->clickLink('_qf_Field_next_new-bottom', '_qf_Field_next-bottom');
}
}
-
+
function _testAddFinancialType() {
// Add new Financial Account
$orgName = 'Alberta '.substr(sha1(rand()), 0, 7);
$isTax = TRUE;
$taxRate = 9;
$isDefault = FALSE;
-
+
//Add new organisation
if($orgName) {
$this->webtestAddOrganization($orgName);
}
-
+
$this->_testAddFinancialAccount($financialAccountTitle,
$financialAccountDescription,
$accountingCode,
$isDefault
);
$this->waitForElementPresent("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']");
-
+
//Add new Financial Type
$financialType['name'] = 'FinancialType '.substr(sha1(rand()), 0, 4);
$financialType['is_deductible'] = TRUE;
$this->addeditFinancialType($financialType);
$accountRelationship = "Income Account is";
- $expected[] = array('financial_account' => $financialAccountTitle,
+ $expected[] = array('financial_account' => $financialAccountTitle,
+
'account_relationship' => $accountRelationship
);
$this->assertTrue($this->isTextPresent($text), 'Missing text: ' . $text);
return $financialType['name'];
}
-
+
function _testVerifyPriceSet($validateStrings, $sid) {
// verify Price Set at Preview page
// start at Manage Price Sets listing
//add financial type of account type expense
$financialType = $this->_testAddFinancialType();
-
+
$setTitle = 'Conference Fees - ' . substr(sha1(rand()), 0, 7);
$usedFor = 'Contribution';
$setHelp = 'Select your conference options.';
$this->_testAddSet($setTitle, $usedFor, $setHelp, $financialType);
-
+
// Get the price set id ($sid) by retrieving and parsing the URL of the New Price Field form
// which is where we are after adding Price Set.
$elements = $this->parseURL();
$this->_testVerifyPriceSet($validateStrings, $sid);
$this->openCiviPage("contribute/add", "reset=1&action=add&context=standalone", '_qf_Contribution_upload');
-
// create new contact using dialog
$firstName = substr(sha1(rand()), 0, 7);
$this->webtestNewDialogContact($firstName, 'Contributor', $firstName . '@example.com');
'Pre-conference Meetup?' => 'Radio',
'Evening Sessions' => 'CheckBox',
);
-
+
$this->_testAddPriceFields($fields, $validateStrings, $financialType);
-
+
// load the Price Set Preview and check for expected values
$this->_testVerifyPriceSet($validateStrings, $sid);
//add financial type of account type expense
$financialType= $this->_testAddFinancialType();
-
+
$setTitle = 'Conference Fees - ' . substr(sha1(rand()), 0, 7);
$usedFor = 'Contribution';
$setHelp = 'Select your conference options.';
function testContributeOfflineforSoftcreditwithApi() {
// Log in using webtestLogin() method
$this->webtestLogin();
-
+
//create a contact and return the contact id
$firstNameSoft = "John_".substr(sha1(rand()), 0, 5);
$lastNameSoft = "Doe_".substr(sha1(rand()), 0, 5);
$url = $this->parseURL();
$cid = $url['queryString']['cid'];
$this->assertType('numeric', $cid);
-
+
$setTitle = 'Conference Fees - ' . substr(sha1(rand()), 0, 7);
$usedFor = 'Contribution';
$setHelp = 'Select your conference options.';
$this->openCiviPage("contribute/add", "reset=1&action=add&context=standalone", '_qf_Contribution_upload');
-
// create new contact using dialog
$firstName = substr(sha1(rand()), 0, 7);
$this->webtestNewDialogContact($firstName, 'Contributor', $firstName . '@example.com');
$this->type('check_number', '1041');
$this->type('trxn_id', 'P20901X1' . rand(100, 10000));
-
+
$this->type('soft_credit_to', "$lastNameSoft, $firstNameSoft");
$this->click('soft_credit_to');
$this->waitForElementPresent("css=div.ac_results-inner li");
'Soft Credit To' => "$firstNameSoft $lastNameSoft",
);
$this->webtestVerifyTabularData($expected);
-
+
$exp = array(
2 => '$ 525.00',
3 => '$ 50.00',
$this->typeKeys("css=input#sort_name_navigation", "$lastNameSoft, $firstNameSoft");
// wait for result list
$this->waitForElementPresent("css=div.ac_results-inner li");
-
+
// visit contact summary page
$this->click("css=div.ac_results-inner li");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->click( 'css=li#tab_contribute a' );
$this->waitForElementPresent('link=Record Contribution (Check, Cash, EFT ...)');
-
+
$id = explode('id=', $this->getAttribute("xpath=id('rowid')/td[7]/a[text()='View']@href"));
$id = substr($id[1], 0, strpos($id[1], '&'));
$this->click("xpath=id('rowid')/td[7]/a");
$this->waitForElementPresent('_qf_ContributionView_cancel-bottom');
-
+
$this->webtestVerifyTabularData($expected);
-
+
$params = array('contribution_id' => $id,
'version' => 3,
);
-
+
// Retrieve contribution from the DB via api and verify DB values against view contribution page
require_once 'api/api.php';
$fields = $this->webtest_civicrm_api('contribution','get',$params );
-
+
$params['id'] = $params['contact_id'] = $fields['values'][$fields['id']]['soft_credit_to'];
$softCreditContact = CRM_Contact_BAO_Contact::retrieve($params, $defaults, TRUE);
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contribute_ConfirmOptionalTest extends CiviSeleniumTestCase {
protected $pageId = 0;
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contribute_ContactContextAddTest extends CiviSeleniumTestCase {
parent::setUp();
}
- function testContactContextAdd() {
+ function testContactContextAdd() {
+
// Log in using webtestLogin() method
$this->webtestLogin();
-
+
// Create a contact to be used as soft creditor
$softCreditFname = substr(sha1(rand()), 0, 7);
$softCreditLname = substr(sha1(rand()), 0, 7);
$this->webtestAddContact($softCreditFname, $softCreditLname, FALSE);
-
+
// Adding contact with randomized first name (so we can then select that contact when creating contribution.)
// We're using Quick Add block on the main page for this.
$firstName = substr(sha1(rand()), 0, 7);
$isTax = TRUE;
$taxRate = 9.99999999;
$isDefault = FALSE;
-
+
//Add new organisation
if($orgName) {
$this->webtestAddOrganization($orgName);
);
$this->webtestAddContact( $firstName, "Anderson", true );
-
+
// Get the contact id of the new contact
$contactUrl = $this->parseURL();
$cid = $contactUrl['queryString']['cid'];
$this->assertType('numeric', $cid);
-
+
// go to contribution tab and add contribution.
$this->click("css=li#tab_contribute a");
-
+
// wait for Record Contribution elenment.
$this->waitForElementPresent("link=Record Contribution (Check, Cash, EFT ...)");
$this->click("link=Record Contribution (Check, Cash, EFT ...)");
-
+
$this->waitForElementPresent("_qf_Contribution_cancel-bottom");
// fill financial type.
$this->select("financial_type_id", "Donation");
-
+
// fill in Received Date
$this->webtestFillDate('receive_date');
-
+
// source
$this->type("source", "Mailer 1");
-
+
// total amount
$this->type("total_amount", "100");
-
+
// select payment instrument type = Check and enter chk number
$this->select("payment_instrument_id", "value=4");
$this->waitForElementPresent("check_number");
$this->type("check_number", "check #1041");
-
+
$this->type("trxn_id", "P20901X1" . rand(100, 10000));
-
+
// soft credit
$this->click("soft_credit_to");
$this->type("soft_credit_to", $softCreditFname);
//Additional Detail section
$this->click("AdditionalDetail");
$this->waitForElementPresent("thankyou_date");
-
+
$this->type("note", "Test note for {$firstName}.");
$this->type("fee_amount", "0");
$this->type("net_amount", "0");
$this->clickLink("_qf_Contribution_upload-bottom", 'civicrm-footer');
// Is status message correct?
$this->assertElementContainsText('crm-notification-container', "The contribution record has been saved");
-
+
$this->waitForElementPresent("xpath=//div[@id='Contributions']//table/tbody/tr/td[8]/span/a[text()='View']");
-
+
// click through to the Contribution view screen
$this->click("xpath=//div[@id='Contributions']//table/tbody/tr/td[8]/span/a[text()='View']");
$this->waitForElementPresent('_qf_ContributionView_cancel-bottom');
$viewUrl = $this->parseURL();
$id = $viewUrl['queryString']['id'];
$this->assertType('numeric', $id);
-
+
$searchParams = array('id' => $id);
$compareParams = array(
'contact_id' => $cid,
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase {
function testContributionPageAdd() {
$this->webtestVerifyTabularData($expected);
$this->click('_qf_ContributionView_cancel-bottom');
-
//Find Member
$this->openCiviPage("member/search", "reset=1", 'member_source');
$this->type('sort_name', "$firstName $lastName");
require_once 'CiviTest/CiviSeleniumTestCase.php';
-
-
class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase {
protected $captureScreenshotOnFailure = TRUE;
protected $screenshotPath = '/var/www/api.dev.civicrm.org/public/sc';
protected $screenshotUrl = 'http://api.dev.civicrm.org/sc/';
-
+
protected function setUp() {
parent::setUp();
}
-
+
function testStandaloneContributeAdd() {
$this->webtestLogin();
$softCreditFname = substr(sha1(rand()), 0, 7);
$softCreditLname = substr(sha1(rand()), 0, 7);
$this->webtestAddContact( $softCreditFname, $softCreditLname, false );
-
+
//financial account for check
$this->openCiviPage("admin/options/payment_instrument", "group=payment_instrument&reset=1");
$financialAccount = $this->getText("xpath=//div[@id='payment_instrument']/div[2]/table/tbody//tr/td[1][text()='Check']/../td[3]");
-
+
// Add new Financial Account
$orgName = 'Alberta '.substr(sha1(rand()), 0, 7);
$financialAccountTitle = 'Financial Account '.substr(sha1(rand()), 0, 4);
$isTax = TRUE;
$taxRate = 9;
$isDefault = FALSE;
-
+
//Add new organisation
if($orgName) {
$this->webtestAddOrganization($orgName);
}
-
+
$this->_testAddFinancialAccount($financialAccountTitle,
$financialAccountDescription,
$accountingCode,
$firstName = 'John'.substr(sha1(rand()), 0, 7);
$lastName = 'Dsouza'.substr(sha1(rand()), 0, 7);
$this->webtestAddContact($firstName, $lastName);
-
+
$this->waitForElementPresent("css=li#tab_contribute a");
$this->click("css=li#tab_contribute a");
$this->waitForElementPresent("link=Record Contribution (Check, Cash, EFT ...)");
// select financial type
$this->select("financial_type_id", "value=1");
-
+
// fill in Received Date
$this->webtestFillDate('receive_date');
-
+
// source
$this->type("source", "Mailer 1");
-
+
// total amount
$this->type("total_amount", "100");
$this->type("check_number", "check #1041");
$this->type("trxn_id", "P20901X1" . rand(100, 10000));
-
+
// soft credit
$this->click("soft_credit_to");
$this->type("soft_credit_to", $softCreditFname);
- $this->typeKeys("soft_credit_to", $softCreditFname);
+ $this->typeKeys("soft_credit_to", $softCreditFname);
+
$this->waitForElementPresent("css=div.ac_results-inner li");
$this->click("css=div.ac_results-inner li");
$this->type("net_amount", "0");
$this->type("invoice_id", time());
$this->webtestFillDate('thankyou_date');
-
+
//Honoree section
$this->click("Honoree");
$this->waitForElementPresent("honor_email");
// Is status message correct?
$this->assertTrue($this->isTextPresent("The contribution record has been saved."), "Status message didn't show up after saving!");
-
+
// verify if Membership is created
$this->waitForElementPresent( "xpath=//div[@id='Contributions']//table//tbody/tr[1]/td[8]/span/a[text()='View']" );
-
+
//click through to the Membership view screen
$this->click( "xpath=//div[@id='Contributions']//table/tbody/tr[1]/td[8]/span/a[text()='View']" );
$this->waitForElementPresent("_qf_ContributionView_cancel-bottom");
-
- $expected = array('Financial Type' => 'Donation',
+
+ $expected = array('Financial Type' => 'Donation',
+
'Total Amount' => '100.00',
'Contribution Status' => 'Completed',
'Paid By' => 'Check',
$this->waitForElementPresent("link=Record Contribution (Check, Cash, EFT ...)");
// verify soft credit details
- $expected = array( 3 => 'Donation',
+ $expected = array( 3 => 'Donation',
+
2 => '100.00',
5 => 'Completed',
1 => "{$firstName} {$lastName}"
$this->verifyText("xpath=id('Search')/div[2]/table[2]/tbody/tr[2]/td[$value]", preg_quote($label));
}
}
-
+
function testDeductibleAmount() {
$this->webtestLogin();
//add authorize .net payment processor
$processorName = 'Webtest AuthNet' . substr(sha1(rand()), 0, 7);
$this->webtestAddPaymentProcessor($processorName, 'AuthNet');
-
+
$this->openCiviPage("admin/contribute/managePremiums", "action=add&reset=1");
$premiumName = 'test Premium' . substr(sha1(rand()), 0, 7);
$this->addPremium($premiumName, 'SKU', 3, 12, NULL, NULL);
-
+
$firstName = 'John'.substr(sha1(rand()), 0, 7);
$lastName = 'Dsouza'.substr(sha1(rand()), 0, 7);
$this->webtestAddContact($firstName, $lastName);
'non_deductible_amount' => 15
);
$this->_doOfflineContribution($scenario1, $firstName, $lastName, $processorName);
-
+
$checkScenario1 = array(
'From' => "{$firstName} {$lastName}",
'Financial Type' => 'Campaign Contribution',
'Non-deductible Amount' => 15
);
$this->_verifyAmounts($checkScenario1);
-
+
//scenario 2 : is_deductible = TRUE and premium is set and premium is greater than total amount
$scenario2 = array(
'financial_type' => 'Donation',
'premium' => "{$premiumName} ( SKU )"
);
$this->_doOfflineContribution($scenario2, $firstName, $lastName, $processorName);
-
+
$checkScenario2 = array(
'From' => "{$firstName} {$lastName}",
'Financial Type' => 'Donation',
'Non-deductible Amount' => 10
);
$this->_verifyAmounts($checkScenario2);
-
+
//scenario 3 : is_deductible = TRUE and premium is set and premium is less than total amount
$scenario3 = array(
'financial_type' => 'Donation',
'premium' => "{$premiumName} ( SKU )"
);
$this->_doOfflineContribution($scenario3, $firstName, $lastName, $processorName);
-
+
$checkScenario3 = array(
'From' => "{$firstName} {$lastName}",
'Financial Type' => 'Donation',
'Non-deductible Amount' => 12
);
$this->_verifyAmounts($checkScenario3);
-
+
//scenario 4 : is_deductible = TRUE and premium is not set
$scenario4 = array(
'financial_type' => 'Donation',
'total_amount' => 123,
);
$this->_doOfflineContribution($scenario4, $firstName, $lastName, $processorName);
-
+
$checkScenario4 = array(
'From' => "{$firstName} {$lastName}",
'Financial Type' => 'Donation',
'total_amount' => 555,
);
$this->_doOfflineContribution($scenario5, $firstName, $lastName, $processorName);
-
+
$checkScenario5 = array(
'From' => "{$firstName} {$lastName}",
'Financial Type' => 'Campaign Contribution',
);
$this->_verifyAmounts($checkScenario5);
}
-
+
//common function for doing offline contribution
function _doOfflineContribution($params, $firstName, $lastName, $processorName) {
-
+
$this->waitForElementPresent("css=li#tab_contribute a");
$this->click("css=li#tab_contribute a");
$this->waitForElementPresent("link=Submit Credit Card Contribution");
// billing address
$this->webtestAddBillingDetails($firstName, NULL, $lastName);
-
+
if ($nonDeductibleAmt = CRM_Utils_Array::value('non_deductible_amount', $params)) {
$this->click("AdditionalDetail");
$this->waitForElementPresent("thankyou_date");
// Is status message correct?
$this->assertTrue($this->isTextPresent("The contribution record has been processed."), "Status message didn't show up after saving!");
}
-
+
//common function for verifing total_amount, and non_deductible_amount
function _verifyAmounts($verifyData) {
$this->waitForElementPresent( "xpath=//div[@id='Contributions']//table//tbody/tr[1]/td[8]/span/a[text()='View']" );
$this->click( "xpath=//div[@id='Contributions']//table/tbody/tr[1]/td[8]/span/a[text()='View']" );
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->waitForPageToLoad($this->getTimeoutMsec());
foreach ($verifyData as $label => $value) {
$this->verifyText("xpath=//form[@id='ContributionView']//table/tbody/tr/td[text()='{$label}']/following-sibling::td",
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contribute_OfflineRecurContributionTest extends CiviSeleniumTestCase {
'Contribution Status' => 'Pending : Incomplete Transaction',
'Paid By' => 'Credit Card',
);
-
+
foreach ($verifyData as $label => $value) {
$this->verifyText("xpath=//form[@id='ContributionView']//table/tbody/tr/td[text()='{$label}']/following-sibling::td",
preg_quote($value)
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase {
protected $pageno = '';
$this->waitForElementPresent('_qf_Membership_cancel-bottom');
$this->click('_qf_Membership_upload-bottom');
-
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->click("css=li#tab_rel a");
// Is status message correct?
$this->assertTextPresent("Thank you. Your information has been saved.", "Save successful status message didn't show up after saving profile to update testUserName!");
-
//add org fields to profile
$this->openCiviPage("admin/uf/group", "reset=1");
$this->click("link=Reserved Profiles");
$this->click('_qf_Field_next-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
-
//create organisation
$orgName = "Org WebAccess ". substr(sha1(rand()), 0, 7);
$orgEmail = "org". substr(sha1(rand()), 0, 7) . "@web.com";
$this->_testOrganization($pageId, $cid, $pageTitle);
}
-
function _testOrganization($pageId, $cid, $pageTitle) {
//Open Live Contribution Page
$this->openCiviPage("contribute/transact", "reset=1&id=$pageId", "_qf_Main_upload-bottom");
$this->click("onbehalf_state_province-3");
$this->select("onbehalf_state_province-3", "label=Alabama");
-
// Credit Card Info
$this->select("credit_card_type", "value=Visa");
$this->type("credit_card_number", "4111111111111111");
$this->verifyText("xpath=id( 'ContributionView' )/div[2]/table[1]/tbody/tr[$value]/td[2]", preg_quote($label));
}
-
$this->openCiviPage("admin/uf/group", "reset=1");
$this->click("link=Reserved Profiles");
$this->click("_qf_Contact_upload_view-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
-
// create Membership type
$title1 = "Membership Type" . substr(sha1(rand()), 0, 7);
$this->openCiviPage("admin/member/membershipType", "reset=1&action=browse");
);
}
-
function testOnBehalfOfOrganizationWithImage() {
$this->webtestLogin();
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contribute_OnlineContributionTest extends CiviSeleniumTestCase {
$honorLastName = 'Hon' . substr(sha1(rand()), 0, 7);
$honorEmail = $honorFirstName . "@example.com";
$honorSortName = $honorLastName . ', ' . $honorFirstName;
- $honorDisplayName = 'Ms. ' . $honorFirstName . ' ' . $honorLastName;
+ $honorDisplayName = 'Ms. ' . $honorFirstName . ' ' . $honorLastName;
$this->type("email-5", $firstName . "@example.com");
$this->type("honor_first_name", $honorFirstName);
$this->type("honor_last_name", $honorLastName);
$this->type("honor_email", $honorEmail);
-
+
//Credit Card Info
$this->select("credit_card_type", "value=Visa");
$this->type("credit_card_number", "4111111111111111");
// Is contact present?
$this->assertTrue($this->isTextPresent("$honorDisplayName"), "Honoree contact not found.");
-
+
}
}
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contribute_OnlineMultiplePaymentProcessorTest extends CiviSeleniumTestCase {
protected function setUp() {
$this->click("_qf_Confirm_next-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
-
+
//login to check contribution
-
+
}
function testOnlineMultiplePaymentProcessorWithPayLater() {
// Log in using webtestLogin() method
$this->webtestLogin();
-
$proProcessorName = "Pro " . substr(sha1(rand()), 0, 7);
$standardProcessorName = "Standard " . substr(sha1(rand()), 0, 7);
$donationPageTitle = "Donation" . substr(sha1(rand()), 0, 7);
$firstName = 'Ma' . substr(sha1(rand()), 0, 4);
$lastName = 'An' . substr(sha1(rand()), 0, 7);
-
+
$this->type("email-5", $firstName . "@example.com");
$this->type("first_name", $firstName);
$this->click($xpath);
$this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
-
+
$payLaterInstructionsText = "Pay later instructions $hash";
$this->assertTrue($this->isTextPresent($payLaterInstructionsText));
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contribute_OnlineRecurContributionTest extends CiviSeleniumTestCase {
$this->type("email-Primary", $email);
if ($this->isElementPresent("cms_pass")) {
$pass = 'myBigPassword';
- $this->type("cms_pass", $pass);
- $this->type("cms_confirm_pass", $pass);
+ $this->type("cms_pass", $pass);
+
+ $this->type("cms_confirm_pass", $pass);
+
}
$this->click("_qf_PCPAccount_next-bottom");
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contribute_StandaloneAddTest extends CiviSeleniumTestCase {
$isTax = TRUE;
$taxRate = 9.9999999;
$isDefault = FALSE;
-
+
//Add new organisation
if($orgName) {
$this->webtestAddOrganization($orgName);
}
-
+
$this->_testAddFinancialAccount($financialAccountTitle,
$financialAccountDescription,
$accountingCode,
$this->openCiviPage("contribute/add", "reset=1&context=standalone", "_qf_Contribution_upload");
-
// create new contact using dialog
$firstName = substr(sha1(rand()), 0, 7);
$this->webtestNewDialogContact($firstName, "Contributor", $firstName . "@example.com");
-
+
// select financial type
$this->select("financial_type_id", "value=1");
-
+
// fill in Received Date
$this->webtestFillDate('receive_date');
$this->select("payment_instrument_id", "value=4");
$this->waitForElementPresent("check_number");
$this->type("check_number", "check #1041");
-
+
$this->type("trxn_id", "P20901X1" . rand(100, 10000));
// soft credit
// go to soft creditor contact view page
$this->click("xpath=id('ContributionView')/div[2]/table[1]/tbody//tr/td[1][text()='Soft Credit To']/../td[2]/a[text()='{$softCreditFname} {$softCreditLname}']");
-
+
// go to contribution tab
$this->waitForElementPresent("css=li#tab_contribute a");
$this->click("css=li#tab_contribute a");
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contribute_UpdateBatchPendingContributionTest extends CiviSeleniumTestCase {
$expected = array(
'Received Into' => "Deposit Bank Account",
'Contribution Status' => "Completed",
- );
+ );
+
$this->webtestVerifyTabularData($expected);
}
$expected = array(
'Received Into' => "Deposit Bank Account",
'Contribution Status' => "Completed",
- );
+ );
+
$this->webtestVerifyTabularData($expected);
}
// Select role
$this->click('role_id[2]');
-
// Select participant status
$this->select('status_id', 'value=1');
$this->openCiviPage("contribute/add", "reset=1&context=standalone", "_qf_Contribution_upload");
-
// create new contact using dialog
$this->webtestNewDialogContact($firstName, "Contributor", $email);
//For LineItem\r
$lineItemSearchParams = array('entity_id' => $contriIDOff);\r
$lineItemCompareParams = array('line_total' => '90.00');\r
- \r
+
+\r
$this->assertDBCompareValues('CRM_Contribute_DAO_Contribution', $searchParams, $compareParams);\r
$this->assertDBCompareValues('CRM_Price_DAO_LineItem', $lineItemSearchParams, $lineItemCompareParams);\r
- \r
+
+\r
$total = $this->_getTotalContributedAmount($contriIDOff);\r
$compare = array('total_amount' => $total);\r
$this->assertDBCompareValues('CRM_Contribute_DAO_Contribution', $searchParams, $compare);\r
\r
- \r
+
+\r
$amount = $this->_getFinancialItemAmount($contriIDOff);\r
$compare = array('total_amount' => $amount);\r
$this->assertDBCompareValues('CRM_Contribute_DAO_Contribution', $searchParams, $compare);\r
$this->assertDBCompareValues("CRM_Financial_DAO_FinancialItem", $search, $compare);\r
\r
$status = $this->_getPremiumActualCost($contId, 'Accounts Receivable', 'Payment Processor Account', NULL, "'civicrm_contribution'", "ft.status_id as status");\r
- $this->assertEquals($status, '1', "Verify Completed Status"); \r
+ $this->assertEquals($status, '1', "Verify Completed Status");
+\r
}\r
\r
function testChangePremium() {\r
\r
// select payment instrument type\r
$this->select("payment_instrument_id", "label=Credit Card");\r
- \r
+
+\r
$this->type("trxn_id", "P20901X1" . rand(100, 10000));\r
- \r
+
+\r
//Custom Data\r
//$this->click('CIVICRM_QFID_3_6');\r
\r
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contribute_UpdatePendingContributionTest extends CiviSeleniumTestCase {
$this->openCiviPage("contribute/add", "reset=1&context=standalone", "_qf_Contribution_upload");
-
// create new contact using dialog
$this->webtestNewDialogContact($firstName, "Contributor", $email);
$this->type("first_name", $firstName);
$this->type("last_name", $lastName);
-
+
$this->click("xpath=//div[@class='crm-section other_amount-section']//div[2]/input");
$this->type("xpath=//div[@class='crm-section other_amount-section']//div[2]/input", 100);
$this->click("xpath=//div[@class='crm-section payment_processor-section']/div[2]//label[text()='Pay later label {$hash}']");
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Contribute_VerifySSLContributionTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Event_AddEventTest extends CiviSeleniumTestCase {
$multipleRegistrations = TRUE;
$this->_testAddOnlineRegistration($registerIntro, $multipleRegistrations);
- $discountFees = array("225.00", "300.00");
+ $discountFees = array("225.00", "300.00");
+
$eventInfoStrings = array($eventTitle, $eventDescription, $streetAddress);
$this->_testVerifyEventInfo($eventTitle, $eventInfoStrings, $discountFees);
$multipleRegistrations = TRUE;
$this->_testAddOnlineRegistration($registerIntro, $multipleRegistrations);
- $discountFees = array("225.00", "300.00");
+ $discountFees = array("225.00", "300.00");
+
$eventInfoStrings = array($eventTitle, $eventDescription, $streetAddress);
$id = $this->_testVerifyEventInfo($eventTitle, $eventInfoStrings, $discountFees);
// Sleep should never be used for wait for anything to load from the server
// Justification for this instance: FIXME
sleep(3);
-
+
//Assert quick config change and discount deletion
$this->openCiviPage("admin/price", "reset=1");
$this->assertStringsPresent($discount);
$multipleRegistrations = TRUE;
$this->_testAddOnlineRegistration($registerIntro, $multipleRegistrations);
- $discountFees = array("225.00", "300.00");
+ $discountFees = array("225.00", "300.00");
+
$eventInfoStrings = array($eventTitle, $eventDescription, $streetAddress);
$id = $this->_testVerifyEventInfo($eventTitle, $eventInfoStrings, $discountFees);
$this->webtestLogin();
$this->openCiviPage("event/add", "reset=1&action=add");
-
+
$eventTitle = 'My Free Meeting - ' . substr(sha1(rand()), 0, 7);
$eventDescription = "Here is a description for this free meeting.";
// Select "Free Meeting with Online Registration" template (id = 5).
$templateID = 5;
- $eventTypeID = 4;
+ $eventTypeID = 4;
+
$this->_testAddEventInfoFromTemplate($eventTitle, $eventDescription, $templateID, $eventTypeID);
-
- $streetAddress = "100 Main Street";
- $this->_testAddLocation($streetAddress);
+
+ $streetAddress = "100 Main Street";
+
+ $this->_testAddLocation($streetAddress);
// Go to Fees tab and check that Paid Event is false (No)
$this->click("link=Fees");
$this->waitForElementPresent("_qf_EventInfo_upload-bottom");
// Select event template. Use option value, not label - since labels can be translated and test would fail
- $this->select("template_id", "value={$templateID}");
+ $this->select("template_id", "value={$templateID}");
// Wait for event type to be filled in (since page reloads)
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->verifySelectedValue("event_type_id", $eventTypeID);
+ $this->verifySelectedValue("event_type_id", $eventTypeID);
// Attendee role s/b selected now.
$this->verifySelectedValue("default_role_id", "1");
-
+
// Enter Event Title, Summary and Description
- $this->type("title", $eventTitle);
+ $this->type("title", $eventTitle);
+
$this->type("summary", "This is a great conference. Sign up now!");
// Type description in ckEditor (fieldname, text to type, editor)
$this->type("max_participants", "50");
$this->click("is_map");
- $this->click("_qf_EventInfo_upload-bottom");
+ $this->click("_qf_EventInfo_upload-bottom");
+
}
function _testAddLocation($streetAddress) {
$this->type("discount_name_1", $discount1);
$this->webtestFillDate("discount_start_date_1", "-3 week");
$this->webtestFillDate("discount_end_date_1", "-2 week");
- $this->clickLink("_qf_Fee_submit", "discounted_value_1_1");
+ $this->clickLink("_qf_Fee_submit", "discounted_value_1_1");
+
$this->type("discounted_value_1_1","225.00");
$this->type("discounted_value_2_1","300.00");
$this->click("xpath=//fieldset[@id='discount']/fieldset/table/tbody/tr[2]/td[3]/input");
}
$this->click("_qf_Fee_upload-bottom");
-
+
// Wait for "saved" status msg
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->assertElementContainsText("crm-notification-container", "'Fee' information has been saved");
}
$this->fillRichTextField("intro_text", $registerIntro);
-
+
// enable confirmation email
$this->click("CIVICRM_QFID_1_is_email_confirm");
- $this->type("confirm_from_name", "Jane Doe");
+ $this->type("confirm_from_name", "Jane Doe");
+
$this->type("confirm_from_email", "jane.doe@example.org");
$this->click("_qf_Registration_upload-bottom");
// Check for correct event info strings
$this->assertStringsPresent($eventInfoStrings);
-
+
// Optionally verify event fees (especially for discounts)
if ($eventFees) {
- $this->assertStringsPresent($eventFees);
+ $this->assertStringsPresent($eventFees);
+
}
$elements = $this->parseURL();
return $elements['queryString']['id'];
$this->select("additional_participants", "value=" . $numberRegistrations);
$this->type("email-Primary", "smith" . substr(sha1(rand()), 0, 7) . "@example.org");
-
+
$this->select("credit_card_type", "value=Visa");
$this->type("credit_card_number", "4111111111111111");
$this->type("cvv2", "000");
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase {
$this->click("xpath=//div[@id='Events']//table//tbody/tr[1]/td[8]/span/a[text()='View']");
$this->waitForElementPresent('_qf_ParticipantView_cancel-bottom');
-
$this->webtestVerifyTabularData(
array(
'Event' => 'Rain-forest Cup Youth Soccer Tournament',
$this->type('option_label_3', $checkboxOptionLabel3);
$this->type('option_value_3', '3');
-
//enter options per line
$this->type('options_per_line', '2');
);
}
- function testEventAddMultipleParticipants() {
+ function testEventAddMultipleParticipants() {
+
// Log in using webtestLogin() method
$this->webtestLogin();
-
+
$processorId = $this->webtestAddPaymentProcessor('dummy' . substr(sha1(rand()), 0, 7));
$rand = substr(sha1(rand()), 0, 7);
$firstName = 'First' . $rand;
$lastName2 = 'Last' . $rand;
$this->openCiviPage("participant/add", "reset=1&action=add&context=standalone&mode=test&eid=3");
-
+
$this->assertTrue($this->isTextPresent("Register New Participant"), "Page title 'Register New Participant' missing");
$this->assertTrue($this->isTextPresent("A TEST transaction will be submitted"), "test mode status 'A TEST transaction will be submitted' missing");
$this->_fillParticipantDetails($firstName, $lastName, $processorId);
$this->click('_qf_Participant_upload_new-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
-
+
$this->assertTrue($this->isTextPresent("Register New Participant"), "Page title 'Register New Participant' missing");
$this->assertTrue($this->isTextPresent("A TEST transaction will be submitted"), "test mode status 'A TEST transaction will be submitted' missing");
$this->_fillParticipantDetails($firstName, $lastName2, $processorId);
$this->click('_qf_Participant_upload_new-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
-
+
//searching the paricipants
$this->openCiviPage("event/search", "reset=1");
$this->type('sort_name', $firstName);
$this->check('participant_test');
$this->click("_qf_Search_refresh");
$this->waitForElementPresent("participantSearch");
-
+
//verifying the registered participants
$names = array( "{$lastName}, {$firstName}", "{$lastName2}, {$firstName}" );
$status = "Registered (test)";
-
+
foreach($names as $name) {
$this->verifyText("xpath=//div[@id='participantSearch']//table//tbody//tr/td[@class='crm-participant-sort_name']/a[text()='{$name}']/../../td[9]", preg_quote($status));
$this->verifyText("xpath=//div[@id='participantSearch']//table//tbody//tr/td[@class='crm-participant-sort_name']/a[text()='{$name}']/../../td[4]/a", preg_quote($eventName));
function _fillParticipantDetails($firstName, $lastName, $processorId) {
$this->select("id=profiles_1", "label=New Individual");
$this->waitForElementPresent('_qf_Edit_next');
-
+
$this->type("id=first_name", $firstName);
$this->type("id=last_name", $lastName);
$this->click("id=_qf_Edit_next");
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase {
$this->check('extends[2]');
}
- $this->select("css=select.form-select", "label={$financialType}");
+ $this->select("css=select.form-select", "label={$financialType}");
+
$this->type('help_pre', $setHelp);
$this->assertChecked('is_active', 'Verify that Is Active checkbox is set.');
$options = array(
1 => array('label' => 'Yes',
'amount' => '50.00',
- 'financial_type_id' => 'Donation'
+ 'financial_type_id' => 'Donation'
+
),
2 => array(
'label' => 'No',
}
/**
- * Function to test to regiter participant for event with
+ * Function to test to regiter participant for event with
+
* multiple price fields in price-set
- * CRM-11986
+ * CRM-11986
+
*
*/
function testEventWithPriceSet() {
-
+
// Log in using webtestLogin() method
$this->webtestLogin();
-
+
// Adding contact with randomized first name (so we can then select that contact when creating event registration)
// We're using Quick Add block on the main page for this.
$firstName = substr(sha1(rand()), 0, 7);
$this->webtestAddContact($firstName, 'Anderson', TRUE);
$contactName = "Anderson, $firstName";
$displayName = "$firstName Anderson";
-
+
$setTitle = 'Conference Fees - ' . substr(sha1(rand()), 0, 7);
$usedFor = 'Event';
$setHelp = 'Select your conference options.';
'Evening Sessions' => 'CheckBox',
);
$this->_testAddPriceFields($fields, $validateStrings);
-
+
// load the Price Set Preview and check for expected values
$this->_testVerifyPriceSet($validateStrings, $sid);
$eventDescription = 'Here is a description for this conference.';
$this->select('event_type_id', 'value=1');
-
+
// Attendee role s/b selected now.
$this->select('default_role_id', 'value=1');
-
+
// Enter Event Title, Summary and Description
$this->type('title', $eventTitle);
$this->type('summary', 'This is a great conference. Sign up now!');
-
+
// Type description in ckEditor (fieldname, text to type, editor)
$this->fillRichTextField('description', $eventDescription);
-
+
// Choose Start and End dates.
// Using helper webtestFillDate function.
$this->webtestFillDateTime("start_date", "+1 week");
$this->click('CIVICRM_QFID_1_is_monetary');
$this->select('financial_type_id','label=Event Fee');
$this->select('price_set_id', 'label=' . $setTitle);
-
+
$this->click('_qf_Fee_upload-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->select('event_id', "label=regexp:$eventTitle");
// Select role
$this->click('role_id[2]');
-
+
// Choose Registration Date.
// Using helper webtestFillDate function.
$this->webtestFillDate('register_date', 'now');
$today = date('F jS, Y', strtotime('now'));
// May 5th, 2010
-
+
// Select participant status
$this->select('status_id', 'value=1');
// Setting registration source
$this->type('source', 'Event StandaloneAddTest Webtest');
-
+
// Select an event fee
$this->waitForElementPresent('priceset');
$this->type("//div[@id='priceset']//div[@class='crm-section Full_Conference-section']/div[2]/input", '5');
$this->click("xpath=//div[@id='priceset']//div[@class='crm-section Pre_conference_Meetup_-section']/div[2]/div[1]/span/input");
$this->click("xpath=//div[@id='priceset']//div[@class='crm-section Evening_Sessions-section']/div[2]/div[1]/span/input");
$this->click("xpath=//div[@id='priceset']//div[@class='crm-section Evening_Sessions-section']/div[2]/div[2]/span/input");
-
+
// Select payment method = Check and enter chk number
$this->select('payment_instrument_id', 'value=4');
$this->waitForElementPresent('check_number');
- $this->type('check_number', '1044');
-
+ $this->type('check_number', '1044');
+
// Clicking save.
$this->click('_qf_Participant_upload-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
-
+
// Is status message correct?
$this->assertElementContainsText("css=#crm-notification-container", "Event registration for $displayName has been added", "Status message didn't show up after saving!");
-
+
$this->waitForElementPresent("xpath=//div[@id='Events']//table//tbody/tr[1]/td[8]/span/a[text()='View']");
//click through to the participant view screen
$this->click("xpath=//div[@id='Events']//table//tbody/tr[1]/td[8]/span/a[text()='View']");
$this->waitForElementPresent('_qf_ParticipantView_cancel-bottom');
-
+
$this->webtestVerifyTabularData(
array(
'Event' => $eventTitle,
)
);
}
-
+
function _checkLineItems($expectedLineItems) {
- foreach ($expectedLineItems as $lineKey => $lineValue) {
- foreach ($lineValue as $key => $value) {
+ foreach ($expectedLineItems as $lineKey => $lineValue) {
+
+ foreach ($lineValue as $key => $value) {
+
$this->verifyText("xpath=//table/tbody/tr/td[text()='Event Fees']/following-sibling::td/table/tbody/tr[$lineKey]/td[$key]", preg_quote($value));
}
}
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Event_ChangeParticipantStatus extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Event_EventWaitListTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTestCase {
-
+
protected function setUp() {
parent::setUp();
}
-
- function testAuthenticatedMultipleEvent(){
+
+ function testAuthenticatedMultipleEvent(){
+
// Log in using webtestLogin() method
$this->webtestLogin();
-
+
//Enable shopping cart style
$this->openCiviPage("admin/setting/preferences/event", "reset=1");
$this->check("enable_cart");
$this->click("_qf_Event_next-top");
$this->waitForPageToLoad($this->getTimeoutMsec());
-
+
// We need a payment processor
$processorName = "Webtest Dummy" . substr(sha1(rand()), 0, 7);
$this->webtestAddPaymentProcessor($processorName);
-
+
//event 1
$this->openCiviPage("event/add", "reset=1&action=add");
-
+
$eventTitle1 = 'My Conference1 - ' . substr(sha1(rand()), 0, 7);
$eventDescription1 = "Here is a description for this conference 1.";
$this->_testAddEventInfo($eventTitle1, $eventDescription1);
-
+
$streetAddress1 = "100 Main Street";
$this->_testAddLocation($streetAddress1);
-
+
$this->_testAddFees(FALSE, FALSE, $processorName);
-
+
// intro text for registration page
$registerIntro = "Fill in all the fields below and click Continue.";
$multipleRegistrations = TRUE;
$this->_testAddOnlineRegistration($registerIntro, $multipleRegistrations);
-
+
$eventInfoStrings1 = array($eventTitle1, $eventDescription1, $streetAddress1);
$this->_AddEventToCart($eventTitle1, $eventInfoStrings1);
-
+
//event 2
$this->openCiviPage("event/add", "reset=1&action=add");
-
+
$eventTitle2 = 'My Conference2 - ' . substr(sha1(rand()), 0, 7);
$eventDescription2 = "Here is a description for this conference 2.";
$this->_testAddEventInfo($eventTitle2, $eventDescription2);
-
+
$streetAddress2 = "101 Main Street";
$this->_testAddLocation($streetAddress2);
-
+
$this->_testAddFees(FALSE, FALSE, $processorName);
-
+
// intro text for registration page
$registerIntro = "Fill in all the fields below and click Continue.";
$multipleRegistrations = TRUE;
$this->_testAddOnlineRegistration($registerIntro, $multipleRegistrations);
-
+
$eventInfoStrings2 = array($eventTitle2, $eventDescription2, $streetAddress2);
$this->_AddEventToCart($eventTitle2, $eventInfoStrings2);
-
+
//event 3
$this->openCiviPage("event/add", "reset=1&action=add");
-
+
$eventTitle3 = 'My Conference3 - ' . substr(sha1(rand()), 0, 7);
$eventDescription3 = "Here is a description for this conference 3.";
$this->_testAddEventInfo($eventTitle3, $eventDescription3);
-
+
$streetAddress3 = "102 Main Street";
$this->_testAddLocation($streetAddress3);
-
+
$this->_testAddFees(FALSE, FALSE, $processorName);
-
+
// intro text for registration page
$registerIntro = "Fill in all the fields below and click Continue.";
$multipleRegistrations = TRUE;
$this->_testAddOnlineRegistration($registerIntro, $multipleRegistrations);
-
+
$eventInfoStrings3 = array($eventTitle3, $eventDescription3, $streetAddress3);
$this->_AddEventToCart($eventTitle3, $eventInfoStrings3);
-
+
//Checkout
$value = $this->_testCheckOut();
-
+
//three event names
$events = array( 1 => $eventTitle1,
2 => $eventTitle2,
3 => $eventTitle3,
);
- //check the existence of the contacts who were registered and the one who did the contribution
+ //check the existence of the contacts who were registered and the one who did the contribution
+
$this->_checkContributionsandEventRegistration($value[0],$value[1],$events);
}
-
+
function testAnonymousMultipleEvent(){
// This is the path where our testing install resides.
// The rest of URL is defined in CiviSeleniumTestCase base class, in
// class attributes.
-
+
// Log in using webtestLogin() method
$this->webtestLogin();
-
+
// We need a payment processor
$processorName = "Webtest Dummy" . substr(sha1(rand()), 0, 7);
$this->webtestAddPaymentProcessor($processorName);
-
+
//event 1
$this->openCiviPage("event/add", "reset=1&action=add");
-
+
$eventTitle1 = 'My Conference1 - ' . substr(sha1(rand()), 0, 7);
$eventDescription1 = "Here is a description for this conference 1.";
$this->_testAddEventInfo($eventTitle1, $eventDescription1);
-
+
$streetAddress1 = "100 Main Street";
$this->_testAddLocation($streetAddress1);
-
+
$this->_testAddFees(FALSE, FALSE, $processorName);
-
+
// intro text for registration page
$registerIntro = "Fill in all the fields below and click Continue.";
$multipleRegistrations = TRUE;
$this->_testAddOnlineRegistration($registerIntro, $multipleRegistrations);
-
+
$eventInfoStrings1 = array($eventTitle1, $eventDescription1, $streetAddress1);
$registerUrl1 = $this->_testVerifyEventInfo($eventTitle1, $eventInfoStrings1);
//event 2
$this->openCiviPage("event/add", "reset=1&action=add");
-
+
$eventTitle2 = 'My Conference2 - ' . substr(sha1(rand()), 0, 7);
$eventDescription2 = "Here is a description for this conference 2.";
$this->_testAddEventInfo($eventTitle2, $eventDescription2);
-
+
$streetAddress2 = "101 Main Street";
$this->_testAddLocation($streetAddress2);
-
+
$this->_testAddFees(FALSE, FALSE, $processorName);
-
+
// intro text for registration page
$registerIntro = "Fill in all the fields below and click Continue.";
$multipleRegistrations = TRUE;
$this->_testAddOnlineRegistration($registerIntro, $multipleRegistrations);
-
+
$eventInfoStrings2 = array($eventTitle2, $eventDescription2, $streetAddress2);
$registerUrl2 = $this->_testVerifyEventInfo($eventTitle2, $eventInfoStrings2);
//event 3
$this->openCiviPage("event/add", "reset=1&action=add");
-
+
$eventTitle3 = 'My Conference3 - ' . substr(sha1(rand()), 0, 7);
$eventDescription3 = "Here is a description for this conference 3.";
$this->_testAddEventInfo($eventTitle3, $eventDescription3);
-
+
$streetAddress3 = "102 Main Street";
$this->_testAddLocation($streetAddress3);
-
+
$this->_testAddFees(FALSE, FALSE, $processorName);
-
+
// intro text for registration page
$registerIntro = "Fill in all the fields below and click Continue.";
$multipleRegistrations = TRUE;
$this->_testAddOnlineRegistration($registerIntro, $multipleRegistrations);
-
+
$eventInfoStrings3 = array($eventTitle3, $eventDescription3, $streetAddress3);
$registerUrl3 = $this->_testVerifyEventInfo($eventTitle3, $eventInfoStrings3);
2 => $eventTitle2,
3 => $eventTitle3,
);
- //check the existence of the contacts who were registered and the one who did the contribution
+ //check the existence of the contacts who were registered and the one who did the contribution
+
$this->_checkContributionsandEventRegistration($value[0],$value[1],$events);
}
-
+
function _testAddEventInfo($eventTitle, $eventDescription) {
$this->waitForElementPresent("_qf_EventInfo_upload-bottom");
// Wait for Location tab form to load
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->waitForElementPresent("_qf_Location_upload-bottom");
-
+
$this->type("address_1_street_address", $streetAddress);
$this->type("address_1_city", "San Francisco");
$this->type("address_1_postal_code", "94117");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->assertTrue($this->isTextPresent("$eventTitle has been added to your cart"));
}
-
+
function _testVerifyEventInfo($eventTitle, $eventInfoStrings, $eventFees = NULL) {
// verify event input on info page
// start at Manage Events listing
$this->openCiviPage("event/manage", "reset=1");
$this->click("link=$eventTitle");
$this->waitForPageToLoad($this->getTimeoutMsec());
-
+
// Check for correct event info strings
$this->assertStringsPresent($eventInfoStrings);
-
+
// Optionally verify event fees (especially for discounts)
if ($eventFees) {
- $this->assertStringsPresent($eventFees);
+ $this->assertStringsPresent($eventFees);
+
}
return $this->getLocation();
}
function _testCheckOut(){
//View the Cart
$this->click("xpath=//div[@id='messages']/div/div/a[text()='View your cart.']");
-
+
//Click on Checkout
$this->waitForElementPresent("xpath=//a[@class='button crm-check-out-button']/span");
$this->click("xpath=//a[@class='button crm-check-out-button']/span");
$this->waitForPageToLoad($this->getTimeoutMsec());
-
+
$firstName = "AB".substr(sha1(rand()), 0, 7);
$lastName = "XY".substr(sha1(rand()), 0, 7);
for( $i = 1; $i <= 3; $i++ ){
$this->select("billing_state_province_id-5", "value=1004");
$this->type("billing_postal_code-5", "94129");
$this->type("billing_contact_email", "{$firstName}.{$lastName}@example.com");
-
+
$this->click("_qf_Payment_next-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
-
+
$this->assertTrue($this->isTextPresent("This is your receipt of payment made for the following event registration."));
return array($firstName, $lastName);
}
$this->click('sort_name_navigation');
$this->type('css=input#sort_name_navigation',"{$firstName}.{$lastName}@home.com" );
$this->typeKeys('css=input#sort_name_navigation', "{$firstName}.{$lastName}@home.com");
-
+
// Wait for result list.
$this->waitForElementPresent("css=div.ac_results-inner li");
-
+
// Visit contact summary page.
$this->click("css=div.ac_results-inner li");
$this->waitForPageToLoad($this->getTimeoutMsec());
-
+
//click on Events Tab
$this->click("xpath=//li[@id='tab_participant']/a");
//check if the participant is registered for all the three events
$this->waitForElementPresent("xpath=//table[@class='selector']/tbody/tr[$i]/td[6][text()='Registered']");
$this->assertTrue($this->isElementPresent("xpath=//table[@class='selector']/tbody/tr[$i]/td[6][text()='Registered']"));
}
-
+
//Type the billing email in autocomplete.
$this->click('sort_name_navigation');
$this->type('css=input#sort_name_navigation',"{$firstName}.{$lastName}@example.com" );
$this->typeKeys('css=input#sort_name_navigation', "{$firstName}.{$lastName}@example.com");
-
+
// Wait for result list.
$this->waitForElementPresent("css=div.ac_results-inner li");
-
+
// Visit contact summary page.
$this->click("css=div.ac_results-inner li");
$this->waitForPageToLoad($this->getTimeoutMsec());
-
+
//click on Contributions Tab
$this->click("xpath=//li[@id='tab_contribute']/a");
//check for the three contributions
$this->waitForElementPresent("xpath=//table[@class='selector']/tbody/tr/td[3][contains(text(),'$value')]");
$this->assertTrue($this->isElementPresent("xpath=//table[@class='selector']/tbody/tr/td[3][contains(text(),'$value')]"));
}
-
+
//Disable shopping cart style
$this->openCiviPage("admin/setting/preferences/event", "reset=1");
$this->click("enable_cart");
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase {
//add email to name and address profile
$cfId = $this->_addEmailField();
-
+
// create custom group1
$this->openCiviPage("admin/custom/group", "reset=1");
$this->click("newCustomDataGroup");
//add email field to name and address profile
$cfId = $this->_addEmailField( );
-
+
// create custom group1
$this->openCiviPage("admin/custom/group", "reset=1");
$this->click("newCustomDataGroup");
$this->verifyText("xpath=//form[@id='ParticipantView']/div[2]/table/tbody/tr[6]/td[2]", preg_quote($status));
// delete all custom data
- if (isset($cfId)) {
+ if (isset($cfId)) {
+
$this->_removeEmailField($cfId);
}
foreach ($customId as $cid) {
$this->clickLink("_qf_Participant_1_next-Array", "_qf_Confirm_next-bottom");
$this->click("_qf_Confirm_next-bottom");
}
-
+
function _addEmailField( ){
//add email field in name and address profile
$this->openCiviPage('admin/uf/group/field/add', 'reset=1&action=add&gid=1', "_qf_Field_next-bottom");
$this->select("field_name[2]", "value=0");
$this->click('_qf_Field_next-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
-
+
$cfId = "";
//check wheather webtest has created the field
if (!$this->isTextPresent("The selected field was not added. It already exists in this profile")) {
}
return $cfId;
}
-
- function _removeEmailField($cfId) {
+
+ function _removeEmailField($cfId) {
+
$this->openCiviPage("admin/uf/group/field", "action=delete&id={$cfId}");
$this->click("_qf_Field_next-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
$firstNameDonar = 'Andrew' . substr(sha1(rand()), 0, 7);
$lastNameDonar = 'Roger' . substr(sha1(rand()), 0, 7);
$middleNameDonar = 'Nicholas' . substr(sha1(rand()), 0, 7);
-
+
$this->type("{$emailElement}", $firstNameDonar . "@example.com");
$this->webtestAddCreditCardDetails();
$this->webtestAddBillingDetails($firstNameDonar, $middleNameDonar, $lastNameDonar);
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Event_ParticipantSearchTest extends CiviSeleniumTestCase {
$this->type("event_type", $eventTypeName);
$this->type("event_type_id", 3);
-
$this->click("_qf_Search_refresh");
$this->waitForPageToLoad($this->getTimeoutMsec());
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
$this->_checkConfirmationAndRegister();
-
// 2'st registration
// Register Participant 1
// visit event info page
$this->_checkConfirmationAndRegister();
-
// 2'st registration
// Register Participant 1
// visit event info page
if (isset($field['financial_type_id'])) {
$this->waitForElementPresent('financial_type_id');
$this->select('financial_type_id', "value={$field['financial_type_id']}");
- }
+ }
+
}
else {
$this->_testAddMultipleChoiceOptions($field['options'], $field['type']);
$this->waitForElementPresent("option_max_value_{$oIndex}");
$this->type("option_max_value_{$oIndex}", $oValue['max_count']);
}
-
+
if (!empty($oValue['financial_type_id'])) {
$this->select( "option_financial_type_id_{$oIndex}", "value={$oValue['financial_type_id']}" );
}
-
+
$this->click('link=another choice');
}
$processorName = $params['payment_processor'];
$this->click("xpath=//tr[@class='crm-event-manage-fee-form-block-payment_processor']/td[2]/label[text()='$processorName']");
$this->select('financial_type_id', 'value=4');
-
+
if (array_key_exists('price_set', $params)) {
$this->select('price_set_id', 'label=' . $params['price_set']);
}
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'WebTest/Export/ExportCiviSeleniumTestCase.php';
class WebTest_Export_ContactTest extends ExportCiviSeleniumTestCase {
// Is contact present in search result?
$this->assertElementContainsText('css=div.crm-search-results', $sortName, "Contact did not found in search result!");
-
+
// Is contact present in search result?
$this->assertElementContainsText('css=div.crm-search-results', $childSortName, "Contact did not found in search result!");
-
+
// select to export all the contasct from search result.
$this->click("CIVICRM_QFID_ts_all_4");
// Is contact present in search result?
$this->assertElementContainsText('css=div.crm-search-results', $sortName1, "Contact did not found in search result!");
-
+
// Is contact present in search result?
$this->assertElementContainsText('css=div.crm-search-results', $sortName2, "Contact did not found in search result!");
-
+
// Is contact present in search result?
$this->assertElementContainsText('css=div.crm-search-results', $houseHold, "Contact did not found in search result!");
-
+
// select to export all the contasct from search result.
$this->click("CIVICRM_QFID_ts_all_4");
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class ExportCiviSeleniumTestCase extends CiviSeleniumTestCase {
*/
function testFinancialAccount() {
$this->webtestLogin();
-
+
// Add new Financial Account
$orgName = 'Alberta '.substr(sha1(rand()), 0, 7);
$financialAccountTitle = 'Financial Account '.substr(sha1(rand()), 0, 4);
$isTax = TRUE;
$taxRate = 9.99999999;
$isDefault = FALSE;
-
+
//Add new organisation
if($orgName) {
$this->webtestAddOrganization($orgName);
}
-
+
$this->_testAddFinancialAccount($financialAccountTitle,
$financialAccountDescription,
$accountingCode,
$taxRate,
$isDefault
);
-
+
$this->waitForElementPresent("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']");
-
+
$this->clickLink("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']", '_qf_FinancialAccount_cancel-botttom');
//Varify Data after Adding new Financial Account
$verifyData = array('name' => $financialAccountTitle,
'is_deductible' => 'off',
'is_default' => 'off'
);
-
+
$this->_assertFinancialAccount($verifyData);
$verifySelectFieldData = array('financial_account_type_id' => $financialAccountType);
$this->_assertSelectVerify($verifySelectFieldData);
$this->click('_qf_FinancialAccount_cancel-botttom');
-
+
//Edit Financial Account
$editfinancialAccount = $financialAccountTitle;
$financialAccountTitle .= ' Edited';
$orgNameEdit = FALSE;
$financialAccountType = 'Revenue';
-
+
if ($orgNameEdit) {
$orgNameEdit = 'NGO '.substr(sha1(rand()), 0, 7);
$this->webtestAddOrganization($orgNameEdit);
}
-
+
$this->_testEditFinancialAccount($editfinancialAccount,
$financialAccountTitle,
$financialAccountDescription,
$isTax,
$taxRate,
$isDefault
- );
+ );
+
if($orgNameEdit) {
$orgName = $orgNameEdit;
}
$this->waitForElementPresent("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']");
$this->clickLink("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']", '_qf_FinancialAccount_cancel-botttom');
-
+
$verifyData = array( 'name' => $financialAccountTitle,
'description' => $financialAccountDescription,
'accounting_code' => $accountingCode,
$this->_assertSelectVerify($verifySelectFieldData);
$this->click('_qf_FinancialAccount_cancel-botttom');
$this->waitForElementPresent("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Delete']");
-
+
//Delete Financial Account
$this->_testDeleteFinancialAccount($financialAccountTitle);
}
class WebTest_Financial_FinancialAccountTypeTest extends CiviSeleniumTestCase {
function testFinancialAccount() {
- // To Add Financial Account
+ // To Add Financial Account
+
// class attributes.
-
+
// Log in using webtestLogin() method
$this->webtestLogin();
-
+
// Add new Financial Account
$orgName = 'Alberta '.substr(sha1(rand()), 0, 7);
$financialAccountTitle = 'Financial Account '.substr(sha1(rand()), 0, 4);
$isTax = TRUE;
$taxRate = 5.20;
$isDefault = FALSE;
-
+
//Add new organisation
if ($orgName) {
$this->webtestAddOrganization($orgName);
}
-
- $this->_testAddFinancialAccount(
+
+ $this->_testAddFinancialAccount(
+
$financialAccountTitle,
$financialAccountDescription,
$accountingCode,
$taxRate,
$isDefault
);
-
+
$this->waitForElementPresent("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']");
-
+
$this->clickLink("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']", '_qf_FinancialAccount_cancel-botttom');
-
+
//Varify Data after Adding new Financial Account
- $verifyData = array(
+ $verifyData = array(
+
'name' => $financialAccountTitle,
'description' => $financialAccountDescription,
'accounting_code' => $accountingCode,
'is_deductible' => 'off',
'is_default' => 'off',
);
-
+
$this->_assertFinancialAccount($verifyData);
$verifySelectFieldData = array(
'financial_account_type_id' => $financialAccountType,
$financialType['is_reserved'] = false;
$this->addeditFinancialType($financialType);
$accountRelationship = "Income Account is";
- $expected[] = array(
- 'financial_account' => $financialAccountTitle,
- 'account_relationship' => $accountRelationship
+ $expected[] = array(
+
+ 'financial_account' => $financialAccountTitle,
+
+ 'account_relationship' => $accountRelationship
+
);
-
+
$this->select('account_relationship', "label={$accountRelationship}");
$this->select('financial_account_id', "label={$financialAccountTitle}");
$this->click('_qf_FinancialTypeAccount_next_new');
$this->assertElementContainsText('crm-notification-container', $text, 'Missing text: ' . $text);
$this->assertTrue($this->isTextPresent($text), 'Missing text: ' . $text);
$accountRelationship = 'Expense Account is';
- $expected[] = array(
- 'financial_account' => 'Banking Fees',
- 'account_relationship' => $accountRelationship
+ $expected[] = array(
+
+ 'financial_account' => 'Banking Fees',
+
+ 'account_relationship' => $accountRelationship
+
);
$this->select('account_relationship', "label={$accountRelationship}");
$text = 'The financial type Account has been saved.';
$this->assertElementContainsText('crm-notification-container', $text, 'Missing text: ' . $text);
$this->assertTrue($this->isTextPresent($text), 'Missing text: ' . $text);
-
+
foreach ($expected as $value => $label) {
$this->verifyText("xpath=id('ltype')/div/table/tbody/tr/td[1][text()='$label[financial_account]']/../td[2]", preg_quote($label['account_relationship']));
}
$this->click('_qf_FinancialTypeAccount_next-botttom');
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->assertElementContainsText('crm-notification-container', 'Selected financial type account has been deleted.', 'Missing text: ' . 'Selected financial type account has been deleted.');
-
+
//edit financial type
$financialType['oldname'] = $financialType['name'];
$financialType['name'] = 'Edited FinancialType '.substr(sha1(rand()), 0, 4);
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Generic_CheckActivityTest extends CiviSeleniumTestCase {
}
}
-
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Generic_CheckDashboardTest extends CiviSeleniumTestCase {
}
}
-
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Generic_CheckFindTest extends CiviSeleniumTestCase {
}
}
-
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Generic_GeneralClickAroundTest extends CiviSeleniumTestCase {
$this->click("css=ul#civicrm-menu li.crm-New_Mailing a");
$this->waitForPageToLoad($this->getTimeoutMsec());
-
$this->assertTextPresent("New Mailing");
$this->assertElementPresent("name");
$this->assertElementPresent("includeGroups-f");
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Grant_ContactContextAddTest extends CiviSeleniumTestCase {
// check contact name on Grant form
$this->assertElementContainsText('page-title', "$firstName $lastName");
-
// select grant Status
$this->select('status_id', 'value=1');
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Grant_CustomFieldsetTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Grant_StandaloneAddTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'WebTest/Import/ImportCiviSeleniumTestCase.php';
class WebTest_Import_ActivityTest extends ImportCiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'WebTest/Import/ImportCiviSeleniumTestCase.php';
class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase {
$firstName1 = 'Ma_' . substr(sha1(rand()), 0, 7);
// Add a custom group and custom field
$customDataParams = $this->_addCustomData();
-
+
// Get sample import data.
list($headers, $rows) = $this->_individualCustomCSVData($customDataParams, $firstName1);
// Wait for result list.
$this->waitForElementPresent("css=div.ac_results-inner li");
-
+
// Visit contact summary page.
$this->click("css=div.ac_results-inner li");
$this->waitForPageToLoad($this->getTimeoutMsec());
-
+
foreach($customDataParams['customFields'] as $key => $value){
$this->assertTrue($this->isElementPresent("xpath=//div[@class='crm-summary-row']/div[@class='crm-label'][contains(text(), '$key')]"));
$this->assertElementContainsText('address-block-1', "$value");
}
}
-
/*
* Helper function to provide data for custom data import.
*/
function _individualCustomCSVData($customDataParams, $firstName1) {
-
+
$headers = array(
'first_name' => 'First Name',
'last_name' => 'Last Name',
foreach( $customDataParams['headers'] as $key =>$value){
$headers[$key] = $value;
}
-
- $rows = array( 0 =>
+
+ $rows = array( 0 =>
+
array(
'first_name' => $firstName1,
'last_name' => 'Anderson',
}
return array($headers, $rows);
}
-
+
function _addCustomData() {
$this->openCiviPage('admin/custom/group', 'reset=1');
// clicking save
$this->click('_qf_Field_next-bottom');
$this->waitForElementPresent('newCustomField');
-
+
$this->assertElementContainsText('crm-notification-container',"Your custom field '{$customField}' has been saved.");
$customFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField']/../../td[8]/span/a@href"));
$customFieldId = $customFieldId[1];
$customFieldId1 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField1']/../../td[8]/span/a@href"));
$customFieldId1 = $customFieldId1[1];
-
// create custom field - Number
$this->click("newCustomField");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->waitForPageToLoad($this->getTimeoutMsec());
$customField3 = 'Customfield_alp_select' . substr(sha1(rand()), 0, 4);
$customFieldId3 = $this->_createMultipleValueCustomField($customField3,'Select');
-
+
// create custom field - "alphanumeric radio"
$this->click("newCustomField");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->waitForPageToLoad($this->getTimeoutMsec());
$customField6 = 'Customfield_alp_multiselect' . substr(sha1(rand()), 0, 4);
$customFieldId6 = $this->_createMultipleValueCustomField($customField6,'Multi-Select');
-
+
// create custom field - "alphanumeric advmultiselect"
$this->click("newCustomField");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->waitForPageToLoad($this->getTimeoutMsec());
$customField8 = 'Customfield_alp_autocompleteselect' . substr(sha1(rand()), 0, 4);
$customFieldId8 = $this->_createMultipleValueCustomField($customField8,'Autocomplete-Select');
-
+
// create custom field - Money
$this->click("newCustomField");
$this->waitForPageToLoad($this->getTimeoutMsec());
$customFieldId10 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField10']/../../td[8]/span/a@href"));
$customFieldId10 = $customFieldId10[1];
- return array('headers' =>
+ return array('headers' =>
+
array("custom_{$customFieldId}" => "$customField :: $customGroupTitle",
"custom_{$customFieldId3}" => "$customField3 :: $customGroupTitle",
"custom_{$customFieldId4}" => "$customField4 :: $customGroupTitle",
),
);
}
-
+
function _createMultipleValueCustomField( $customFieldName, $type ){
$this->type('label', $customFieldName);
$this->select("data_type[0]","value=0");
$this->type("option_value_1","label1");
$this->type("option_label_2","label2");
$this->type("option_value_2","label2");
-
+
// clicking save
$this->click('_qf_Field_next-bottom');
$this->waitForElementPresent('newCustomField');
return $customFieldId;
}
-
}
+--------------------------------------------------------------------+
*/
-
require_once 'WebTest/Import/ImportCiviSeleniumTestCase.php';
class WebTest_Import_AddressParsingTest extends ImportCiviSeleniumTestCase {
}
}
-
+--------------------------------------------------------------------+
*/
-
require_once 'WebTest/Import/ImportCiviSeleniumTestCase.php';
class WebTest_Import_ContactCustomDataTest extends ImportCiviSeleniumTestCase {
$this->assertTrue($this->isTextPresent('This is a test field'));
}
-
/*
* Helper function to provide data for custom data import.
*/
+--------------------------------------------------------------------+
*/
-
require_once 'WebTest/Import/ImportCiviSeleniumTestCase.php';
class WebTest_Import_ContactSubtypeTest extends ImportCiviSeleniumTestCase {
$this->importContacts($headers, $rows, 'Individual', 'No Duplicate Checking', array(), $other);
}
-
/*
* Test contact import for Organization Subtype.
*/
$this->importContacts($headers, $rows, 'Organization', 'No Duplicate Checking', array(), $other);
}
-
/*
* Test contact import for Household Subtype.
*/
+--------------------------------------------------------------------+
*/
-
require_once 'WebTest/Import/ImportCiviSeleniumTestCase.php';
class WebTest_Import_ContactTest extends ImportCiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'WebTest/Import/ImportCiviSeleniumTestCase.php';
class WebTest_Import_ContributionTest extends ImportCiviSeleniumTestCase {
$firstName2 = substr(sha1(rand()), 0, 7);
$email2 = 'mail_' . substr(sha1(rand()), 0, 7) . '@example.com';
$this->webtestAddContact($firstName2, 'Anderson', $email2);
-
+
$headers = array(
'email' => 'Email',
'fee_amount' => 'Fee Amount',
+--------------------------------------------------------------------+
*/
-
require_once 'WebTest/Import/ImportCiviSeleniumTestCase.php';
class WebTest_Import_CustomDataTest extends ImportCiviSeleniumTestCase {
$this->waitForElementPresent('newCustomField');
$this->assertTrue($this->isTextPresent("Your custom field '{$dateFieldLabel}' has been saved."));
-
+
$dateFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$dateFieldLabel']/../../td[8]/span/a@href"));
$dateFieldId = $dateFieldId[1];
+--------------------------------------------------------------------+
*/
-
require_once 'WebTest/Import/ImportCiviSeleniumTestCase.php';
class WebTest_Import_DateFormatTest extends ImportCiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'WebTest/Import/ImportCiviSeleniumTestCase.php';
class WebTest_Import_DuplicateMatchingTest extends ImportCiviSeleniumTestCase {
// Get imported contact Ids
$importedContactIds = $this->_getImportedContactIds($rows, 'Organization');
-
// Build update mode import headers
$updateHeaders = array(
'email' => 'Email',
+--------------------------------------------------------------------+
*/
-
require_once 'WebTest/Import/ImportCiviSeleniumTestCase.php';
class WebTest_Import_GroupTest extends ImportCiviSeleniumTestCase {
protected $captureScreenshotOnFailure = TRUE;
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
require_once 'CRM/Utils/Array.php';
class ImportCiviSeleniumTestCase extends CiviSeleniumTestCase {
* @params string $mode import mode
* @params array $fieldMapper select mapper fields while import
* @params array $other other parameters
- * useMappingName : to reuse mapping
+ * useMappingName : to reuse mapping
+
* dateFormat : date format of data
* checkMapperHeaders : to override default check mapper headers
* saveMapping : save current mapping?
* @params string $mode import mode
* @params array $fieldMapper select mapper fields while import
* @params array $other other parameters
- * contactSubtype : import for selected Contact Subtype
+ * contactSubtype : import for selected Contact Subtype
+
* useMappingName : to reuse mapping
* dateFormat : date format of data
* checkMapperHeaders : to override default check mapper headers
* callbackImportSummary : function to override default import summary assertions
*
* @params string $type import type (csv/sql)
- * @todo:currently only supports csv, need to work on sql import
+ * @todo:currently only supports csv, need to work on sql import
+
*/
function importContacts($headers, $rows, $contactType = 'Individual', $mode = 'Skip', $fieldMapper = array(
), $other = array(), $type = 'csv') {
*
* @params string $component component name
*
- * @return string import url
+ * @return string import url
+
*/
function _getImportComponentUrl($component) {
*
* @params string $component component name
*
- * @return string import url
+ * @return string import url
+
*/
function _getImportComponentContactType($component, $contactType) {
$importComponentMode = array(
* Helper function to get imported contact ids.
*
* @params array $rows fields rows
- * @params string $contactType contact type
+ * @params string $contactType contact type
+
*
* @return array $contactIds imported contact ids
*/
+--------------------------------------------------------------------+
*/
-
require_once 'WebTest/Import/ImportCiviSeleniumTestCase.php';
class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'WebTest/Import/ImportCiviSeleniumTestCase.php';
class WebTest_Import_MemberTest extends ImportCiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'WebTest/Import/ImportCiviSeleniumTestCase.php';
class WebTest_Import_MultipleRelationshipTest extends ImportCiviSeleniumTestCase {
/*
* Helper function to provide data for multiple relationship import
- * for Individuals.
+ * for Individuals.
+
*/
function _individualRelationshipCSVData() {
+--------------------------------------------------------------------+
*/
-
require_once 'WebTest/Import/ImportCiviSeleniumTestCase.php';
class WebTest_Import_ParticipantTest extends ImportCiviSeleniumTestCase {
// Get sample import data.
list($headers, $rows) = $this->_participantIndividualCSVData();
-
+
// Create and import csv from provided data and check imported data.
$fieldMapper = array(
'mapper[0][0]' => 'email',
+--------------------------------------------------------------------+
*/
-
require_once 'WebTest/Import/ImportCiviSeleniumTestCase.php';
class WebTest_Import_SavedMapping extends ImportCiviSeleniumTestCase {
}
}
-
+--------------------------------------------------------------------+
*/
-
require_once 'WebTest/Import/ImportCiviSeleniumTestCase.php';
class WebTest_Import_TagTest extends ImportCiviSeleniumTestCase {
-
protected function setUp() {
parent::setUp();
}
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Mailing_AddMessageTemplateTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Mailing_AddNewMailingComponentTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase {
// //------ end unsubscribe -------
}
-
+
function testAdvanceSearchAndReportCheck() {
$this->webtestLogin();
// fill subject for mailing
$this->type("subject", "Test subject {$mailingName} for Webtest");
-
+
// check for default option enabled
$this->assertChecked("CIVICRM_QFID_1_upload_type");
$this->verifyText("xpath=//table//tr[td/a[text()='Successful Deliveries']]/descendant::td[2]", preg_quote("1 (100.00%)"));
$summaryInfoLinks = array('Intended Recipients', 'Successful Deliveries', 'Tracked Opens', 'Click-throughs', 'Forwards', 'Replies', 'Bounces', 'Unsubscribe Requests','Opt-out Requests');
-
+
//check for report and adv search links
foreach($summaryInfoLinks as $value) {
$this->assertTrue($this->isElementPresent("xpath=//fieldset/legend[text()='Delivery Summary']/../table//tr[td/a[text()='{$value}']]/descendant::td[3]/span/a[1][text()='Report']"), "Report link missing for {$value}");
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
require_once 'CiviTest/CiviMailUtils.php';
require_once 'ezc/Base/src/ezc_bootstrap.php';
$this->webtestLogin();
// Start spooling mail
- $mut = new CiviMailUtils( $this, true );
+ $mut = new CiviMailUtils($this, true);
// Add a contact
$fname = substr(sha1(rand()), 0, 6);
// Get the contact id of the newly added contact
$urlElements = $this->parseURL();
$cid = $urlElements['queryString']['cid'];
- $this->assertNotEmpty( $cid, 'Could not find cid after adding contact' );
+ $this->assertNotEmpty($cid, 'Could not find cid after adding contact');
// Send an email to the added contact
$this->openCiviPage("activity/email/add", "action=add&reset=1&cid={$cid}&selectedChild=activity&atype=3");
- $this->type( 'subject', 'test spool' );
- $this->fillRichTextField( 'html_message', 'Unit tests keep children safe.' );
- $this->click( "_qf_Email_upload" );
+ $this->type('subject', 'test spool');
+ $this->fillRichTextField('html_message', 'Unit tests keep children safe.');
+ $this->click("_qf_Email_upload");
// Retrieve an ezc mail object version of the email
- $msg = $mut->getMostRecentEmail( 'ezc' );
- // print_r($msg);
+ $msg = $mut->getMostRecentEmail('ezc');
- $this->assertNotEmpty( $msg, 'Mail message empty or not found.' );
- $this->assertEquals( $msg->subject, 'test spool' );
- $this->assertContains( $email, implode(';', $msg->to), 'Recipient incorrect.' ); // should really walk through the 'to' array, but this is legal according to the docs
+ $this->assertNotEmpty($msg, 'Mail message empty or not found.');
+ $this->assertEquals($msg->subject, 'test spool');
+ // should really walk through the 'to' array, but this is legal according to the docs
+ $this->assertContains($email, implode(';', $msg->to), 'Recipient incorrect.');
- $context = new ezcMailPartWalkContext( array( get_class($this), 'mailWalkCallback' ) );
- $msg->walkParts( $context, $msg );
+ $context = new ezcMailPartWalkContext(array(get_class($this), 'mailWalkCallback'));
+ $msg->walkParts($context, $msg);
/*
* Now try a regular activity with cc to assignee
*/
$this->WebtestAddActivity();
- $msg = $mut->getMostRecentEmail( 'raw' );
-// echo $msg;
- $this->assertNotEmpty( $msg, 'Mail message empty or not found.' );
- $this->assertContains( 'Subject: This is subject of test activity', $msg, 'Subject of email is wrong.' );
+ $msg = $mut->getMostRecentEmail('raw');
+ $this->assertNotEmpty($msg, 'Mail message empty or not found.');
+ $this->assertContains('Subject: This is subject of test activity', $msg, 'Subject of email is wrong.');
$mut->stop();
}
- public static function mailWalkCallback( $context, $mailPart ) {
-// print_r($mailPart);
- if ( $mailPart instanceof ezcMailText ) {
- self::assertEquals( $mailPart->subType, 'html' );
- self::assertContains( 'Unit tests keep children safe', $mailPart->generateBody() );
+ public static function mailWalkCallback($context, $mailPart) {
+ if ($mailPart instanceof ezcMailText) {
+ self::assertEquals($mailPart->subType, 'html');
+ self::assertContains('Unit tests keep children safe', $mailPart->generateBody());
}
$disp = $mailPart->contentDisposition;
- if ( $disp ) {
-// print_r($disp);
+ if ($disp) {
+
}
}
}
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase {
$customGroupTitle = 'Custom_' . substr(sha1(rand()), 0, 4);
$this->openCiviPage('admin/custom/group', 'reset=1');
-
+
//add new custom data
$this->click("//a[@id='newCustomDataGroup']/span");
$this->waitForPageToLoad($this->getTimeoutMsec());
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Member_ContactContextAddTest extends CiviSeleniumTestCase {
}
}
-
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Member_DefaultMembershipPricesetTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Member_FixedMembershipTypeTest extends CiviSeleniumTestCase {
// Rollover Date < Start Date
// Join Date > Rollover Date and Join Date < Start Date
-
// Log in using webtestLogin() method
$this->webtestLogin();
}
$query = "
-SELECT end_event_adjust_interval
- FROM civicrm_membership_status
+SELECT end_event_adjust_interval
+
+ FROM civicrm_membership_status
+
WHERE start_event = 'join_date'
AND name = 'New'";
$endInterval = CRM_Core_DAO::singleValueQuery($query);
// Scenario 2
// Rollover Date < Join Date
-
// Log in using webtestLogin() method
$this->webtestLogin();
}
$query = "
-SELECT end_event_adjust_interval
- FROM civicrm_membership_status
+SELECT end_event_adjust_interval
+
+ FROM civicrm_membership_status
+
WHERE start_event = 'join_date'
AND name = 'New'";
$endInterval = CRM_Core_DAO::singleValueQuery($query);
// Standard Fixed scenario - Jan 1 Fixed Period Start and October 31 rollover
// Join Date is later than Rollover Date
-
// Log in using webtestLogin() method
$this->webtestLogin();
$this->waitForTextPresent("Membership Type {$title}");
$this->select('membership_type_id[1]', "label=Membership Type {$title}");
-
$sourceText = "Membership ContactAddTest with Fixed Membership Type Scenario 3";
// fill in Source
$this->type('source', $sourceText);
}
$query = "
-SELECT end_event_adjust_interval
- FROM civicrm_membership_status
+SELECT end_event_adjust_interval
+
+ FROM civicrm_membership_status
+
WHERE start_event = 'join_date'
AND name = 'New'";
$endInterval = CRM_Core_DAO::singleValueQuery($query);
// Standard Fixed scenario - Jan 1 Fixed Period Start and October 31 rollover
// Join Date is earlier than Rollover Date
-
// Log in using webtestLogin() method
$this->webtestLogin();
$this->click('member_of_contact');
$this->waitForElementPresent("css=div.ac_results-inner li");
$this->click("css=div.ac_results-inner li");
-
+
$this->type('minimum_fee', '100');
$this->select( 'financial_type_id', 'value=2' );
$this->type('duration_interval', 1);
}
$query = "
-SELECT end_event_adjust_interval
- FROM civicrm_membership_status
+SELECT end_event_adjust_interval
+
+ FROM civicrm_membership_status
+
WHERE start_event = 'join_date'
AND name = 'New'";
$endInterval = CRM_Core_DAO::singleValueQuery($query);
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Member_OfflineAutoRenewMembershipTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCase {
}
-
function _testAddSet($setTitle, $usedFor, $contributionType = NULL, $setHelp) {
$this->openCiviPage('admin/price', 'reset=1&action=add', '_qf_Set_next-bottom');
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Member_OfflineMembershipRenewTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Member_OnlineAutoRenewMembershipGCTest extends CiviSeleniumTestCase {
// Justification for this instance: FIXME
sleep(5);
- // FIXME: By this time pending records has already been created. Formatting for external page (google checkout in this case)
+ // FIXME: By this time pending records has already been created. Formatting for external page (google checkout in this case)
+
// has changed a bit. No point in adding test for external page as we 'll test with fake transactions.
}
// Justification for this instance: FIXME
sleep(5);
- // FIXME: By this time pending records has already been created. Formatting for external page (google checkout in this case)
+ // FIXME: By this time pending records has already been created. Formatting for external page (google checkout in this case)
+
// has changed a bit. No point in adding test for external page as we 'll test with fake transactions.
}
$this->webtestAddPaymentProcessor($processorName, 'Google_Checkout');
// -- start updating membership types
- $this->openCiviPage('admin/member/membershipType/add', 'action=update&id=1&reset=1');
-
+ $this->openCiviPage('admin/member/membershipType/add', 'action=update&id=1&reset=1');
+
$this->waitForElementPresent("xpath=//div[@id='membership_type_form']//table/tbody/tr[6]/td/label[contains(text(), 'Auto-renew Option')]/../../td[2]/label[contains(text(), 'Give option, but not required')]");
$this->click("xpath=//div[@id='membership_type_form']//table/tbody/tr[6]/td/label[contains(text(), 'Auto-renew Option')]/../../td[2]/label[contains(text(), 'Give option, but not required')]");
-
+
$this->type("duration_interval", "1");
$this->select("duration_unit", "label=year");
//wait for the auto-complete member_of_contact to populate
$this->waitForValue('member_of_contact', '::');
-
+
$this->click("_qf_MembershipType_upload-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->openCiviPage('admin/member/membershipType/add', 'action=update&id=2&reset=1');
-
+ $this->openCiviPage('admin/member/membershipType/add', 'action=update&id=2&reset=1');
+
$this->waitForElementPresent("xpath=//div[@id='membership_type_form']//table/tbody/tr[6]/td/label[contains(text(), 'Auto-renew Option')]/../../td[2]/label[contains(text(), 'Give option, but not required')]");
$this->click("xpath=//div[@id='membership_type_form']//table/tbody/tr[6]/td/label[contains(text(), 'Auto-renew Option')]/../../td[2]/label[contains(text(), 'Give option, but not required')]");
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Member_OnlineAutoRenewMembershipTest extends CiviSeleniumTestCase {
//now do the test membership signup.
$this->openCiviPage('contribute/transact', "reset=1&action=preview&id={$pageId}", "_qf_Main_upload-bottom");
-
+
$this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label/span[2][contains(text(),'Student')]");
$this->click("auto_renew");
//now do the test membership signup.
$this->openCiviPage('contribute/transact', "reset=1&action=preview&id={$pageId}", "_qf_Main_upload-bottom");
-
+
$this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label/span[2][contains(text(),'Student')]");
$this->click("auto_renew");
//now do the test membership signup.
$this->openCiviPage('contribute/transact', "reset=1&action=preview&id={$pageId}", "_qf_Main_upload-bottom");
-
+
$this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label/span[2][contains(text(),'Student')]");
$this->click("auto_renew");
$this->type("duration_interval", "1");
$this->select("duration_unit", "label=year");
-
+
// wait for the auto-complete member_of_contact to populate
$this->waitForValue('member_of_contact', '::');
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCase {
$fields = array("National Membership $title", "Radio");
$this->openCiviPage('admin/price/field', "reset=1&action=add&sid={$sid}");
-
+
$validateStrings[] = $fields[0];
$this->type('label', $fields[0]);
$this->select('html_type', "value={$fields[1]}");
'amount' => 120.00,
'membership_num_terms' => 3,
),
-
+
);
$i = 2;
foreach($options as $index => $values){
$this->type("xpath=//table[@id='optionField']/tbody/tr[$i]/td[5]/input",$values['label']);
$this->type("xpath=//table[@id='optionField']/tbody/tr[$i]/td[6]/input",$values['amount']);
if($i > 3){
- $this->click('link=another choice');
+ $this->click('link=another choice');
+
}
$i++;
}
$this->click('_qf_Field_next-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->assertElementContainsText('crm-notification-container', "Price Field '{$fields[0]}' has been saved.");
-
+
// load the Price Set Preview and check for expected values
$this->_testVerifyPriceSet($validateStrings, $sid);
);
}
}
-
+
function _testMultilpeTermsMembershipRegistration($pageId, $contactParams, $memTypeTitle1, $term, $renew = FALSE){
if($renew){
$this->openCiviPage('member/search', 'reset=1', 'member_end_date_high');
$year = CRM_Utils_Date::processDate($this->getText("xpath=//form[@id='MembershipView']//table/tbody/tr/td[text()='End date']/following-sibling::td"));
$prevYear = substr($year, 0, 4);
}
-
+
$this->webtestLogout();
$this->openCiviPage('contribute/transact', "reset=1&id=$pageId", '_qf_Main_upload-bottom');
$currentMonth = date('m');
$previousDay = date('d') - 1;
$endYear = ($term == 3) ? $currentYear + 3 : (($term == 2) ? $currentYear + 2 : $currentYear + 1);
- $endYear = ($renew) ? $endYear + ($prevYear - $currentYear) : $endYear;
+ $endYear = ($renew) ? $endYear + ($prevYear - $currentYear) : $endYear;
+
$joinDate = date('Y-m-d', mktime(0, 0, 0, $currentMonth, date('d'), $currentYear));
$startDate = date('Y-m-d', mktime(0, 0, 0, $currentMonth, date('d'), $currentYear));
$endDate = date('Y-m-d', mktime(0, 0, 0, $currentMonth, $previousDay, $endYear));
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Member_OnlineMembershipCreateTest extends CiviSeleniumTestCase {
FALSE
);
-
// create two new membership types
$memTypeParams1 = $this->webtestAddMembershipType();
$memTypeTitle1 = $memTypeParams1['membership_type'];
$this->clickLink('_qf_MembershipBlock_next', '_qf_MembershipBlock_next-bottom');
$text = "'MembershipBlock' information has been saved.";
$this->assertElementContainsText('crm-notification-container', $text, 'Missing text: ' . $text);
-
+
//logout
$this->webtestLogout();
if ($payLater) {
$verifyData['Status'] = 'Pending';
}
- else {
+ else {
+
$verifyData['Status'] = 'New';
}
$this->webtestVerifyTabularData($verifyData);
$this->waitForElementPresent("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label");
if ($memTypeId != 'No thank you') {
$this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label/span[2][contains(text(),'$memTypeId')]");
- }
+ }
+
else {
- $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label[contains(text(),'$memTypeId')]");
+ $this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label[contains(text(),'$memTypeId')]");
+
}
if (!$otherAmount) {
$this->click("xpath=//div[@class='crm-section contribution_amount-section']/div[2]//span/label[text()='No thank you']");
$this->click("_qf_Confirm_next-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
}
-
+
function testOnlineMembershipCreateWithContribution() {
//login with admin credentials & make sure we do have required permissions.
$permissions = array("edit-1-make-online-contributions", "edit-1-profile-listings-and-forms");
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
$this->click('css=#tab_membership a');
$this->waitForElementPresent("member_is_active");
$this->check("member_is_active");
-
- $this->waitForElementPresent("new_title");
+
+ $this->waitForElementPresent("new_title");
+
if ($this->isElementPresent("member_price_set_id")) {
- $this->waitForElementPresent("member_price_set_id");
+ $this->waitForElementPresent("member_price_set_id");
+
$this->select("member_price_set_id", "label=- none -");
}
-
+
$this->waitForElementPresent("membership_type-block");
$this->check("xpath=//tr[@id='membership_type-block']/td[2]/table/tbody/tr/td/label[text()='General']/../input[2]");
$this->check("xpath=//tr[@id='membership_type-block']/td[2]/table/tbody/tr/td/label[text()='Student']/../input[2]");
$this->click("_qf_MembershipBlock_next-bottom");
$this->waitForTextPresent("'MembershipBlock' information has been saved");
-
+
// go to Profiles
$this->click('css=#tab_custom a');
//Go to online membership signup page
$this->openCiviPage("contribute/transact", "reset=1&id=2", "_qf_Main_upload-bottom");
-
+
$this->click("xpath=//div[@class='crm-section membership_amount-section']/div[2]//span/label/span[2][contains(text(),'Student')]");
//Type first name and last name and email
$this->click('css=#tab_membership a');
$this->waitForElementPresent("member_is_active");
$this->check("member_is_active");
-
+
$this->waitForElementPresent("new_title");
if ($this->isElementPresent("member_price_set_id")) {
- $this->waitForElementPresent("member_price_set_id");
+ $this->waitForElementPresent("member_price_set_id");
+
$this->select("member_price_set_id", "label=- none -");
}
-
+
$this->waitForElementPresent("membership_type-block");
$this->check("xpath=//tr[@id='membership_type-block']/td[2]/table/tbody/tr/td/label[text()='General']/../input[2]");
$this->check("xpath=//tr[@id='membership_type-block']/td[2]/table/tbody/tr/td/label[text()='Student']/../input[2]");
$this->click("_qf_MembershipBlock_next-bottom");
$this->waitForTextPresent("'MembershipBlock' information has been saved");
-
+
// go to Profiles
$this->click('css=#tab_custom a');
function testUpdateInheritedMembershipOnBehalfOfRenewal() {
// Log in as admin
$this->webtestLogin('admin');
-
+
$this->enableComponents('CiviMember');
//check for online contribution and profile listings permissions
$membershipTypeTitle = "Membership Type $title";
$this->type('name', "Membership Type $title");
-
+
$this->type('member_of_contact', $title);
$this->click('member_of_contact');
$this->waitForElementPresent("css=div.ac_results-inner li");
$this->click("_qf_Confirm_next-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
-
// Log in using webtestLogin() method
$this->webtestLogin();
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Member_SeperateMembershipPaymentTest extends CiviSeleniumTestCase {
FALSE
);
-
// create new membership types
$memTypeParams1 = $this->webtestAddMembershipType();
$memTypeTitle1 = $memTypeParams1['membership_type'];
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Member_StandaloneAddTest extends CiviSeleniumTestCase {
}
}
-
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Member_UpdateMembershipScriptTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Pledge_ContactContextAddTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Pledge_ContactContextPledgePaymentAddTest extends CiviSeleniumTestCase {
$this->click("add");
$this->click("_qf_Localization_next-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
-
+
// create unique name
$name = substr(sha1(rand()), 0, 7);
$firstName = 'Adam' . $name;
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Pledge_StandaloneAddDeleteTest extends CiviSeleniumTestCase {
$this->waitForElementPresent("xpath=//form[@id='Contribution']//div[2]/table/tbody/tr[3]/td[2]/a");
$this->click("xpath=//form[@id='Contribution']//div[2]/table/tbody/tr[3]/td[2]/a");
$this->type('total_amount', '300.00');
- $this->click('_qf_Contribution_upload-bottom');
+ $this->click('_qf_Contribution_upload-bottom');
+
$this->waitForPageToLoad("30000");
$this->assertElementContainsText('crm-notification-container', "The contribution record has been saved.");
-
+
$this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
$this->click("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[1]/span/a");
$this->waitForElementPresent("xpath=//div[@id='Pledges']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td[8]/a[text()='Record Payment (Check, Cash, EFT ...)']");
$this->click('_qf_Contribution_upload-bottom');
$this->waitForPageToLoad("30000");
$this->assertElementContainsText('crm-notification-container', "The contribution record has been saved.");
-
+
$this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
$this->click("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[1]/span/a");
$this->waitForElementPresent("xpath=//div[@id='Pledges']//table/tbody/tr[2]/td[2]/table/tbody/tr[4]/td[8]/a[text()='Record Payment (Check, Cash, EFT ...)']");
$this->click("xpath=//div[@id='Pledges']//table/tbody/tr[2]/td[2]/table/tbody/tr[4]/td[8]/a");
$this->waitForElementPresent("xpath=//form[@id='Contribution']//div[2]/table/tbody/tr[3]/td[2]/a");
- $this->click("xpath=//form[@id='Contribution']//div[2]/table/tbody/tr[3]/td[2]/a");
+ $this->click("xpath=//form[@id='Contribution']//div[2]/table/tbody/tr[3]/td[2]/a");
+
$this->type('total_amount', '170.00');
$this->click('_qf_Contribution_upload-bottom');
$this->waitForPageToLoad("30000");
$this->assertElementContainsText('crm-notification-container', "The contribution record has been saved.");
-
+
// delete the contribution associated with the 2nd payment
$this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
$this->click("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[1]/span/a");
$this->click("ui-id-3");
$this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
$this->click("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[1]/span/a");
- $this->waitForElementPresent("xpath=//div[@id='Pledges']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td[7]");
+ $this->waitForElementPresent("xpath=//div[@id='Pledges']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td[7]");
+
$this->verifyText("xpath=//div[@id='Pledges']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td[7]","Pending");
$this->waitForElementPresent("xpath=//div[@id='Pledges']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td");
-
+
// verify that payment owed amount is correct (250.00)
$this->verifyText("xpath=//div[@id='Pledges']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td","250.00");
// verify that Total Paid and Balance sums are correct
$this->verifyText("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[3]","470.00");
$this->verifyText("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[4]","1,930.00");
-
+
}
}
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Pledge_StandaloneAddTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Profile_DedupeTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Profile_MultiRecordProfileAddTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Profile_ProfileAddTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Profile_ProfileGroupSubscriptionTest extends CiviSeleniumTestCase {
// Add new profile.
$this->openCiviPage('admin/uf/group', 'reset=1');
-
+
$this->click('newCiviCRMProfile-top');
$this->waitForElementPresent('_qf_Group_next-bottom');
// check advisory group ( may be we should create a separate group to test this)
$this->click("group_3");
-
+
$this->click('_qf_Edit_next');
$this->waitForPageToLoad($this->getTimeoutMsec());
}
}
-
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Profile_SearchTest extends CiviSeleniumTestCase {
// Add new profile.
$this->openCiviPage('admin/uf/group', 'reset=1');
-
+
$this->click('newCiviCRMProfile-bottom');
$this->waitForElementPresent('_qf_Group_next-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
//check for field add
$this->assertElementContainsText('crm-notification-container', "Your CiviCRM Profile Field 'Email' has been saved to '$profileTitle'.");
- $this->assertElementContainsText('crm-notification-container', 'You can add another profile field.');
+ $this->assertElementContainsText('crm-notification-container', 'You can add another profile field.');
// Add Sample Custom Field.
$this->click('field_name[0]');
+--------------------------------------------------------------------+
*/
-
require_once 'ReleaseTestCase.php';
// name of the class doesn't end with Test on purpose - this way this
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
// name of the class doesn't end with Test on purpose - this way this
$this->settings = new ReleaseTestSettings();
}
-
protected function setUp() {
parent::setUp();
}
+--------------------------------------------------------------------+
*/
-
require_once 'ReleaseTestCase.php';
// name of the class doesn't end with Test on purpose - this way this
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Report_AddTest extends CiviSeleniumTestCase {
// Is filter statistics present?
$this->assertElementContainsText("xpath=//tr/th[@class='statistics'][text()='Contact Name']/../td", "Contains $firstName", "Statistics did not found!");
-
+
// Is Contact Name present in result?
$this->assertElementContainsText('css=td.crm-report-civicrm_contact_sort_name', $displayName, "Contact Name did not found!");
// Is email Id present on result?
$this->assertElementContainsText('css=td.crm-report-civicrm_email_email', $emailId, "Email did not found!");
-
+
// check criteria
$this->click("css=div.crm-report_criteria-accordion div.crm-accordion-header");
$this->waitForElementPresent("sort_name_value");
// Open report list
$this->openCiviPage('report/list', 'reset=1');
-
+
// Is report is resent in list?
$this->assertElementContainsText('css=table.report-layout', $reportName);
$this->click("link=$reportName");
$this->waitForPageToLoad($this->getTimeoutMsec());
-
// Is filter statistics present?
$this->assertElementContainsText("xpath=//tr/th[@class='statistics'][text()='Contact Name']/../td", "Contains $firstName", "Statistics did not found!");
-
+
// Is Contact Name present in result?
$this->assertElementContainsText('css=td.crm-report-civicrm_contact_sort_name', $displayName, "Contact Name did not found!");
}
}
-
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Report_DonarReportTest extends CiviSeleniumTestCase {
// now create new donar detail report instance
$this->openCiviPage('report/contribute/detail', 'reset=1', '_qf_Detail_submit');
-
+
// preview result
$this->click("_qf_Detail_submit");
$this->waitForPageToLoad($this->getTimeoutMsec());
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
+--------------------------------------------------------------------+
*/
-
require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Report_RolePermissionReportTest extends CiviSeleniumTestCase {