Fixed webtest for civi-4.6
[civicrm-core.git] / tests / phpunit / WebTest / Case / AddCaseTypeTest.php
index 88f42e0a64fcb0a92064795cead4c65489833c71..63dea94cd72e980aa7ed1a1b799ce96df0d27f9e 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -22,7 +22,7 @@
  | 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';
 
@@ -76,7 +76,7 @@ class WebTest_Case_AddCaseTypeTest extends CiviSeleniumTestCase {
       $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");
@@ -126,7 +126,7 @@ class WebTest_Case_AddCaseTypeTest extends CiviSeleniumTestCase {
     $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);
     $this->waitForElementPresent('title');
@@ -138,9 +138,10 @@ class WebTest_Case_AddCaseTypeTest extends CiviSeleniumTestCase {
     $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);
   }
+
 }