$this->fireEvent($fieldName, 'focus');
if ($editor == 'CKEditor') {
if ($compressed) {
- $this->click("{$fieldName}-plain");
+ $this->click("{$fieldName}-plain");
}
$this->waitForElementPresent("xpath=//div[@id='cke_{$fieldName}']//iframe");
$this->runScript("CKEDITOR.instances['{$fieldName}'].setData('<p>{$text}</p>');");
$this->type('billing_city-5', 'San Bernadino');
$this->select('billing_country_id-5', 'value=1228');
$this->click('billing_state_province_id-5');
+ $this->waitForVisible('billing_state_province_id-5');
$this->select('billing_state_province_id-5', 'label=California');
$this->type('billing_postal_code-5', '93245');
// Is status message correct?
$this->waitForText('crm-notification-container', "Activity '$subject' has been saved.");
- $this->waitForElementPresent("xpath=//div[@id='contact-activity-selector-activity_wrapper']//table/tbody/tr[2]/td[8]/span/a[text()='View']");
+ $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']//table/tbody/tr[2]/td[8]/span/a[text()='View']");
// click through to the Activity view screen
- $this->click("xpath=//div[@id='contact-activity-selector-activity_wrapper']//table/tbody/tr[2]/td[8]/span/a[text()='View']");
+ $this->click("xpath=//div[@class='dataTables_wrapper no-footer']//table/tbody/tr[2]/td[8]/span/a[text()='View']");
$this->waitForElementPresent('_qf_Activity_cancel-bottom');
// parse URL to grab the activity id
$this->click('_qf_FinancialType_next');
if ($option == 'new') {
- $text = "Your Financial '{$financialType['name']}' Type has been created, along with a corresponding income account '{$financialType['name']}'. That income account, along with standard financial accounts 'Accounts Receivable', 'Banking Fees' and 'Premiums' have been linked to the financial type. You may edit or replace those relationships here.";
+ $text = "Your Financial \"{$financialType['name']}\" Type has been created, along with a corresponding income account \"{$financialType['name']}\". That income account, along with standard financial accounts \"Accounts Receivable\", \"Banking Fees\" and \"Premiums\" have been linked to the financial type. You may edit or replace those relationships here.";
}
else {
- $text = "The financial type '{$financialType['name']}' has been saved.";
+ $text = "The financial type \"{$financialType['name']}\" has been updated.";
}
- $this->waitForText('crm-notification-container', $text);
+ $this->assertSuccessMsg($text);
}
/**
function addProfile($profileTitle, $profileFields) {
$this->openCiviPage('admin/uf/group', "reset=1");
- $this->click('link=Add Profile');
-
- // Add membership custom data field to profile
- $this->waitForElementPresent('_qf_Group_cancel-bottom');
+ $this->clickLink('link=Add Profile', '_qf_Group_cancel-bottom');
$this->type('title', $profileTitle);
- $this->click('_qf_Group_next-bottom');
+ $this->clickLink('_qf_Group_next-bottom', "xpath=//a/span[text()='Add Field']");
- $this->waitForElementPresent('_qf_Field_cancel-bottom');
- //$this->assertTrue($this->isTextPresent("Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now."));
+ $this->waitForText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now.");
foreach ($profileFields as $field) {
$this->waitForElementPresent('field_name_0');
- // $this->waitForPageToLoad($this->getTimeoutMsec());
$this->click("id=field_name_0");
$this->select("id=field_name_0", "label=" . $field['type']);
$this->waitForElementPresent('field_name_1');
$this->waitForElementPresent('label');
$this->type("id=label", $field['label']);
$this->click("id=_qf_Field_next_new-top");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->waitForElementPresent("xpath=//select[@id='field_name_1'][@style='display: none;']");
//$this->assertTrue($this->isTextPresent("Your CiviCRM Profile Field '" . $field['name'] . "' has been saved to '" . $profileTitle . "'. You can add another profile field."));
}
}
* @param $financialType
*/
function addPremium($name, $sku, $amount, $price, $cost, $financialType) {
- $this->waitForElementPresent("_qf_ManagePremiums_upload-bottom");
+ $this->waitForElementPresent("_qf_ManagePremiums_next-bottom");
$this->type("name", $name);
$this->type("sku", $sku);
$this->click("CIVICRM_QFID_noImage_16");
if ($financialType) {
$this->select("financial_type_id", "label={$financialType}");
}
- $this->click("_qf_ManagePremiums_upload-bottom");
+ $this->click("_qf_ManagePremiums_next-bottom");
$this->waitForPageToLoad($this->getTimeoutMsec());
}
$return = $this->addCustomGroupField($customSets);
$this->openCiviPage($pageUrl['url'], $pageUrl['args']);
-
foreach($return as $values) {
foreach ($values as $entityType => $customData) {
//initiate necessary variables
$this->select2($elementName, $entityData);
}
}
-
//checking for proper custom data which is loading through ajax
$this->waitForElementPresent("xpath=//div[contains(@class, 'custom-group-{$customData['cgtitle']}')]",
"The on the fly custom group has not been rendered for entity : {$entity} => {$entityData}");
// Save
$this->click('_qf_Group_next-bottom');
- $this->waitForElementPresent('_qf_Field_cancel-bottom');
//Is custom group created?
$this->waitForText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added.");
+ $this->click('css=a#newCustomField');
+
$gid = $this->urlArg('gid');
+ $this->waitForTextPresent("{$customGroupTitle} - New Field");
$fieldLabel = "custom_field_for_{$customSet['entity']}_{$customSet['subEntity']}" . substr(sha1(rand()), 0, 4);
$this->type('label', $fieldLabel);
$this->click('_qf_Field_next_new-bottom');
- $this->waitForPageToLoad($this->getTimeoutMsec());
$customGroupTitle = preg_replace('/\s/', '_', trim($customGroupTitle));
$return[] = array(
$this->assertElementContainsText("xpath=//*[@id='$fieldid']/preceding-sibling::div[1]/", $value);
}
}
+
+ /**
+ * Wait for unobtrusive status message as set by CRM.status
+ */
+ function waitForStatusMsg() {
+ $this->waitForElementPresent("css=.crm-status-box-outer.status-success");
+ }
+
+ /**
+ * Wait for unobtrusive status message as set by CRM.status
+ */
+ function assertSuccessMsg($text) {
+ $this->waitForElementPresent("css=div.success");
+ $this->assertElementContainsText("css=div.success", $text);
+ }
+
+ /**
+ * function to enable or disable Pop-ups via Display Preferences
+ */
+ function enableDisablePopups($enabled = TRUE) {
+ $this->openCiviPage('admin/setting/preferences/display', 'reset=1');
+ $isChecked = $this->isChecked('ajaxPopupsEnabled');
+ if (($isChecked && !$enabled) || (!$isChecked && $enabled)) {
+ $this->click('ajaxPopupsEnabled');
+ }
+ if ($enabled) {
+ $this->assertChecked('ajaxPopupsEnabled');
+ }
+ else {
+ $this->assertNotChecked('ajaxPopupsEnabled');
+ }
+ $this->clickLink("_qf_Display_next-bottom");
+ }
}