[kune-commits] r1538 - in trunk/src: main/java/cc/kune/chat/client main/java/cc/kune/common/client/actions/gwtui main/java/cc/kune/common/client/ui main/java/cc/kune/common/client/ui/dialogs main/java/cc/kune/core/client/auth main/java/cc/kune/core/client/groups/newgroup main/java/org/ourproject/kune/platf test/java/cc/kune test/java/cc/kune/selenium test/java/cc/kune/selenium/chat test/java/cc/kune/selenium/login test/java/org/ourproject/kune/platf

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Tue Sep 27 21:40:16 CEST 2011


Author: vjrj_
Date: 2011-09-27 21:40:16 +0200 (Tue, 27 Sep 2011)
New Revision: 1538

Added:
   trunk/src/test/java/cc/kune/selenium/chat/
   trunk/src/test/java/cc/kune/selenium/chat/ChatPageObject.java
   trunk/src/test/java/cc/kune/selenium/chat/ChatSeleniumTests.java
Removed:
   trunk/src/main/java/org/ourproject/kune/platf/client/
   trunk/src/test/java/cc/kune/tasks/
   trunk/src/test/java/org/ourproject/kune/platf/client/
Modified:
   trunk/src/main/java/cc/kune/chat/client/ChatClient.java
   trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java
   trunk/src/main/java/cc/kune/common/client/actions/gwtui/GwtIconLabelGui.java
   trunk/src/main/java/cc/kune/common/client/ui/IconLabel.java
   trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicTopDialog.java
   trunk/src/main/java/cc/kune/core/client/auth/Register.java
   trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java
   trunk/src/main/java/cc/kune/core/client/auth/SignInPanel.java
   trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPanel.java
   trunk/src/test/java/cc/kune/selenium/CustomWebDriverEventListener.java
   trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java
   trunk/src/test/java/cc/kune/selenium/PageObject.java
   trunk/src/test/java/cc/kune/selenium/SeleniumModule.java
   trunk/src/test/java/cc/kune/selenium/SeleniumUtils.java
   trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java
   trunk/src/test/java/cc/kune/selenium/login/RegisterPageObject.java
   trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java
Log:
NEW - # 53: Add Selenium Framework testing 
http://kune.ourproject.org/issues/ticket/53

Modified: trunk/src/main/java/cc/kune/chat/client/ChatClient.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatClient.java	2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/main/java/cc/kune/chat/client/ChatClient.java	2011-09-27 19:40:16 UTC (rev 1538)
@@ -23,40 +23,41 @@
 import com.calclab.emite.xep.muc.client.Room;
 
 public interface ChatClient {
+  public static final String CHAT_CLIENT_ICON_ID = "k-chat-icon-id";
 
-    void addNewBuddie(String shortName);
+  void addNewBuddie(String shortName);
 
-    void chat(String shortName);
+  void chat(String shortName);
 
-    void chat(XmppURI jid);
+  void chat(XmppURI jid);
 
-    void doLogin();
+  void doLogin();
 
-    boolean isBuddie(String shortName);
+  boolean isBuddie(String shortName);
 
-    boolean isBuddie(XmppURI jid);
+  boolean isBuddie(XmppURI jid);
 
-    boolean isLoggedIn();
+  boolean isLoggedIn();
 
-    Room joinRoom(String roomName, String userAlias);
+  Room joinRoom(String roomName, String userAlias);
 
-    Room joinRoom(String roomName, String subject, String userAlias);
+  Room joinRoom(String roomName, String subject, String userAlias);
 
-    void login(XmppURI uri, String passwd);
+  void login(XmppURI uri, String passwd);
 
-    /**
-     * @return true if loggin is needed
-     */
-    boolean loginIfNecessary();
+  /**
+   * @return true if loggin is needed
+   */
+  boolean loginIfNecessary();
 
-    void logout();
+  void logout();
 
-    XmppURI roomUriFrom(String shortName);
+  XmppURI roomUriFrom(String shortName);
 
-    void setAvatar(String photoBinary);
+  void setAvatar(String photoBinary);
 
-    void show();
+  void show();
 
-    XmppURI uriFrom(String shortName);
+  XmppURI uriFrom(String shortName);
 
 }

Modified: trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java	2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java	2011-09-27 19:40:16 UTC (rev 1538)
@@ -123,7 +123,6 @@
 
   }
 
-  protected static final String CHAT_CLIENT_ICON_ID = "k-chat-icon-id";
   private static final String CHAT_TITLE = "Chat ;)";
 
   private final ChatClientAction action;

Modified: trunk/src/main/java/cc/kune/common/client/actions/gwtui/GwtIconLabelGui.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/gwtui/GwtIconLabelGui.java	2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/main/java/cc/kune/common/client/actions/gwtui/GwtIconLabelGui.java	2011-09-27 19:40:16 UTC (rev 1538)
@@ -53,7 +53,7 @@
     descriptor.putValue(ParentWidget.PARENT_UI, this);
     final String id = descriptor.getId();
     if (id != null) {
-      iconLabel.ensureDebugId(id);
+      iconLabel.setId(id);
     }
     initWidget(iconLabel);
     iconLabel.getFocus().addClickHandler(new ClickHandler() {

Modified: trunk/src/main/java/cc/kune/common/client/ui/IconLabel.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/IconLabel.java	2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/main/java/cc/kune/common/client/ui/IconLabel.java	2011-09-27 19:40:16 UTC (rev 1538)
@@ -126,6 +126,10 @@
     return flow.remove(w);
   }
 
+  public void setId(final String id) {
+    self.ensureDebugId(id);
+  }
+
   public void setLabelText(final String text) {
     label.setText(text);
   }

Modified: trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicTopDialog.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicTopDialog.java	2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicTopDialog.java	2011-09-27 19:40:16 UTC (rev 1538)
@@ -19,6 +19,7 @@
  */
 package cc.kune.common.client.ui.dialogs;
 
+import cc.kune.common.client.tooltip.Tooltip;
 import cc.kune.common.client.ui.PopupTopPanel;
 import cc.kune.common.client.utils.TextUtils;
 
@@ -252,6 +253,7 @@
   }
 
   public void showCentered() {
+    Tooltip.hideCurrent();
     popup.showCentered();
   }
 

Modified: trunk/src/main/java/cc/kune/core/client/auth/Register.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/Register.java	2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/main/java/cc/kune/core/client/auth/Register.java	2011-09-27 19:40:16 UTC (rev 1538)
@@ -19,11 +19,12 @@
  */
 package cc.kune.core.client.auth;
 
-
 public interface Register {
 
-    void doRegister();
+  String WELCOME_ID = "k-user-reg-welcome-msg-id";
 
-    void hide();
+  void doRegister();
 
+  void hide();
+
 }

Modified: trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java	2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java	2011-09-27 19:40:16 UTC (rev 1538)
@@ -31,7 +31,6 @@
 import cc.kune.core.client.errors.UserRegistrationException;
 import cc.kune.core.client.events.NewUserRegisteredEvent;
 import cc.kune.core.client.i18n.I18nUITranslationService;
-import cc.kune.core.client.notify.msgs.UserNotifyEvent;
 import cc.kune.core.client.resources.CoreMessages;
 import cc.kune.core.client.rpcservices.UserServiceAsync;
 import cc.kune.core.client.state.Session;
@@ -213,26 +212,22 @@
         }
 
         private void showWelcolmeDialog() {
-          getEventBus().fireEvent(
-              new UserNotifyEvent(
-                  NotifyLevel.info,
-                  i18n.t("Welcome"),
-                  i18n.t("Thanks for joining this site. "
-                      + "Now you can actively participate in this site. "
-                      + "You can also use your personal space to publish contents. "
-                      + "Note: your email is not verified, please follow the instructions you will receive by email."),
-                  true));
+          NotifyUser.info(
+              i18n.t("Welcome"),
+              i18n.t("Thanks for joining this site. "
+                  + "Now you can actively participate in this site. "
+                  + "You can also use your personal space to publish contents. "
+                  + "Note: your email is not verified, please follow the instructions you will receive by email."),
+              Register.WELCOME_ID, true);
         }
 
         private void showWelcolmeDialogNoHomepage() {
-          getEventBus().fireEvent(
-              new UserNotifyEvent(
-                  NotifyLevel.info,
-                  i18n.t("Welcome"),
-                  i18n.t("Thanks for joining this site"
-                      + "Now you can actively participate in this site. "
-                      + "Note: your email is not verified, please follow the instructions you will receive by email."),
-                  true));
+          NotifyUser.info(
+              i18n.t("Welcome"),
+              i18n.t("Thanks for joining this site"
+                  + "Now you can actively participate in this site. "
+                  + "Note: your email is not verified, please follow the instructions you will receive by email."),
+              Register.WELCOME_ID, true);
         }
       };
       userServiceProvider.get().createUser(user, wantHomepage, callback);

Modified: trunk/src/main/java/cc/kune/core/client/auth/SignInPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/SignInPanel.java	2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/main/java/cc/kune/core/client/auth/SignInPanel.java	2011-09-27 19:40:16 UTC (rev 1538)
@@ -20,7 +20,6 @@
 package cc.kune.core.client.auth;
 
 import cc.kune.common.client.notify.NotifyLevelImages;
-import cc.kune.common.client.tooltip.Tooltip;
 import cc.kune.common.client.ui.MaskWidgetView;
 import cc.kune.common.client.ui.dialogs.MessageToolbar;
 import cc.kune.common.client.utils.OnAcceptCallback;
@@ -133,7 +132,6 @@
   @Override
   public void show() {
     super.show();
-    Tooltip.hideCurrent();
     KuneUiUtils.focusOnField(getNickname());
   }
 

Modified: trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPanel.java	2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPanel.java	2011-09-27 19:40:16 UTC (rev 1538)
@@ -21,7 +21,6 @@
 
 import cc.kune.common.client.notify.NotifyLevel;
 import cc.kune.common.client.notify.NotifyLevelImages;
-import cc.kune.common.client.tooltip.Tooltip;
 import cc.kune.common.client.ui.MaskWidgetView;
 import cc.kune.common.client.ui.dialogs.BasicTopDialog;
 import cc.kune.common.client.ui.dialogs.BasicTopDialog.Builder;
@@ -296,7 +295,6 @@
 
   @Override
   public void show() {
-    Tooltip.hideCurrent();
     dialog.showCentered();
   }
 

Modified: trunk/src/test/java/cc/kune/selenium/CustomWebDriverEventListener.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/CustomWebDriverEventListener.java	2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/test/java/cc/kune/selenium/CustomWebDriverEventListener.java	2011-09-27 19:40:16 UTC (rev 1538)
@@ -46,6 +46,7 @@
 
   @Override
   public void beforeClickOn(final WebElement element, final WebDriver driver) {
+    SeleniumUtils.hightlight(element, driver);
     slow();
   }
 

Modified: trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java	2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java	2011-09-27 19:40:16 UTC (rev 1538)
@@ -35,6 +35,7 @@
 import cc.kune.core.client.state.TokenUtils;
 import cc.kune.core.client.sub.SubtitlesWidget;
 import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.selenium.chat.ChatPageObject;
 import cc.kune.selenium.login.EntityHeaderPageObject;
 import cc.kune.selenium.login.LoginPageObject;
 import cc.kune.selenium.login.RegisterPageObject;
@@ -47,6 +48,7 @@
   private static final Log LOG = LogFactory.getLog(KuneSeleniumDefaults.class);
   public static boolean mustCloseFinally = false;
   private final String baseUrl;
+  protected final ChatPageObject chat;
   protected final EntityHeaderPageObject entityHeader;
   private final Injector injector;
   protected LoginPageObject login;
@@ -61,10 +63,12 @@
     login = injector.getInstance(LoginPageObject.class);
     register = injector.getInstance(RegisterPageObject.class);
     entityHeader = injector.getInstance(EntityHeaderPageObject.class);
+    chat = injector.getInstance(ChatPageObject.class);
     final ElementLocatorFactory locator = injector.getInstance(ElementLocatorFactory.class);
     PageFactory.initElements(locator, login);
     PageFactory.initElements(locator, register);
     PageFactory.initElements(locator, entityHeader);
+    PageFactory.initElements(locator, chat);
   }
 
   @BeforeSuite

Modified: trunk/src/test/java/cc/kune/selenium/PageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/PageObject.java	2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/test/java/cc/kune/selenium/PageObject.java	2011-09-27 19:40:16 UTC (rev 1538)
@@ -25,7 +25,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.openqa.selenium.By;
-import org.openqa.selenium.JavascriptExecutor;
 import org.openqa.selenium.Keys;
 import org.openqa.selenium.NoSuchElementException;
 import org.openqa.selenium.WebDriver;
@@ -87,12 +86,14 @@
   }
 
   public void hightlight(final WebElement element) {
-    final JavascriptExecutor js = (JavascriptExecutor) webdriver;
-    final String script = "window.jQuery('#" + element.getAttribute("id") + "').addClass('k-outline');"
-        + "setTimeout('window.jQuery(\"#" + element.getAttribute("id")
-        + "\").removeClass(\"k-outline\")', 700);";
-    // LOG.info("High: " + script);
-    js.executeScript(script);
+    SeleniumUtils.hightlight(element, webdriver);
+    // final JavascriptExecutor js = (JavascriptExecutor) webdriver;
+    // final String script = "window.jQuery('#" + element.getAttribute("id") +
+    // "').addClass('k-outline');"
+    // + "setTimeout('window.jQuery(\"#" + element.getAttribute("id")
+    // + "\").removeClass(\"k-outline\")', 700);";
+    // // LOG.info("High: " + script);
+    // js.executeScript(script);
   }
 
   public boolean isElementPresent(final String id) {

Modified: trunk/src/test/java/cc/kune/selenium/SeleniumModule.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/SeleniumModule.java	2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/test/java/cc/kune/selenium/SeleniumModule.java	2011-09-27 19:40:16 UTC (rev 1538)
@@ -32,6 +32,7 @@
 import org.openqa.selenium.support.pagefactory.AjaxElementLocatorFactory;
 import org.openqa.selenium.support.pagefactory.ElementLocatorFactory;
 
+import cc.kune.selenium.chat.ChatPageObject;
 import cc.kune.selenium.login.EntityHeaderPageObject;
 import cc.kune.selenium.login.LoginPageObject;
 import cc.kune.selenium.login.RegisterPageObject;
@@ -60,6 +61,7 @@
     bind(LoginPageObject.class).in(Singleton.class);
     bind(RegisterPageObject.class).in(Singleton.class);
     bind(EntityHeaderPageObject.class).in(Singleton.class);
+    bind(ChatPageObject.class).in(Singleton.class);
   }
 
   @SuppressWarnings("unused")

Modified: trunk/src/test/java/cc/kune/selenium/SeleniumUtils.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/SeleniumUtils.java	2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/test/java/cc/kune/selenium/SeleniumUtils.java	2011-09-27 19:40:16 UTC (rev 1538)
@@ -1,9 +1,21 @@
 package cc.kune.selenium;
 
+import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
 import org.testng.Assert;
 
 public class SeleniumUtils {
 
+  public static void hightlight(final WebElement element, final WebDriver webdriver) {
+    final JavascriptExecutor js = (JavascriptExecutor) webdriver;
+    final String script = "window.jQuery('#" + element.getAttribute("id") + "').addClass('k-outline');"
+        + "setTimeout('window.jQuery(\"#" + element.getAttribute("id")
+        + "\").removeClass(\"k-outline\")', 700);";
+    // LOG.info("High: " + script);
+    js.executeScript(script);
+  }
+
   public static void sleep(final int milliseconds) {
     try {
       Thread.sleep(milliseconds);

Added: trunk/src/test/java/cc/kune/selenium/chat/ChatPageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/chat/ChatPageObject.java	                        (rev 0)
+++ trunk/src/test/java/cc/kune/selenium/chat/ChatPageObject.java	2011-09-27 19:40:16 UTC (rev 1538)
@@ -0,0 +1,89 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.selenium.chat;
+
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.ByIdOrName;
+import org.openqa.selenium.support.FindBy;
+
+import cc.kune.chat.client.ChatClient;
+import cc.kune.selenium.PageObject;
+import cc.kune.selenium.tools.SeleniumConstants;
+
+import com.calclab.emite.core.client.xmpp.stanzas.XmppURI;
+import com.calclab.hablar.core.client.Idify;
+
+public class ChatPageObject extends PageObject {
+
+  public static final String DEF_TESTING_USER = "some.testing.user at gmail.com";
+  @FindBy(id = SeleniumConstants.GWTDEV + "OpenChatWidget-addToRoster" + SeleniumConstants.INPUT)
+  private WebElement addToRoster;
+  @FindBy(id = SeleniumConstants.GWTDEV + ChatClient.CHAT_CLIENT_ICON_ID)
+  private WebElement chatIcon;
+  @FindBy(id = SeleniumConstants.GWTDEV + "OpenChatWidget-jabberId")
+  private WebElement jid;
+  @FindBy(id = SeleniumConstants.GWTDEV + "HablarOpenChat-openAction")
+  private WebElement openChat;
+  @FindBy(id = SeleniumConstants.GWTDEV + "OpenChatWidget-open")
+  private WebElement openChatBtn;
+
+  // Duplicate in Hablar (we need a common PageObject)
+  public WebElement getHeader(final String uri) {
+    final String pageId = Idify.uriId(uri);
+    final String headerId = "gwt-debug-HeaderWidget-Chat-" + pageId;
+    return findElement(new ByIdOrName(headerId));
+  }
+
+  public WebElement getList(final String uri) {
+    final String pageId = Idify.uriId(uri);
+    final String id = "gwt-debug-ChatWidget-list-Chat-" + pageId;
+    return findElement(new ByIdOrName(id));
+  }
+
+  public WebElement getPage(final String uri) {
+    final String pageId = Idify.uriId(uri);
+    final String headerId = "gwt-debug-ChatWidget-Chat-" + pageId;
+    return findElement(new ByIdOrName(headerId));
+  }
+
+  public WebElement getSend(final String uri) {
+    final String pageId = Idify.uriId(uri);
+    final String id = "gwt-debug-ChatWidget-send-Chat-" + pageId;
+    return findElement(new ByIdOrName(id));
+  }
+
+  public WebElement getTalkBox(final String uri) {
+    final String pageId = Idify.uriId(uri);
+    final String id = "gwt-debug-ChatWidget-talkBox-Chat-" + pageId;
+    return findElement(new ByIdOrName(id));
+  }
+
+  public void openChat(final XmppURI uri) {
+    openChat.click();
+    jid.sendKeys(uri.toString());
+    addToRoster.click();
+    openChatBtn.click();
+  }
+
+  public void show() {
+    chatIcon.click();
+  }
+
+}

Added: trunk/src/test/java/cc/kune/selenium/chat/ChatSeleniumTests.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/chat/ChatSeleniumTests.java	                        (rev 0)
+++ trunk/src/test/java/cc/kune/selenium/chat/ChatSeleniumTests.java	2011-09-27 19:40:16 UTC (rev 1538)
@@ -0,0 +1,46 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.selenium.chat;
+
+import org.testng.annotations.Test;
+
+import cc.kune.selenium.KuneSeleniumTest;
+
+import com.calclab.emite.core.client.xmpp.stanzas.XmppURI;
+
+public class ChatSeleniumTests extends KuneSeleniumTest {
+
+  @Test
+  public void basicChat() {
+    // 15 chars, the limit, so we don't use shortName
+    login();
+    showSubtitle("Chat with your buddies", "compatible with gmail and similars");
+    chat.show();
+    final XmppURI jid = XmppURI.jid(ChatPageObject.DEF_TESTING_USER);
+    final String jids = jid.toString();
+    chat.openChat(jid);
+    // chat.getPage(jids).click();
+    chat.getTalkBox(jids).sendKeys("Helloo... ;)");
+    chat.getSend(jids).click();
+    chat.getTalkBox(jids).sendKeys("I'm just testing");
+    chat.getSend(jids).click();
+  }
+
+}

Modified: trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java	2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java	2011-09-27 19:40:16 UTC (rev 1538)
@@ -47,9 +47,9 @@
 
   public void createOne() {
     assertIsDisconnected();
-    hightlight(signInLink);
+    // hightlight(signInLink);
     signInLink.click();
-    hightlight(createOneLink);
+    // hightlight(createOneLink);
     createOneLink.click();
   }
 
@@ -60,7 +60,7 @@
     clearField(passwd);
     hightlight(passwd);
     passwd.sendKeys(password);
-    hightlight(signInButton);
+    // hightlight(signInButton);
     if (withReturn) {
       passwd.sendKeys(Keys.RETURN);
     } else {
@@ -90,7 +90,7 @@
 
   public void signIn(final String username, final String password, final boolean withReturn) {
     assertIsDisconnected();
-    hightlight(signInLink);
+    // hightlight(signInLink);
     moveMouseTo(signInLink);
     signInLink.click();
     fillSigInInForm(username, password, withReturn);

Modified: trunk/src/test/java/cc/kune/selenium/login/RegisterPageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/RegisterPageObject.java	2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/test/java/cc/kune/selenium/login/RegisterPageObject.java	2011-09-27 19:40:16 UTC (rev 1538)
@@ -23,6 +23,7 @@
 import org.openqa.selenium.WebElement;
 import org.openqa.selenium.support.FindBy;
 
+import cc.kune.core.client.auth.Register;
 import cc.kune.core.client.auth.RegisterForm;
 import cc.kune.core.client.auth.RegisterPanel;
 import cc.kune.selenium.tools.SeleniumConstants;
@@ -39,6 +40,8 @@
   private WebElement registerButton;
   @FindBy(id = RegisterForm.NICK_FIELD + SeleniumConstants.INPUT)
   private WebElement shortName;
+  @FindBy(id = SeleniumConstants.GWTDEV + Register.WELCOME_ID)
+  private WebElement welcome;
 
   public RegisterPageObject() {
     // i18n = new I18nHelper(LoginMessages.class);
@@ -66,4 +69,8 @@
     }
   }
 
+  public WebElement getWelcomeMsg() {
+    return welcome;
+  }
+
 }

Modified: trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java	2011-09-27 13:13:59 UTC (rev 1537)
+++ trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java	2011-09-27 19:40:16 UTC (rev 1538)
@@ -30,15 +30,17 @@
       final String email) {
     // 15 chars, the limit, so we don't use shortName
     final String prefix = getTempString();
-    showSubtitle("User registration", "to get full access to this site");
+    showSubtitle("User registration", "to get full access to this site tools/contents");
     login.createOne();
     register.fillRegisterForm(prefix, prefix + longName, passwd, prefix + email, false);
     login.assertIsConnectedAs(prefix);
     sleep(1000);
     entityHeader.waitForEntityTitle(prefix + longName);
-    login.logout();
+    register.getWelcomeMsg().click();
+    chat.show();
+    sleep(3000);
+    // login.logout();
   }
-
   // @Test(dataProvider = "correctlogin")
   // public void signIn(final String user, final String passwd) {
   // login.assertIsDisconnected();




More information about the kune-commits mailing list