* @return void
*/
function customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl, $beforeTriggering = NULL) {
+ // FIXME: Testing a theory that these failures have something to do with permissions
+ $this->webtestLogin('admin');
+
//add the custom set
$return = $this->addCustomGroupField($customSets);
// FIXME: Try to find out what the heck is going on with these tests
$this->waitForAjaxContent();
$this->checkForErrorsOnPage();
-
+
//checking for proper custom data which is loading through ajax
- $this->waitForElementPresent("xpath=//div[contains(@class, 'custom-group-{$customData['cgtitle']}')]");
+ $this->waitForElementPresent("css=.custom-group-{$customData['cgtitle']}");
$this->assertElementPresent("xpath=//div[contains(@class, 'custom-group-{$customData['cgtitle']}')]/div[contains(@class, 'crm-accordion-body')]/table/tbody/tr/td[2]/input",
"The on the fly custom group field is not present for entity : {$entity} => {$entityData}");
}
}
function testLinkCases() {
- $this->webtestLogin();
+ // Log in as admin first to verify permissions for CiviCase
+ $this->webtestLogin('admin');
// Enable CiviCase module if necessary
$this->enableComponents("CiviCase");
+ // let's give full CiviCase permissions to demo user (registered user).
+ $permission = array('edit-2-access-all-cases-and-activities', 'edit-2-access-my-cases-and-activities', 'edit-2-administer-civicase', 'edit-2-delete-in-civicase');
+ $this->changePermissions($permission);
+
+ // Log in as normal user
+ $this->webtestLogin();
+
//Add Case 1
$this->openCiviPage('case/add', 'reset=1&action=add&atype=13&context=standalone', '_qf_Case_upload-bottom');
}
function testAjaxCustomGroupLoad() {
- $this->webtestLogin();
+ // Log in as admin first to verify permissions for CiviCase
+ $this->webtestLogin('admin');
// Enable CiviCase module if necessary
$this->enableComponents("CiviCase");
+ // let's give full CiviCase permissions to demo user (registered user).
+ $permission = array('edit-2-access-all-cases-and-activities', 'edit-2-access-my-cases-and-activities', 'edit-2-administer-civicase', 'edit-2-delete-in-civicase');
+ $this->changePermissions($permission);
+
+ // Log in as normal user
+ $this->webtestLogin();
+
$triggerElement = array('name' => 'case_type_id', 'type' => 'select');
$customSets = array(
array('entity' => 'Case', 'subEntity' => 'Housing Support', 'triggerElement' => $triggerElement),
$this->webtestFillDate("case_to_end_date_low", "-1 month");
$this->webtestFillDate("case_to_end_date_high", "+1 month");
}
- $this->click("_qf_Advanced_refresh");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->clickLink("_qf_Advanced_refresh");
$this->assertElementContainsText('Advanced', "$lastName, $firstName");
}