From 89d6437d3c61587c20de30ded094c327bd3f7116 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Fri, 26 Sep 2014 14:20:12 +0530 Subject: [PATCH] webtest for CRM-15368 --- tests/phpunit/WebTest/Profile/SearchTest.php | 23 ++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/phpunit/WebTest/Profile/SearchTest.php b/tests/phpunit/WebTest/Profile/SearchTest.php index d674e965a8..109e62fc74 100644 --- a/tests/phpunit/WebTest/Profile/SearchTest.php +++ b/tests/phpunit/WebTest/Profile/SearchTest.php @@ -149,12 +149,23 @@ class WebTest_Profile_SearchTest extends CiviSeleniumTestCase { $this->click('is_searchable'); $this->click('in_selector'); + // click on save and new + $this->clickLink('_qf_Field_next_new-bottom', 'field_name[0]', FALSE); + $this->waitForElementPresent("xpath=//select[@id='field_name_1'][@style='display: none;']"); + + $this->select('field_name[0]', 'value=Individual'); + $this->select('field_name[1]', 'value=current_employer'); + $this->select('visibility', 'value=Public Pages and Listings'); + $this->click('is_searchable'); + $this->click('in_selector'); + // click on save $this->clickLink('_qf_Field_next-bottom', "xpath=//div[@id='field_page']/div[1]/a[4]/span[text()='Use (create mode)']", FALSE); $uselink = explode('?', $this->getAttribute("xpath=//*[@id='field_page']/div[1]/a[4]@href")); $this->openCiviPage('profile/create', "$uselink[1]", '_qf_Edit_next'); $lastName = substr(sha1(rand()), 0, 7); + $orgName = 'Organisation'.substr(sha1(rand()), 0, 7); // Fill Last Name $this->type('last_name', $lastName); @@ -174,6 +185,8 @@ class WebTest_Profile_SearchTest extends CiviSeleniumTestCase { $this->waitForElementPresent("xpath=//select[@id='county-Primary']/option[text()='Alameda']"); $this->select('county-Primary', "Alameda"); + $this->type('current_employer', $orgName); + $this->clickLink('_qf_Edit_next', NULL); $this->assertElementContainsText("css=span.msg-text", 'Your information has been saved.'); @@ -212,6 +225,16 @@ class WebTest_Profile_SearchTest extends CiviSeleniumTestCase { $this->assertTrue($this->isElementPresent("xpath=//table/tbody/tr[2]/td[7][text()='CA']")); $this->assertTrue($this->isElementPresent("xpath=//table/tbody/tr[2]/td[8][text()='Alameda']")); + // verify if the organization has been created -- CRM-15368 + $this->click("css=input#sort_name_navigation"); + $this->type("css=input#sort_name_navigation", "$orgName"); + $this->typeKeys("css=input#sort_name_navigation", "$orgName"); + $this->waitForElementPresent("css=ul.ui-autocomplete li"); + + // visit contact summary page + $this->click("css=ul.ui-autocomplete li"); + $this->waitForPageToLoad($this->getTimeoutMsec()); + // Go back to Profile fields admin $this->openCiviPage('admin/uf/group/field', "reset=1&action=browse&gid=$profileId", "xpath=//table/tbody/tr[1]/td[9]"); -- 2.25.1