CRM-18454 - pass proper id for datepicker of core and custom field
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Mon, 2 May 2016 06:19:03 +0000 (11:49 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Mon, 2 May 2016 09:13:59 +0000 (14:43 +0530)
Fix id of custom date field

tests/phpunit/CiviTest/CiviSeleniumTestCase.php
tests/phpunit/WebTest/Contact/InlineFieldsEditTest.php

index 8d6668b13fae64bec75a2643d9dfebb2b7a228fc..c719f503e4289b35c907d4b228e2466a504bba0c 100644 (file)
@@ -585,7 +585,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
     $day = date('j', $timeStamp);
 
     if (!$multiselect) {
-      $this->click($dateElement);
+      $this->click("xpath=//input[@id='{$dateElement}']/following-sibling::input");
     }
     $this->waitForElementPresent("css=div#ui-datepicker-div.ui-datepicker div.ui-datepicker-header div.ui-datepicker-title select.ui-datepicker-month");
     $this->select("css=div#ui-datepicker-div.ui-datepicker div.ui-datepicker-header div.ui-datepicker-title select.ui-datepicker-month", "value=$mon");
index 70796b4d101df8248a09962038c458810defe965..0409889de5183d3993e16c520576625980b46baa 100644 (file)
@@ -309,7 +309,7 @@ class WebTest_Contact_InlineFieldsEditTest extends CiviSeleniumTestCase {
             case 'string':
               if ($val && substr($val, 0, 5) == 'date:') {
                 $val = date('m/d/Y', strtotime(trim(substr($val, 5))));
-                $item = "xpath=//input[starts-with(@id, '{$item}_display_')]";
+                $item = "xpath=//input[@id='{$item}']/following-sibling::input";
               }
               if ($val) {
                 $this->assertElementValueEquals($item, $val);