001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portalweb.portlet.directory;
022:
023: import com.liferay.portalweb.portal.BaseTestCase;
024:
025: /**
026: * <a href="SearchOrganizationsTest.java.html"><b><i>View Source</i></b></a>
027: *
028: * @author Brian Wing Shun Chan
029: *
030: */
031: public class SearchOrganizationsTest extends BaseTestCase {
032: public void testSearchOrganizations() throws Exception {
033: selenium.click("link=Organizations");
034: selenium.waitForPageToLoad("30000");
035:
036: for (int second = 0;; second++) {
037: if (second >= 60) {
038: fail("timeout");
039: }
040:
041: try {
042: if (selenium
043: .isElementPresent("toggle_id_enterprise_admin_organization_searchkeywords")) {
044: break;
045: }
046: } catch (Exception e) {
047: }
048:
049: Thread.sleep(1000);
050: }
051:
052: selenium
053: .type(
054: "toggle_id_enterprise_admin_organization_searchkeywords",
055: "Los Angeles");
056: selenium.click("//input[@value='Search Organizations']");
057: selenium.waitForPageToLoad("30000");
058:
059: for (int second = 0;; second++) {
060: if (second >= 60) {
061: fail("timeout");
062: }
063:
064: try {
065: if (selenium
066: .isElementPresent("link=Liferay Los Angeles")) {
067: break;
068: }
069: } catch (Exception e) {
070: }
071:
072: Thread.sleep(1000);
073: }
074:
075: selenium.click("link=Liferay Los Angeles");
076: selenium.waitForPageToLoad("30000");
077:
078: for (int second = 0;; second++) {
079: if (second >= 60) {
080: fail("timeout");
081: }
082:
083: try {
084: if (selenium.isElementPresent("_11_name")) {
085: break;
086: }
087: } catch (Exception e) {
088: }
089:
090: Thread.sleep(1000);
091: }
092:
093: selenium.click("link=Return to Full Page");
094: selenium.waitForPageToLoad("30000");
095:
096: for (int second = 0;; second++) {
097: if (second >= 60) {
098: fail("timeout");
099: }
100:
101: try {
102: if (selenium
103: .isElementPresent("toggle_id_enterprise_admin_user_searchkeywords")) {
104: break;
105: }
106: } catch (Exception e) {
107: }
108:
109: Thread.sleep(1000);
110: }
111: }
112: }
|