$this->openCiviPage('profile/edit', 'reset=1&gid=4', NULL);
$testUserFirstName = "Testuserfirst";
$testUserLastName = "Testuserlast";
- $this->waitForPageToLoad($this->getTimeoutMsec());
$this->waitForElementPresent("_qf_Edit_next");
$this->type("first_name", $testUserFirstName);
$this->type("last_name", $testUserLastName);
}
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),
/**
* @param $caseRoles
- * @param $creatorName
+ * @param string $creatorName
*/
function _testVerifyCaseRoles($caseRoles, $creatorName) {
$id = $this->urlArg('id');
}
/**
- * @param $firstName
- * @param $lastName
+ * @param string $firstName
+ * @param string $lastName
* @param $action
*/
function _testSearchbyDate($firstName, $lastName, $action) {
$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");
}
-
+
/**
- * @param $firstName
- * @param $lastName
+ * @param string $firstName
+ * @param string $lastName
* @param $caseTypeLabel
- *
- * test for assign case to another client
+ *
+ * test for assign case to another client
*/
function _testAssignToClient($firstName, $lastName, $caseTypeLabel) {
- $this->openCiviPage('case/search', 'reset=1', '_qf_Search_refresh-bottom');
+ $this->openCiviPage('case/search', 'reset=1', '_qf_Search_refresh-bottom');
$this->type('sort_name', $firstName);
$this->clickLink('_qf_Search_refresh-bottom');
$this->waitForElementPresent("xpath=//table[@class='caseSelector']/tbody//tr/td[3]/a[text()='{$lastName}, {$firstName}']");
- $this->clickAjaxLink("xpath=//table[@class='caseSelector']/tbody//tr/td[3]/a[text()='{$lastName}, {$firstName}']/../../td[11]/span[2]/ul/li/a[contains(text(),'Assign to Another Client')]");
+ $this->clickPopupLink("xpath=//table[@class='caseSelector']/tbody//tr/td[3]/a[text()='{$lastName}, {$firstName}']/../../td[11]/span[2]/ul/li/a[contains(text(),'Assign to Another Client')]");
$client = $this->createDialogContact("reassign_contact_id");
$this->clickLink('_qf_EditClient_done-bottom');
$this->assertElementContainsText('page-title', "{$client['display_name']} - $caseTypeLabel");