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="AddJapaneseAnnouncementsTest.java.html"><b><i>View Source</i></b></a>
027: *
028: * @author Brian Wing Shun Chan
029: *
030: */
031: public class AddJapaneseAnnouncementsTest extends BaseTestCase {
032: public void testAddJapaneseAnnouncements() throws Exception {
033: selenium.click("//img[@title='Configuraci\u00f3n']");
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=\u4e2d\u6587 (\u53f0\u7063)");
054: selenium.type("_86_content",
055: "This is a test announcement in \u65e5\u672c\u8a9e !");
056:
057: for (int second = 0;; second++) {
058: if (second >= 60) {
059: fail("timeout");
060: }
061:
062: try {
063: if (selenium
064: .isElementPresent("//input[@value='Guardar']")) {
065: break;
066: }
067: } catch (Exception e) {
068: }
069:
070: Thread.sleep(1000);
071: }
072:
073: Thread.sleep(3000);
074: selenium.click("//input[@value='Guardar']");
075: selenium.waitForPageToLoad("30000");
076: selenium.click("link=Mi cuenta");
077: selenium.waitForPageToLoad("30000");
078: selenium.select("_2_languageId",
079: "label=\u4e2d\u6587 (\u53f0\u7063)");
080:
081: for (int second = 0;; second++) {
082: if (second >= 60) {
083: fail("timeout");
084: }
085:
086: try {
087: if (selenium
088: .isElementPresent("//input[@value='Guardar']")) {
089: break;
090: }
091: } catch (Exception e) {
092: }
093:
094: Thread.sleep(1000);
095: }
096:
097: Thread.sleep(3000);
098: selenium.click("//input[@value='Guardar']");
099: selenium.waitForPageToLoad("30000");
100: selenium.click("link=Announcements Test Page");
101: selenium.waitForPageToLoad("30000");
102: verifyTrue(selenium.isTextPresent(""));
103: }
104: }
|