*/
require_once 'CiviTest/CiviSeleniumTestCase.php';
+
+/**
+ * Class WebTest_Case_CaseCustomFieldsTest
+ */
class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase {
protected function setUp() {
$custFname = "Mike" . substr(sha1(rand()), 0, 7);
$custMname = "Dav" . substr(sha1(rand()), 0, 7);
$custLname = "Krist" . substr(sha1(rand()), 0, 7);
- $this->webtestNewDialogContact($firstName, $lastName, $email, $type = 4);
+ $this->webtestNewDialogContact($firstName, $lastName, $email, $type = 4, "s2id_client_id");
// Fill in other form values. We'll use a case type which is included in CiviCase sample data / xml files.
$caseTypeLabel = "Adult Day Care Referral";
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->openCiviPage('case', 'reset=1', "xpath=//table[@class='caseSelector']/tbody//tr/td[2]/a[text()='{$contactName}']/../../td[8]/a[text()='Open Case']");
$this->click("xpath=//table[@class='caseSelector']/tbody//tr/td[2]/a[text()='{$contactName}']/../../td[8]/a[text()='Open Case']");
- $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()='Done']");
+ $this->waitForElementPresent("xpath=//span[@class='ui-button-icon-primary ui-icon ui-icon-closethick']");
// Because it tends to cause problems, all uses of sleep() must be justified in comments
// Sleep should never be used for wait for anything to load from the server
// Justification for this instance: FIXME
"Priority" => "Normal",
);
$this->webtestVerifyTabularData($openCaseData);
- $this->click("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()='Done']");
+ $this->click("xpath=//span[@class='ui-button-icon-primary ui-icon ui-icon-closethick']");
// verify if custom data is present
$this->openCiviPage('case', 'reset=1');
"Priority" => "Normal",
);
$this->webtestVerifyTabularData($openCaseChangeData);
- $this->click("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()='Done']");
+ $this->click("xpath=//span[@class='ui-button-icon-primary ui-icon ui-icon-closethick']");
// Because it tends to cause problems, all uses of sleep() must be justified in comments
// Sleep should never be used for wait for anything to load from the server
// Justification for this instance: FIXME
$this->_testDeleteCustomData($customGrpId1, $customId);
}
+ /**
+ * @param $validateStrings
+ * @param $activityTypes
+ */
function _testVerifyCaseSummary($validateStrings, $activityTypes) {
$this->assertStringsPresent($validateStrings);
foreach ($activityTypes as $aType) {
$this->assertElementPresent("name=case_report_all", "Print Case Summary button is missing.");
}
+ /**
+ * @param $customGrpId1
+ * @param bool $noteRichEditor
+ *
+ * @return array
+ */
function _testGetCustomFieldId($customGrpId1, $noteRichEditor=FALSE) {
$customId = array();
return $customId;
}
+ /**
+ * @param $customGrpId1
+ * @param $customId
+ */
function _testDeleteCustomData($customGrpId1, $customId) {
// delete all custom data
foreach ($customId as $cKey => $cValue) {
$email = "{$lastName}.{$firstName}@example.org";
$custFname = "Mike" . substr(sha1(rand()), 0, 7);
$custLname = "Krist" . substr(sha1(rand()), 0, 7);
- $this->webtestNewDialogContact($firstName, $lastName, $email, $type = 4);
+ $this->webtestNewDialogContact($firstName, $lastName, $email, $type = 4, "s2id_client_id");
// Fill in other form values. We'll use a case type which is included in CiviCase sample data / xml files.
$caseTypeLabel = "Adult Day Care Referral";
$this->waitForElementPresent("xpath=//table[@class='caseSelector']/tbody//tr/td[2]/a[text()='{$contactName}']/../../td[8]/a[text()='Open Case']");
$this->click("xpath=//table[@class='caseSelector']/tbody//tr/td[2]/a[text()='{$contactName}']/../../td[8]/a[text()='Open Case']");
- $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()='Done']");
$openCaseData = array(
"Client" => $displayName,
$this->waitForElementPresent("xpath=//table/tbody/tr/td[text()='{$label}']/following-sibling::td");
}
$this->webtestVerifyTabularData($openCaseData);
- $this->click("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()='Done']");
// verify if custom data is present
$this->openCiviPage('case', 'reset=1');
$cusId_1 = 'custom_' . $customId[0] . '_1';
$cusId_2 = 'custom_' . $customId[1] . '_1';
- $this->click("css=#{$customGrp1} a.button");
+ $this->clickLink("css=#{$customGrp1} a.button");
- // wait for dialog element
- $this->waitForElementPresent("css=div.ui-dialog div.ui-dialog-titlebar");
- // check for dialog box Title
- $this->assertElementContainsText("css=div.ui-dialog div.ui-dialog-titlebar", 'Update Case Information');
+ $this->assertElementContainsText("page-title", "Edit $customGrp1");
$custFname = "Miky" . substr(sha1(rand()), 0, 7);
$custLname = "Kristy" . substr(sha1(rand()), 0, 7);
$this->_testDeleteCustomData($customGrpId1, $customId);
}
+ /**
+ * @param $customId
+ * @param $custFname
+ * @param $custMname
+ * @param $custLname
+ */
function _testAdvansearchCaseData($customId, $custFname, $custMname, $custLname) {
// search casecontact
$this->openCiviPage('contact/search/advanced', 'reset=1', '_qf_Advanced_refresh');