From b86fcc879cfa13064a14f488e306b5f000a292eb Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Mon, 29 Dec 2014 18:57:42 +0530 Subject: [PATCH] webtest fixes 4.6 --- tests/phpunit/WebTest/Contact/AddTest.php | 4 +++- tests/phpunit/WebTest/Contact/AddViaProfileTest.php | 2 +- tests/phpunit/WebTest/Contact/AddressParsingTest.php | 2 +- tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php | 2 +- tests/phpunit/WebTest/Contact/ProfileChecksumTest.php | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/phpunit/WebTest/Contact/AddTest.php b/tests/phpunit/WebTest/Contact/AddTest.php index 729698a6bc..2774d45fe2 100644 --- a/tests/phpunit/WebTest/Contact/AddTest.php +++ b/tests/phpunit/WebTest/Contact/AddTest.php @@ -203,7 +203,9 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase { $this->select("phone_1_phone_type_id", "value=" . $this->webtestGetFirstValueForOptionGroup('phone_type')); //fill in IM - $this->assertElementContainsText('im_1_provider_id', "Yahoo MSN AIM GTalk Jabber Skype"); + foreach (array('Yahoo', 'MSN', 'AIM', 'GTalk', 'Jabber', 'Skype') as $option) { + $this->assertSelectHasOption('im_1_provider_id', $option); + } $this->type("im_1_name", "testSkype"); $this->select("im_1_location_type_id", "value=3"); $this->select("im_1_provider_id", "value=6"); diff --git a/tests/phpunit/WebTest/Contact/AddViaProfileTest.php b/tests/phpunit/WebTest/Contact/AddViaProfileTest.php index 3f855505d9..fb7babc7c5 100644 --- a/tests/phpunit/WebTest/Contact/AddViaProfileTest.php +++ b/tests/phpunit/WebTest/Contact/AddViaProfileTest.php @@ -54,7 +54,7 @@ class WebTest_Contact_AddViaProfileTest extends CiviSeleniumTestCase { $this->type("street_address-1", "902C El Camino Way SW"); $this->type("city-1", "Dumfries"); $this->type("postal_code-1", "1234"); - $this->assertElementContainsText('country-1', "United States"); + $this->assertSelected('country-1', "United States"); $this->select("state_province-1", "value=1019"); // Clicking save. diff --git a/tests/phpunit/WebTest/Contact/AddressParsingTest.php b/tests/phpunit/WebTest/Contact/AddressParsingTest.php index 0978f38cdc..6ce6ffc654 100644 --- a/tests/phpunit/WebTest/Contact/AddressParsingTest.php +++ b/tests/phpunit/WebTest/Contact/AddressParsingTest.php @@ -96,7 +96,7 @@ class WebTest_Contact_AddressParsingTest extends CiviSeleniumTestCase { $this->type("address_4_street_address", "121 SW Sherman Way Suite 15"); $this->type("address_4_city", "Birmingham"); $this->type("address_4_postal_code", "5491"); - $this->assertTrue($this->isTextPresent("- select - United States")); + $this->assertSelected('address_4_country_id', "United States"); $this->select("address_4_state_province_id", "value=1002"); // Store location type of each address diff --git a/tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php b/tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php index 56886b1516..0534d5d289 100644 --- a/tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php +++ b/tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php @@ -153,7 +153,7 @@ class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase { case 'multiselect2': foreach ($field['values'] as $op) { - $this->waitForVisible($fldLocator); + $this->waitForElementPresent($fldLocator); $this->multiselect2($fldLocator, $op); } break; diff --git a/tests/phpunit/WebTest/Contact/ProfileChecksumTest.php b/tests/phpunit/WebTest/Contact/ProfileChecksumTest.php index 51397c5d2d..af8d044f3b 100644 --- a/tests/phpunit/WebTest/Contact/ProfileChecksumTest.php +++ b/tests/phpunit/WebTest/Contact/ProfileChecksumTest.php @@ -120,7 +120,7 @@ class WebTest_Contact_ProfileChecksumTest extends CiviSeleniumTestCase { foreach ($fields as $field) { $this->assertTrue($this->isElementPresent($field['element_name']), "Missing Field: {$field['label']}."); if (isset($field['html_type']) && $field['html_type'] == 'select') { - $this->waitForVisible($field['element_name']); + $this->waitForElementPresent($field['element_name']); $this->select($field['element_name'], "value={$field['update_value']}"); } else { -- 2.25.1