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.announcements;
022:
023: import com.liferay.portalweb.portal.BaseTestCase;
024:
025: /**
026: * <a href="AddSpanishAnnouncementsTest.java.html"><b><i>View Source</i></b></a>
027: *
028: * @author Brian Wing Shun Chan
029: *
030: */
031: public class AddSpanishAnnouncementsTest extends BaseTestCase {
032: public void testAddSpanishAnnouncements() throws Exception {
033: selenium.click("//img[@title='Configuration']");
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.isElementPresent("_86_languageId")) {
043: break;
044: }
045: } catch (Exception e) {
046: }
047:
048: Thread.sleep(1000);
049: }
050:
051: Thread.sleep(3000);
052: selenium.select("_86_languageId",
053: "label=espa\u00f1ol (Espa\u00f1a)");
054: selenium.type("_86_content",
055: "This is a test announcement in Espa\u00f1ol!");
056:
057: for (int second = 0;; second++) {
058: if (second >= 60) {
059: fail("timeout");
060: }
061:
062: try {
063: if (selenium.isElementPresent("//input[@value='Save']")) {
064: break;
065: }
066: } catch (Exception e) {
067: }
068:
069: Thread.sleep(1000);
070: }
071:
072: Thread.sleep(3000);
073: selenium.click("//input[@value='Save']");
074: selenium.waitForPageToLoad("30000");
075: selenium.click("link=My Account");
076: selenium.waitForPageToLoad("30000");
077: Thread.sleep(3000);
078: selenium.select("_2_languageId",
079: "label=espa\u00f1ol (Espa\u00f1a)");
080:
081: for (int second = 0;; second++) {
082: if (second >= 60) {
083: fail("timeout");
084: }
085:
086: try {
087: if (selenium.isElementPresent("//input[@value='Save']")) {
088: break;
089: }
090: } catch (Exception e) {
091: }
092:
093: Thread.sleep(1000);
094: }
095:
096: Thread.sleep(3000);
097: selenium.click("//input[@value='Save']");
098: selenium.waitForPageToLoad("30000");
099: selenium.click("link=Announcements Test Page");
100: selenium.waitForPageToLoad("30000");
101: verifyTrue(selenium.isTextPresent(""));
102: }
103: }
|