From fdec0f57b8a6945992969ff2dc0a21edecce07c8 Mon Sep 17 00:00:00 2001 From: kurund Date: Tue, 13 Aug 2013 01:51:51 +0530 Subject: [PATCH] fix for WebTest_Contact_AddTest --- tests/phpunit/WebTest/Contact/AddTest.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/tests/phpunit/WebTest/Contact/AddTest.php b/tests/phpunit/WebTest/Contact/AddTest.php index 2993cff523..1c8528ef85 100644 --- a/tests/phpunit/WebTest/Contact/AddTest.php +++ b/tests/phpunit/WebTest/Contact/AddTest.php @@ -34,7 +34,7 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase { function testIndividualAdd() { $this->webtestLogin(); - $this->WebtestAddGroup(); + $groupName = $this->WebtestAddGroup(); // go to display preferences to enable Open ID field $this->openCiviPage('admin/setting/preferences/display', "reset=1", "_qf_Display_next-bottom"); @@ -101,7 +101,6 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase { $this->select("address_1_country_id", "value=" . $this->webtestGetValidCountryID()); if ($this->assertElementContainsText('address_1', "Latitude")) { - $this->type("address_1_geo_code_1", "1234"); $this->type("address_1_geo_code_2", "5678"); } @@ -157,7 +156,8 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase { //Tags and Groups section $this->click("tagGroup"); - $this->click("group[{$this->webtestGetValidEntityID('Group')}]"); + // select group + $this->select("crmasmSelect0", "label=$groupName"); $this->click("tag[{$this->webtestGetValidEntityID('Tag')}]"); // Clicking save. @@ -170,6 +170,8 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase { function testHouseholdAdd() { $this->webtestLogin(); + $groupName = $this->WebtestAddGroup(); + // go to display preferences to enable Open ID field $this->openCiviPage('admin/setting/preferences/display', "reset=1", "_qf_Display_next-bottom"); $this->check("xpath=//ul[@id='contactEditBlocks']//li/span[2]/label[text()='Open ID']/../input"); @@ -260,8 +262,10 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase { $this->type("subject", "Grant's note"); $this->type("note", "This is a household contact webtest note."); - //Tags and Groups section - $this->click("group[{$this->webtestGetValidEntityID('Group')}]"); + // select group + $this->select("crmasmSelect0", "label=$groupName"); + + //tags section $this->click("tag[{$this->webtestGetValidEntityID('Tag')}]"); // Clicking save. @@ -274,6 +278,8 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase { function testOrganizationAdd() { $this->webtestLogin(); + $groupName = $this->WebtestAddGroup(); + // go to display preferences to enable Open ID field $this->openCiviPage('admin/setting/preferences/display', "reset=1", "_qf_Display_next-bottom"); $this->check("xpath=//ul[@id='contactEditBlocks']//li/span[2]/label[text()='Open ID']/../input"); @@ -360,7 +366,10 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase { //Tags and Groups section $this->click("tagGroup"); - $this->click("group[{$this->webtestGetValidEntityID('Group')}]"); + + // select group + $this->select("crmasmSelect0", "label=$groupName"); + $this->click("tag[{$this->webtestGetValidEntityID('Tag')}]"); // Clicking save. -- 2.25.1