r1596 - in trunk/src: main/java/cc/kune/core/client/i18n main/resources test/java/cc/kune/selenium test/java/cc/kune/selenium/chat test/java/cc/kune/selenium/general test/java/cc/kune/selenium/login test/java/cc/kune/selenium/spaces
Author: vjrj_ Date: 2011-11-09 03:39:48 +0100 (Wed, 09 Nov 2011) New Revision: 1596 Added: trunk/src/test/java/cc/kune/selenium/spaces/ trunk/src/test/java/cc/kune/selenium/spaces/GroupSpacePageObject.java trunk/src/test/java/cc/kune/selenium/spaces/HomeSpacePageObject.java trunk/src/test/java/cc/kune/selenium/spaces/SpacesPageObject.java Removed: trunk/src/test/java/cc/kune/selenium/general/SpacesPageObject.java trunk/src/test/java/cc/kune/selenium/userspace/ Modified: trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java trunk/src/main/resources/TestConstants_en.properties trunk/src/main/resources/TestConstants_es.properties trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java trunk/src/test/java/cc/kune/selenium/SeleniumModule.java trunk/src/test/java/cc/kune/selenium/chat/ChatPageObject.java trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java trunk/src/test/java/cc/kune/selenium/spaces/UserSpacePageObject.java Log: NEW - # 127: Generate some screencast while doing automate testing http://kune.ourproject.org/issues/ticket/127 Modified: trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java =================================================================== --- trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java 2011-11-08 15:03:19 UTC (rev 1595) +++ trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java 2011-11-09 02:39:48 UTC (rev 1596) @@ -19,11 +19,12 @@ */ package cc.kune.core.client.i18n; -import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.HashMap; +import java.util.HashSet; import java.util.MissingResourceException; +import java.util.Set; import cc.kune.common.client.log.Log; import cc.kune.common.client.utils.Location; @@ -32,6 +33,8 @@ import cc.kune.common.client.utils.WindowUtils; import cc.kune.core.client.rpcservices.I18nServiceAsync; import cc.kune.core.client.state.Session; +import cc.kune.core.client.state.UserSignInEvent; +import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler; import cc.kune.core.shared.dto.I18nLanguageDTO; import cc.kune.core.shared.i18n.I18nTranslationService; @@ -47,7 +50,7 @@ public class I18nUITranslationService extends I18nTranslationService { private I18nLanguageDTO currentLang; private String currentLanguageCode; - private final ArrayList<Pair<String, String>> earlyTexts; + private final Set<Pair<String, String>> earlyTexts; private final I18nServiceAsync i18nService; private final KuneConstants kuneConstants; private HashMap<String, String> lexicon; @@ -67,7 +70,7 @@ + LocaleInfo.getCurrentLocale().isRTL() + ", translated langs: " + Arrays.toString(LocaleInfo.getAvailableLocaleNames())); - earlyTexts = new ArrayList<Pair<String, String>>(); + earlyTexts = new HashSet<Pair<String, String>>(); i18nService.getInitialLanguage(locale, new AsyncCallback<I18nLanguageDTO>() { @Override @@ -92,14 +95,18 @@ session.setCurrentLanguage(currentLang); Log.info("Workspace adaptation to language: " + currentLang.getEnglishName()); eventBus.fireEvent(new I18nReadyEvent()); + } + }); + session.onUserSignIn(true, new UserSignInHandler() { + @Override + public void onUserSignIn(final UserSignInEvent event) { Scheduler.get().scheduleIncremental(new RepeatingCommand() { - @Override public boolean execute() { if (!earlyTexts.isEmpty()) { - final Pair<String, String> pair = earlyTexts.get(0); + final Pair<String, String> pair = earlyTexts.iterator().next(); save(pair.getLeft(), pair.getRight()); - earlyTexts.remove(0); + earlyTexts.remove(pair); } return !earlyTexts.isEmpty(); } @@ -243,6 +250,7 @@ if (lexicon == null) { Log.warn("i18n not initialized: " + text); earlyTexts.add(Pair.create(text, noteForTranslators)); + Log.warn("i18n pending translations: " + earlyTexts.size()); return text; } String translation = lexicon.get(encodeText); @@ -255,8 +263,9 @@ // Not translated and not in db, make a petition for translation if (session.isLogged()) { save(text, noteForTranslators); - lexicon.put(encodeText, UNTRANSLATED_VALUE); + } else { + earlyTexts.add(Pair.create(text, noteForTranslators)); } translation = encodeText; } Modified: trunk/src/main/resources/TestConstants_en.properties =================================================================== --- trunk/src/main/resources/TestConstants_en.properties 2011-11-08 15:03:19 UTC (rev 1595) +++ trunk/src/main/resources/TestConstants_en.properties 2011-11-09 02:39:48 UTC (rev 1596) @@ -19,4 +19,21 @@ iMJustTesting = I'm just testing youCanSeeThisLikeAnAdvancedEmailSystem = You can see this like an advanced email system... whereYouCanComposePersonalMessages = where you can compose personal messages... -butAlsoCreateContentsToPublishLater = but also create contents to publish later \ No newline at end of file +butAlsoCreateContentsToPublishLater = but also create contents to publish later +homeSpaceYourWelcomePage = Home space (your welcome page) +hereYouCanSeeASummaryOfYourActivityInThisSite = Here you can see a summary of the activity in this site +congratulationsForYourReport = Congratulations for your report\n\n +hiThereJustToSayThatILike = Hi there, Just to say that I like +aLotYourLastReport = a lot your last report\n\n +bestJane = Best\n\nJane\n +andYouCanChatEventWhileGoingBackForwardWithYourBrowser = And you can chat event while going back/forward with your browser +laLaLa = la la la +browserHistoryBack = Browser history back +iCanContinueChatSmoothly = I can continue chat smoothly ;) +browserHistoryForward = Browser history forward +goodbye = goodbye! +jane = jane +janeDoe = Jane Doe +janeexampleOrg = [email protected] +thankYou = Thank you +andYesFeedbackWelcome = and yes, feedback welcome \ No newline at end of file Modified: trunk/src/main/resources/TestConstants_es.properties =================================================================== --- trunk/src/main/resources/TestConstants_es.properties 2011-11-08 15:03:19 UTC (rev 1595) +++ trunk/src/main/resources/TestConstants_es.properties 2011-11-09 02:39:48 UTC (rev 1596) @@ -13,4 +13,21 @@ iMJustTesting = Solo estoy probando youCanSeeThisLikeAnAdvancedEmailSystem = Puedes ver esto como un sistema avanzado de correo... whereYouCanComposePersonalMessages = donde puedes escribir mensajes personales... -butAlsoCreateContentsToPublishLater = pero tambi�n crear contenidos para publicarlos luego \ No newline at end of file +butAlsoCreateContentsToPublishLater = pero tambi�n crear contenidos para publicarlos luego +homeSpaceYourWelcomePage = Espacio Inicial (tu p�gina de bienvenida) +hereYouCanSeeASummaryOfYourActivityInThisSite = Aqu� puedes ver un resumen de la actividad en este sitio +congratulationsForYourReport = Enhorabuena por tu informe\n\n +hiThereJustToSayThatILike = Muy buenas,\n\nSolo quer�a decir que me gust� +aLotYourLastReport = \smucho tu informe\n\n +bestJane = Atentamente\n\nRuth\n +andYouCanChatEventWhileGoingBackForwardWithYourBrowser = Y puedes chatear mientras le das atr�s y adelante al historial tu navegador +laLaLa = la la la +browserHistoryBack = Voy con el navegador hacia atr�s +iCanContinueChatSmoothly = puedo continuar chateando sin problemas ;) +browserHistoryForward = Voy con el navegador hacia delante +goodbye = �adios! +jane = ruth +janeDoe = Ruth Mengana +janeexampleOrg = [email protected] +thankYou = Gracias +andYesFeedbackWelcome = y s�, feedback bienvenido \ No newline at end of file Modified: trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java =================================================================== --- trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java 2011-11-08 15:03:19 UTC (rev 1595) +++ trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java 2011-11-09 02:39:48 UTC (rev 1596) @@ -42,11 +42,13 @@ import cc.kune.core.shared.domain.utils.StateToken; import cc.kune.selenium.chat.ChatPageObject; import cc.kune.selenium.general.EntityHeaderPageObject; -import cc.kune.selenium.general.SpacesPageObject; import cc.kune.selenium.login.LoginPageObject; import cc.kune.selenium.login.RegisterPageObject; +import cc.kune.selenium.spaces.GroupSpacePageObject; +import cc.kune.selenium.spaces.HomeSpacePageObject; +import cc.kune.selenium.spaces.SpacesPageObject; +import cc.kune.selenium.spaces.UserSpacePageObject; import cc.kune.selenium.tools.SeleniumConstants; -import cc.kune.selenium.userspace.UserSpacePageObject; import com.google.inject.Guice; import com.google.inject.Injector; @@ -60,6 +62,8 @@ private final String baseUrl; protected final ChatPageObject chat; protected final EntityHeaderPageObject entityHeader; + protected final GroupSpacePageObject groupSpace; + protected final HomeSpacePageObject homeSpace; private final Injector injector; protected LoginPageObject login; private final ResourceBundle messages; @@ -80,7 +84,9 @@ entityHeader = injector.getInstance(EntityHeaderPageObject.class); spaces = injector.getInstance(SpacesPageObject.class); chat = injector.getInstance(ChatPageObject.class); + homeSpace = injector.getInstance(HomeSpacePageObject.class); userSpace = injector.getInstance(UserSpacePageObject.class); + groupSpace = injector.getInstance(GroupSpacePageObject.class); messages = injector.getInstance(ResourceBundle.class); final ElementLocatorFactory locator = injector.getInstance(ElementLocatorFactory.class); PageFactory.initElements(locator, login); @@ -88,7 +94,9 @@ PageFactory.initElements(locator, entityHeader); PageFactory.initElements(locator, spaces); PageFactory.initElements(locator, chat); + PageFactory.initElements(locator, homeSpace); PageFactory.initElements(locator, userSpace); + PageFactory.initElements(locator, groupSpace); } @BeforeMethod @@ -101,9 +109,19 @@ resize(); SeleniumUtils.initCursor(webdriver); SeleniumUtils.showCursor(webdriver); + SeleniumUtils.showCursor(webdriver, login.getAnonMsg()); + sleep(1000); login.getAnonMsg().click(); } + public void browserBack() { + webdriver.navigate().back(); + } + + public void browserForward() { + webdriver.navigate().forward(); + } + public void close() { webdriver.close(); } @@ -125,7 +143,7 @@ @DataProvider(name = "correctregister") public Object[][] createCorrectRegister() { // The default correct user/password used in tests - return new Object[][] { { "jane", "Jane Doe", SeleniumConstants.USER_PASSWD, "[email protected]" } }; + return new Object[][] { { "jane", "Jane Doe", SeleniumConstants.USER_PASSWD, "[email protected]" } }; } @DataProvider(name = "incorrectlogin") Modified: trunk/src/test/java/cc/kune/selenium/SeleniumModule.java =================================================================== --- trunk/src/test/java/cc/kune/selenium/SeleniumModule.java 2011-11-08 15:03:19 UTC (rev 1595) +++ trunk/src/test/java/cc/kune/selenium/SeleniumModule.java 2011-11-09 02:39:48 UTC (rev 1596) @@ -36,9 +36,9 @@ import cc.kune.selenium.chat.ChatPageObject; import cc.kune.selenium.general.EntityHeaderPageObject; -import cc.kune.selenium.general.SpacesPageObject; import cc.kune.selenium.login.LoginPageObject; import cc.kune.selenium.login.RegisterPageObject; +import cc.kune.selenium.spaces.SpacesPageObject; import cc.kune.selenium.tools.SeleniumConstants; import com.google.inject.Singleton; Modified: trunk/src/test/java/cc/kune/selenium/chat/ChatPageObject.java =================================================================== --- trunk/src/test/java/cc/kune/selenium/chat/ChatPageObject.java 2011-11-08 15:03:19 UTC (rev 1595) +++ trunk/src/test/java/cc/kune/selenium/chat/ChatPageObject.java 2011-11-09 02:39:48 UTC (rev 1596) @@ -37,6 +37,8 @@ private WebElement addToRoster; @FindBy(id = SeleniumConstants.GWTDEV + ChatClient.CHAT_CLIENT_ICON_ID) private WebElement chatIcon; + @FindBy(xpath = "//div[14]/div/div/div/div/div/table/tbody/tr/td[2]/div") + private WebElement closeChat; @FindBy(id = SeleniumConstants.GWTDEV + "OpenChatWidget-jabberId") private WebElement jid; @FindBy(id = SeleniumConstants.GWTDEV + "HablarOpenChat-openAction") @@ -44,6 +46,10 @@ @FindBy(id = SeleniumConstants.GWTDEV + "OpenChatWidget-open") private WebElement openChatBtn; + public void close() { + closeChat.click(); + } + // Duplicate in Hablar (we need a common PageObject) public WebElement getHeader(final String uri) { final String pageId = Idify.uriId(uri); @@ -80,17 +86,16 @@ } public void openChat(final XmppURI uri) { - hightlight(openChat); + // hightlight(openChat); openChat.click(); jid.sendKeys(uri.toString()); - hightlight(addToRoster); + // hightlight(addToRoster); addToRoster.click(); - hightlight(openChatBtn); + // hightlight(openChatBtn); openChatBtn.click(); } public void show() { - hightlight(chatIcon); chatIcon.click(); } Deleted: trunk/src/test/java/cc/kune/selenium/general/SpacesPageObject.java =================================================================== --- trunk/src/test/java/cc/kune/selenium/general/SpacesPageObject.java 2011-11-08 15:03:19 UTC (rev 1595) +++ trunk/src/test/java/cc/kune/selenium/general/SpacesPageObject.java 2011-11-09 02:39:48 UTC (rev 1596) @@ -1,59 +0,0 @@ -/* - * - * 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.general; - -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; - -import cc.kune.core.client.sitebar.spaces.SpaceSelectorPresenter.SpaceSelectorView; -import cc.kune.selenium.PageObject; -import cc.kune.selenium.tools.SeleniumConstants; - -public class SpacesPageObject extends PageObject { - - @FindBy(id = SeleniumConstants.GWTDEV + SpaceSelectorView.GROUP_SPACE_ID) - protected WebElement groupSpaceBtn; - @FindBy(id = SeleniumConstants.GWTDEV + SpaceSelectorView.HOME_SPACE_ID) - protected WebElement homeSpaceBtn; - @FindBy(id = SeleniumConstants.GWTDEV + SpaceSelectorView.PUBLIC_SPACE_ID) - protected WebElement publicSpaceBtn; - @FindBy(id = SeleniumConstants.GWTDEV + SpaceSelectorView.USER_SPACE_ID) - protected WebElement userSpaceBtn; - - public SpacesPageObject() { - } - - public WebElement groupBtn() { - return groupSpaceBtn; - } - - public WebElement homeBtn() { - return homeSpaceBtn; - } - - public WebElement publicBtn() { - return publicSpaceBtn; - } - - public WebElement userBtn() { - return userSpaceBtn; - } - -} Modified: trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java =================================================================== --- trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java 2011-11-08 15:03:19 UTC (rev 1595) +++ trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java 2011-11-09 02:39:48 UTC (rev 1596) @@ -19,6 +19,7 @@ */ package cc.kune.selenium.login; +import org.openqa.selenium.Keys; import org.testng.annotations.Test; import cc.kune.core.client.state.SiteTokens; @@ -31,18 +32,30 @@ public class RegisterSeleniumTests extends KuneSeleniumTest { @Test(dataProvider = "correctregister") - public void basicRegister(final String shortName, final String longName, final String passwd, - final String email) { + public void basicRegister(final String shortNameUntrans, final String longNameUntrans, + final String passwd, final String emailUntrans) { + final String shortName = t(shortNameUntrans); + final String longName = t(longNameUntrans); + final String email = t(emailUntrans); SeleniumUtils.fastSpeed(false); // 15 chars, the limit, so we don't use shortName final String prefix = getTempString(); showTitleSlide(t("User registration"), t("to get full access to this site tools/contents")); login.createOne(); register.fillRegisterForm(shortName + prefix, longName + prefix, passwd, prefix + email, false); + sleep(1000); login.assertIsConnectedAs(prefix); - sleep(1000); entityHeader.waitForEntityTitle(longName + prefix); register.getWelcomeMsg().click(); + // home space + showTitleSlide(t("Home space (your welcome page)"), + t("Here you can see a summary of your activity in this site")); + spaces.homeBtn().click(); + sleep(2000); + homeSpace.getSndStats().click(); + sleep(2000); + homeSpace.getTrdStats().click(); + sleep(2000); // user space showTitleSlide(t("User space (your Inbox)"), t("contents in which you participate")); @@ -54,12 +67,20 @@ userSpace.getNewWave().click(); showMsg(t("where you can compose personal messages...")); showMsg(t("but also create contents to publish later")); + userSpace.rootBlipText().sendKeys(t("Congratulations for your report\n\n")); + sleep(1000); + userSpace.getCursive().click(); + userSpace.rootBlipText().sendKeys( + t("Hi there, Just to say that I like") + t("a lot your last report\n\n")); + sleep(1000); + userSpace.getCursive().click(); + userSpace.rootBlipText().sendKeys(t("Best\n\nJane")); sleep(3000); - + userSpace.getRootEdit().click(); // chat showTitleSlide(t("Chat with your buddies"), t("compatible with gmail and similars"), SiteTokens.WAVEINBOX); - showTooltip(chat.icon()); + // showTooltip(chat.icon()); chat.show(); sleep(3000); @@ -74,7 +95,29 @@ chat.getTalkBox(jids).sendKeys(t("I'm just testing")); chat.getSend(jids).click(); + showMsg(t("And you can chat event while going back/forward with your browser")); + spaces.homeBtn().click(); + sleep(2000); + chat.getTalkBox(jids).sendKeys(t("la la la")); + chat.getSend(jids).click(); + showMsg(t("Browser history back")); + browserBack(); + sleep(2000); + chat.getTalkBox(jids).sendKeys(t("I can continue chat smoothly ;)")); + chat.getSend(jids).click(); + sleep(2000); + showMsg(t("Browser history forward")); + browserForward(); + chat.getTalkBox(jids).sendKeys(t("goodbye!")); + chat.getSend(jids).click(); + sleep(1000); + chat.getTalkBox(jids).sendKeys(Keys.chord(Keys.ALT, "C")); + // chat.close(); + login.logout(); + + showTitleSlide(t("Thank you"), t("and yes, feedback welcome")); + } } Copied: trunk/src/test/java/cc/kune/selenium/spaces (from rev 1594, trunk/src/test/java/cc/kune/selenium/userspace) Added: trunk/src/test/java/cc/kune/selenium/spaces/GroupSpacePageObject.java =================================================================== --- trunk/src/test/java/cc/kune/selenium/spaces/GroupSpacePageObject.java (rev 0) +++ trunk/src/test/java/cc/kune/selenium/spaces/GroupSpacePageObject.java 2011-11-09 02:39:48 UTC (rev 1596) @@ -0,0 +1,84 @@ +/* + * + * 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.spaces; + +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +import cc.kune.selenium.PageObject; + +public class GroupSpacePageObject extends PageObject { + + @FindBy(xpath = "//div[2]/div/div[3]/div/span") + private WebElement blogTool; + @FindBy(xpath = "//div[2]/div/div[4]/div/span") + private WebElement chatTool; + @FindBy(xpath = "//div[3]/div/div[2]/div/div/div/span") + private WebElement docTool; + @FindBy(xpath = "//div[2]/div/div[6]/div/span") + private WebElement eventTool; + @FindBy(xpath = "//td/img") + private WebElement firstAvatarOfGroup; + @FindBy(xpath = "//div[2]/div/div[5]/div/span") + private WebElement listTool; + @FindBy(xpath = "//div[3]/div/button") + private WebElement socialNetOptions; + @FindBy(xpath = "//div[2]/div/div[7]/div/span") + private WebElement taskTool; + @FindBy(xpath = "//div[2]/div/div[7]/div/span") + private WebElement wikiTool; + + public WebElement getBlogTool() { + return blogTool; + } + + public WebElement getChatTool() { + return chatTool; + } + + public WebElement getDocTool() { + return docTool; + } + + public WebElement getEventTool() { + return eventTool; + } + + public WebElement getFirstAvatarOfGroup() { + return firstAvatarOfGroup; + } + + public WebElement getListTool() { + return listTool; + } + + public WebElement getSocialNetOptions() { + return socialNetOptions; + } + + public WebElement getTaskTool() { + return taskTool; + } + + public WebElement getWikiTool() { + return wikiTool; + } + +} Added: trunk/src/test/java/cc/kune/selenium/spaces/HomeSpacePageObject.java =================================================================== --- trunk/src/test/java/cc/kune/selenium/spaces/HomeSpacePageObject.java (rev 0) +++ trunk/src/test/java/cc/kune/selenium/spaces/HomeSpacePageObject.java 2011-11-09 02:39:48 UTC (rev 1596) @@ -0,0 +1,51 @@ +/* + * + * 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.spaces; + +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +import cc.kune.selenium.PageObject; + +public class HomeSpacePageObject extends PageObject { + + @FindBy(xpath = "//div[@id='k-home-group-stats']/div/div[2]/div/div/div/img") + private WebElement fstStats; + @FindBy(xpath = "//div[@id='k-home-group-stats']/div/div[2]/div/div[2]/div/img") + private WebElement sndStats; + @FindBy(xpath = "//div[@id='k-home-group-stats']/div/div[2]/div/div[3]/div/img") + private WebElement trdStats; + + public HomeSpacePageObject() { + } + + public WebElement getFstStats() { + return fstStats; + } + + public WebElement getSndStats() { + return sndStats; + } + + public WebElement getTrdStats() { + return trdStats; + } + +} Copied: trunk/src/test/java/cc/kune/selenium/spaces/SpacesPageObject.java (from rev 1556, trunk/src/test/java/cc/kune/selenium/general/SpacesPageObject.java) =================================================================== --- trunk/src/test/java/cc/kune/selenium/spaces/SpacesPageObject.java (rev 0) +++ trunk/src/test/java/cc/kune/selenium/spaces/SpacesPageObject.java 2011-11-09 02:39:48 UTC (rev 1596) @@ -0,0 +1,59 @@ +/* + * + * 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.spaces; + +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +import cc.kune.core.client.sitebar.spaces.SpaceSelectorPresenter.SpaceSelectorView; +import cc.kune.selenium.PageObject; +import cc.kune.selenium.tools.SeleniumConstants; + +public class SpacesPageObject extends PageObject { + + @FindBy(id = SeleniumConstants.GWTDEV + SpaceSelectorView.GROUP_SPACE_ID) + protected WebElement groupSpaceBtn; + @FindBy(id = SeleniumConstants.GWTDEV + SpaceSelectorView.HOME_SPACE_ID) + protected WebElement homeSpaceBtn; + @FindBy(id = SeleniumConstants.GWTDEV + SpaceSelectorView.PUBLIC_SPACE_ID) + protected WebElement publicSpaceBtn; + @FindBy(id = SeleniumConstants.GWTDEV + SpaceSelectorView.USER_SPACE_ID) + protected WebElement userSpaceBtn; + + public SpacesPageObject() { + } + + public WebElement groupBtn() { + return groupSpaceBtn; + } + + public WebElement homeBtn() { + return homeSpaceBtn; + } + + public WebElement publicBtn() { + return publicSpaceBtn; + } + + public WebElement userBtn() { + return userSpaceBtn; + } + +} Modified: trunk/src/test/java/cc/kune/selenium/spaces/UserSpacePageObject.java =================================================================== --- trunk/src/test/java/cc/kune/selenium/userspace/UserSpacePageObject.java 2011-11-08 14:16:07 UTC (rev 1594) +++ trunk/src/test/java/cc/kune/selenium/spaces/UserSpacePageObject.java 2011-11-09 02:39:48 UTC (rev 1596) @@ -17,7 +17,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ -package cc.kune.selenium.userspace; +package cc.kune.selenium.spaces; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; @@ -27,16 +27,41 @@ public class UserSpacePageObject extends PageObject { + @FindBy(xpath = "//div[2]/div/div[2]/div[3]/div[4]") + private WebElement cursive; + + @FindBy(xpath = "//div[3]/div/div/div[2]/div/div/div[3]") + private WebElement firstReplyTitlebar; + @FindBy(xpath = "//div[3]/div/div/span[2]") private WebElement firstWave; + @FindBy(xpath = "//div[2]/div[2]/div[4]") private WebElement newWave; - @FindBy(xpath = "") - private WebElement wavePanel; + @FindBy(xpath = "//div[10]/div/div/div/div[3]/div/div[2]") + private WebElement replyRootBlip; + + @FindBy(xpath = "//div[10]/div/div/div/div[3]/div/div/div/div/div/div[3]") + private WebElement rootBlip; + + @FindBy(xpath = "//ul/div") + private WebElement rootBlipText; + @FindBy(xpath = "//div[3]/div/div/div/div/div/div/span") + // this works but with click coords 5,5 + private WebElement rootEdit; + public UserSpacePageObject() { } + public WebElement getCursive() { + return cursive; + } + + public WebElement getFirstReplyTitlebar() { + return firstReplyTitlebar; + } + public WebElement getFirstWave() { return findElement(By.xpath("//div[3]/div[4]/div")); } @@ -45,7 +70,24 @@ return findElement(By.xpath("//div[2]/div[2]/div[4]")); } - public WebElement getWavePanel() { - return wavePanel; + public WebElement getReplyRootBlip() { + return replyRootBlip; } + + public WebElement getRootBlip() { + return rootBlip; + } + + public WebElement getRootBlipText() { + return rootBlipText; + } + + public WebElement getRootEdit() { + return rootEdit; + } + + public WebElement rootBlipText() { + return rootBlipText; + } + }
participants (1)
-
Vicente J. Ruiz Jurado