* @param string|object params
* @param string mode - optionally specify "front" or "back"
*/
- var tplURL;
+ var tplURL = '/civicrm/example?placeholder';
+ var urlInitted = false;
CRM.url = function (p, params, mode) {
if (p == "init") {
- return tplURL = params;
+ tplURL = params;
+ urlInitted = true;
+ return;
}
- if (!tplURL) {
+ if (!urlInitted) {
console && console.log && console.log('Warning: CRM.url called before initialization');
}
if (!mode) {
}
params = params || '';
var frag = p.split ('?');
- var url = tplURL[mode].replace("civicrm/example", frag[0]);
+ var url = tplURL.replace("civicrm/example", frag[0]);
if (typeof(params) == 'string') {
url = url.replace("placeholder", params);
$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>');");
$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->clickLink("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']", '_qf_Contribution_cancel-bottom', FALSE);
$this->select("contribution_status_id", "label=Completed");
$this->clickLink("_qf_Contribution_upload", "xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']", FALSE);
+ $this->waitForText('crm-notification-container', "The contribution record has been saved.");
//Assertions
$search = array('id' => $contId);
$contId = explode('&', $contId[1]);
$contId = $contId[0];
$this->clickLink("_qf_Contribution_upload", "xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']", FALSE);
+ $this->waitForText('crm-notification-container', "The contribution record has been saved.");
//Assertions
$search = array('id' => $contId);
$contId = explode('&', $contId[1]);
$contId = $contId[0];
$this->clickLink("_qf_Contribution_upload", "xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='Edit']", FALSE);
+ $this->waitForText('crm-notification-container', "The contribution record has been saved.");
//Assertions
$search = array( 'id' => $contId );
$this->click("_qf_ContributionView_cancel-bottom");
}
}
-