<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
require_once 'CiviTest/CiviSeleniumTestCase.php';
parent::setUp();
}
- function testAddEditCaseType() {
+ public function testAddEditCaseType() {
$caseRoles = array(1 => 'Parent of', 2 => 'Spouse of', 3 => 'Partner of');
- $activityTypes = array(1 => 'Meeting',2 => 'Contribution',3 => 'Event Registration');
- $timelineActivityTypes = array(1 => 'Meeting',2 => 'Phone Call',3 => 'Email');
+ $activityTypes = array(1 => 'Meeting', 2 => 'Contribution', 3 => 'Event Registration');
+ $timelineActivityTypes = array(1 => 'Meeting', 2 => 'Phone Call', 3 => 'Email');
// Log in as admin first to verify permissions for CiviCase
$this->webtestLogin('admin');
$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');
+ $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->openCiviPage('a/#/caseType/new');
- $caseTypeLabel = "Case Type". substr(sha1(rand()), 0, 7);
+ $caseTypeLabel = "Case Type" . substr(sha1(rand()), 0, 7);
$this->waitForElementPresent('title');
$this->type('title', $caseTypeLabel);
$this->select2("xpath=//tr[@class='addRow']/td[contains(text(),'Add activity:')]/span/div/a", $tActivityType, FALSE, TRUE);
}
- $this->clickAjaxLink("xpath=//div[@class='crm-submit-buttons']/span/input[@value='Save']");
+ $this->click('css=.crm-submit-buttons button:first-child');
$this->openCiviPage('case/add', 'reset=1&action=add&atype=13&context=standalone', '_qf_Case_upload-bottom');
$client = $this->createDialogContact("client_id");
$this->waitForElementPresent("xpath=//*[@id='crm-main-content-wrapper']/div/div/div[2]/a/span[contains(text(),'New Case Type')]");
$this->click("xpath=//table/tbody//tr/td[1][text()='{$caseTypeLabel}']/../td[5]/span/a[text()='Edit']");
- $this->waitForElementPresent("xpath=//div[@class='crm-submit-buttons']/span/input[@value='Save']");
+ $this->waitForElementPresent("css=.crm-submit-buttons button:first-child");
- $editCaseTypeLabel = "Case Type Edit". substr(sha1(rand()), 0, 7);
+ $editCaseTypeLabel = "Case Type Edit" . substr(sha1(rand()), 0, 7);
$this->waitForElementPresent('title');
$this->type('title', $editCaseTypeLabel);
- $this->select2("xpath=//tr[@class='addRow']/td/span/div/a", 'Sibling of', FALSE, TRUE);
- $this->click("xpath=//*[@id='crm-main-content-wrapper']/div/div/form/div/div[3]/table/tbody/tr[4]/td[2]/input[@type='checkbox']");
+ $this->select2("xpath=//div[@id='crm-main-content-wrapper']/div/div/form/div/div[4]/table/tfoot/tr/td/span/div/a", 'Sibling of', FALSE, TRUE);
+ $this->click("xpath=//*[@id='crm-main-content-wrapper']/div/div/form/div/div[4]/table/tbody/tr[4]/td[2]/input[@type='checkbox']");
$this->click("xpath=//a[text()='Standard Timeline']");
$this->select2("xpath=//tr[@class='addRow']/td[contains(text(),'Add activity:')]/span/div/a", 'SMS', FALSE, TRUE);
- $this->click("xpath=//div[@class='crm-submit-buttons']/span/input[@value='Save']");
+ $this->click('css=.crm-submit-buttons button:first-child');
$this->waitForElementPresent("xpath=//*[@id='crm-main-content-wrapper']/div/div/div[2]/a/span[contains(text(),'New Case Type')]");
$this->verifyText("xpath=//table/tbody//tr/td[contains(text(),'$editCaseTypeLabel')]", $editCaseTypeLabel);
}
+
}