$this->_testSearchbyDate($firstName, $lastName, "this.quarter");
$this->_testSearchbyDate($firstName, $lastName, "0");
$this->_testSearchbyDate($firstName, $lastName, "this.year");
+ $this->_testAssignToClient($firstName, $lastName, $caseTypeLabel);
}
function testAjaxCustomGroupLoad() {
* @param $creatorName
*/
function _testVerifyCaseRoles($caseRoles, $creatorName) {
- $this->waitForElementPresent("xpath=//table[@id='caseRoles-selector']/tbody/tr[4]/td[2]/a");
+ $id = $this->urlArg('id');
+ $this->waitForElementPresent("xpath=//table[@id='caseRoles-selector-$id']/tbody/tr[4]/td[2]/a");
// check that expected roles are listed in the Case Roles pane
foreach ($caseRoles as $role) {
$this->assertText("css=div.crm-case-roles-block", $role);
}
// check that case creator role has been assigned to logged in user
- $this->verifyText("xpath=//table[@id='caseRoles-selector']/tbody/tr[4]/td[2]", $creatorName);
+ $this->verifyText("xpath=//table[@id='caseRoles-selector-$id']/tbody/tr[4]/td[2]", $creatorName);
}
/**
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->assertElementContainsText('Advanced', "$lastName, $firstName");
}
+
+ /**
+ * @param $firstName
+ * @param $lastName
+ * @param $caseTypeLabel
+ *
+ * test for assign case to another client
+ */
+ function _testAssignToClient($firstName, $lastName, $caseTypeLabel) {
+ $this->openCiviPage('case/search', 'reset=1', '_qf_Search_refresh-bottom');
+ $this->type('sort_name', $firstName);
+ $this->click('_qf_Search_refresh-bottom');
+ $this->waitForElementPresent("xpath=//table[@class='caseSelector']/tbody//tr/td[3]/a[text()='{$lastName}, {$firstName}']");
+
+ $this->click("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')]");
+ $clientFirstName = substr(sha1(rand()), 0, 7);
+ $clientLastName = "Fraser";
+ $clientEmail = "{$clientLastName}.{$clientFirstName}@example.org";
+ $this->waitForElementPresent('_qf_EditClient_done-bottom');
+ $this->webtestNewDialogContact($clientFirstName, $clientLastName, $clientEmail, $type = 4, "s2id_reassign_contact_id");
+ $this->clickLink('_qf_EditClient_done-bottom');
+ $this->assertElementContainsText('page-title', "$clientFirstName $clientLastName - $caseTypeLabel");
+ }
}