From 22d1f513bd681523c912e2d1b789cde421bf6efc Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Mon, 2 May 2016 11:49:03 +0530 Subject: [PATCH] CRM-18454 - pass proper id for datepicker of core and custom field Fix id of custom date field --- tests/phpunit/CiviTest/CiviSeleniumTestCase.php | 2 +- tests/phpunit/WebTest/Contact/InlineFieldsEditTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php index 8d6668b13f..c719f503e4 100644 --- a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php +++ b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php @@ -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"); diff --git a/tests/phpunit/WebTest/Contact/InlineFieldsEditTest.php b/tests/phpunit/WebTest/Contact/InlineFieldsEditTest.php index 70796b4d10..0409889de5 100644 --- a/tests/phpunit/WebTest/Contact/InlineFieldsEditTest.php +++ b/tests/phpunit/WebTest/Contact/InlineFieldsEditTest.php @@ -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); -- 2.25.1