From 3d21830f46955ffcc56119b808d428e8782762aa Mon Sep 17 00:00:00 2001 From: monishdeb Date: Wed, 18 Nov 2015 10:29:44 +0530 Subject: [PATCH] 4.7beta1 webtest failure --- .../phpunit/CiviTest/CiviSeleniumTestCase.php | 21 +------------------ tests/phpunit/WebTest/Contact/AddTest.php | 12 ++++++++--- 2 files changed, 10 insertions(+), 23 deletions(-) diff --git a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php index c72bc9fded..d6b47fca89 100644 --- a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php +++ b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php @@ -379,8 +379,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { public function webtestGetValidCountryID() { static $_country_id; if (is_null($_country_id)) { - $config_backend = $this->webtestGetConfig('countryLimit'); - $_country_id = current($config_backend); + $_country_id = $this->webtestGetSetting('defaultContactCountry'); } return $_country_id; } @@ -400,24 +399,6 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { return NULL; } - /** - * @param $field - * - * @return mixed - */ - public function webtestGetConfig($field) { - static $_config_backend; - if (is_null($_config_backend)) { - $result = $this->webtest_civicrm_api("Domain", "getvalue", array( - 'current_domain' => 1, - 'option.limit' => 1, - 'return' => 'config_backend', - )); - $_config_backend = unserialize($result); - } - return $_config_backend[$field]; - } - /** * @param string $field * @return mixed diff --git a/tests/phpunit/WebTest/Contact/AddTest.php b/tests/phpunit/WebTest/Contact/AddTest.php index f2d546c68e..4241b7e596 100644 --- a/tests/phpunit/WebTest/Contact/AddTest.php +++ b/tests/phpunit/WebTest/Contact/AddTest.php @@ -43,7 +43,9 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase { // go to display preferences to enable Open ID field $this->openCiviPage('admin/setting/preferences/display', "reset=1", "_qf_Display_next-bottom"); $this->waitForAjaxContent(); - $this->click("xpath=//ul[@id='contactEditBlocks']//li/span/label[text()='Open ID']"); + if (!$this->isChecked("xpath=//ul[@id='contactEditBlocks']//li[@id='preference-10-contactedit']/span/input")) { + $this->click("xpath=//ul[@id='contactEditBlocks']//li/span/label[text()='Open ID']"); + } $this->click("_qf_Display_next-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); $this->openCiviPage('contact/add', 'reset=1&ct=Individual'); @@ -180,7 +182,9 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase { // go to display preferences to enable Open ID field $this->openCiviPage('admin/setting/preferences/display', "reset=1", "_qf_Display_next-bottom"); $this->waitForAjaxContent(); - $this->click("xpath=//ul[@id='contactEditBlocks']//li/span/label[text()='Open ID']"); + if (!$this->isChecked("xpath=//ul[@id='contactEditBlocks']//li[@id='preference-10-contactedit']/span/input")) { + $this->click("xpath=//ul[@id='contactEditBlocks']//li/span/label[text()='Open ID']"); + } $this->click("_qf_Display_next-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); @@ -292,7 +296,9 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase { // go to display preferences to enable Open ID field $this->openCiviPage('admin/setting/preferences/display', "reset=1", "_qf_Display_next-bottom"); $this->waitForAjaxContent(); - $this->click("xpath=//ul[@id='contactEditBlocks']//li/span/label[text()='Open ID']"); + if (!$this->isChecked("xpath=//ul[@id='contactEditBlocks']//li[@id='preference-10-contactedit']/span/input")) { + $this->click("xpath=//ul[@id='contactEditBlocks']//li/span/label[text()='Open ID']"); + } $this->click("_qf_Display_next-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); -- 2.25.1