[portal-commits] JBoss Portal SVN: r11990 - in branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium: portal and 1 other directory.
portal-commits at lists.jboss.org
portal-commits at lists.jboss.org
Fri Sep 26 07:51:15 EDT 2008
Author: vrockai
Date: 2008-09-26 07:51:14 -0400 (Fri, 26 Sep 2008)
New Revision: 11990
Modified:
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserInterceptorPortletTestCase.java
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java
Log:
failed test fixes
Modified: branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java 2008-09-25 20:46:09 UTC (rev 11989)
+++ branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java 2008-09-26 11:51:14 UTC (rev 11990)
@@ -1,17 +1,17 @@
package org.jboss.portal.test.selenium;
+import org.testng.Assert;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
-import org.testng.Assert;
-
-import com.sun.java_cup.internal.internal_error;
/**
* @author <a href="mailto:vrockai at redhat.com">Viliam Rockai</a>
*/
@Test(groups = { "cms_dashboard" }, enabled = true, description = "Dashboard issues test case.")
public class DashboardTestCase extends JBossPortalSeleniumTestCase {
+ private static final String SUBMIT_ADDCENTER = "layoutForm:a_center";
+ private static final String SUBMIT_ADDLEFT = "layoutForm:a_left";
private static final String LINK_CONFIGURE_DASHBOARD = "link=Configure dashboard";
private static final String LINK_DASHBOARD = "link=Dashboard";
private static final String SELECT_PAGE = "page-selector-form:pageNameSelector";
@@ -87,9 +87,10 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LINK_CONFIGURE_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertEquals(selenium.getSelectedLabel(SELECT_LAYOUT),"DashTestPage","Default layout is not called \"default\".");
selectIfNotSelected("DashTestPage");
- Assert.assertEquals(selenium.getSelectedLabel(SELECT_LAYOUT),"default","Default layout is not called \"default\".");
-
+
selenium.select(SELECT_LAYOUT, "label=generic");
selenium.click(SUBMIT_LAYOUTSEL);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -116,17 +117,43 @@
selectIfNotSelected("DashTestPage");
selenium.click("link=Who's online portlet");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("layoutForm:a_center");
+ selenium.click(SUBMIT_ADDCENTER);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LINK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=DashTestPage");
selenium.waitForPageToLoad(PAGE_LOAD);
+
Assert.assertTrue(selenium.isTextPresent("Current users"));
Assert.assertTrue(selenium.isTextPresent("Whose 1 is logged-in:"));
Assert.assertTrue(selenium.isTextPresent("[admin]"));
}
+
+ @Test(enabled = true, dependsOnMethods = { "testAddPortlet" })
+ public void testDeletePortlet() {
+ selenium.click(LINK_DASHBOARD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(LINK_CONFIGURE_DASHBOARD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selectIfNotSelected("DashTestPage");
+
+ selenium.addSelection("layoutForm:selectMany_center", "label=CurrentUsersPortletWindow");
+ selenium.click("layoutForm:l_center");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click(LINK_DASHBOARD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=DashTestPage");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertFalse(selenium.isTextPresent("Current users"));
+ Assert.assertFalse(selenium.isTextPresent("Whose 1 is logged-in:"));
+ Assert.assertFalse(selenium.isTextPresent("[admin]"));
+ }
+
+
@Test(enabled = false, dependsOnMethods = { "testCreatePage" })
public void testAddGooglePortlet() {
selenium.click(LINK_DASHBOARD);
@@ -138,7 +165,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Hindu God of the Week");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("layoutForm:a_center");
+ selenium.click(SUBMIT_ADDCENTER);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LINK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -148,6 +175,52 @@
Assert.assertTrue(selenium.isTextPresent("Hindu God of the Week"));
}
+ // http://www.jboss.com/index.html?module=bb&op=viewtopic&t=143023
+ @Test(enabled = false)
+ public void testBugResetPortletSetting()
+ {
+ final String pageName = "page1";
+
+ selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(LINK_DASHBOARD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(LINK_CONFIGURE_DASHBOARD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(INPUT_PAGENAME, pageName);
+ selenium.click(SUBMIT_CREATEPAGE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(LINK_DASHBOARD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isElementPresent("link="+pageName));
+ selenium.click("link="+pageName);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isTextPresent("Powered by JBoss Portal"));
+
+ selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(LINK_DASHBOARD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(LINK_CONFIGURE_DASHBOARD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selectIfNotSelected(pageName);
+ selenium.click("Link=Weather Portlet");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(SUBMIT_ADDLEFT);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(LINK_DASHBOARD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link="+pageName);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isTextPresent("Miami, FL, US"));
+
+
+ }
+
+ //TODO write an extension for checking of ordering of elements
@Test(enabled = false, dependsOnMethods = { "testCreatePage" })
public void testReorder() {
Modified: branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java 2008-09-25 20:46:09 UTC (rev 11989)
+++ branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java 2008-09-26 11:51:14 UTC (rev 11990)
@@ -132,7 +132,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent(roleDisplay), "Role display name: " + roleDisplay + " not found on the page.");
- final String CHECK_ROLE = MessageFormat.format(this.ID_CHECK_ROLE, role);
+ final String CHECK_ROLE = MessageFormat.format(ID_CHECK_ROLE, role);
selenium.click(CHECK_ROLE);
selenium.click(ID_SUBMIT_ASSIGN_ROLE);
@@ -155,7 +155,7 @@
Assert.assertTrue(selenium.isTextPresent(roleDisplay), "Role display name: " + roleDisplay + " not found on the page.");
// check the tempRole check box
- final String CHECK_ROLE = MessageFormat.format(this.ID_CHECK_ROLE, role);
+ final String CHECK_ROLE = MessageFormat.format(ID_CHECK_ROLE, role);
selenium.click(CHECK_ROLE);
selenium.click(ID_SUBMIT_ASSIGN_ROLE);
Modified: branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2008-09-25 20:46:09 UTC (rev 11989)
+++ branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2008-09-26 11:51:14 UTC (rev 11990)
@@ -38,11 +38,12 @@
if (selenium.isElementPresent(id)){
selenium.click(id);
-
+
selenium.waitForPageToLoad(PAGE_LOAD);
}
}
+ @Deprecated
protected boolean findLink(String id) {
for (String link : selenium.getAllLinks()) {
if (link.equals(id)) {
Modified: branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserInterceptorPortletTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserInterceptorPortletTestCase.java 2008-09-25 20:46:09 UTC (rev 11989)
+++ branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserInterceptorPortletTestCase.java 2008-09-26 11:51:14 UTC (rev 11990)
@@ -1,15 +1,13 @@
package org.jboss.portal.test.selenium;
-import java.util.Date;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
+import java.util.Date;
import java.util.Vector;
import org.testng.Assert;
import org.testng.annotations.Test;
-
-import com.sun.org.apache.xerces.internal.impl.dtd.models.DFAContentModel;
/**
* @author <a href="mailto:vrockai at redhat.com">Viliam Rockai</a>
*/
Modified: branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java 2008-09-25 20:46:09 UTC (rev 11989)
+++ branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java 2008-09-26 11:51:14 UTC (rev 11990)
@@ -2,12 +2,10 @@
import java.text.MessageFormat;
+import org.testng.Assert;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
-import org.testng.Assert;
-
-import com.sun.java_cup.internal.internal_error;
/**
* @author <a href="mailto:vrockai at redhat.com">Viliam Rockai</a>
*/
@@ -17,16 +15,7 @@
private static final String SUBMIT_REFRESH_CANCEL = "edit-cons-form:list-cons-link_1";
private static final String SUBMIT_PROD_SAVE = "producer-form:save-producer";
private static final String SUBMIT_CONSDEL_CONF = "confirm-delete-form:destroy-link";
- // private static final String ID_LINK_PRODCONF =
- // "_id1jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:_id3jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj"
- // ;
- // private static final String ID_LINK_CONSCONF =
- // "_id1jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:_id3jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj"
- // ;
-
-
- // TODO shouldn't be same as REFRESH?
private static final String SUBMIT_CONS_REGVAL = "edit-cons-form:refresh-cons-link";
private static final String SUBMIT_REFRESHFINAL = "edit-cons-form:refresh-cons-link";
@@ -51,9 +40,8 @@
private static final String LINK_T_CONS_REG="consumer-list-form:consumersList:{0}:register";
private static final String LINK_T_CONS_DER="consumer-list-form:consumersList:{0}:register";
private static final String LINK_T_CONS_DEL="consumer-list-form:consumersList:{0}:delete";
-
-
-// public static String WSRP_CONSUMER_TABLE = "//form[@id='_id18jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj']/table";
+
+
public static String WSRP_CONSUMER_TABLE = "consumer-list-form:consumersList";
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
@@ -198,7 +186,6 @@
public void testBeaConsumerDelete() {
createConsumer("BEAdel", "100", "http://wsrp.bea.com:7001/producer/producer?WSDL");
- //selenium.setSpeed("2000");
selenium.open("/portal/");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Admin");
@@ -254,7 +241,51 @@
Assert.assertEquals("tetsPropHint", selenium.getValue(INPUT_PROPHINT));
}
+
+ @Test(enabled = true, description = "Renaming a consumer through the configure button.")
+ public void testConfigureConsumer() {
+ final String name = "renameMe";
+ final String nameNew = "renameNewMe";
+
+ createConsumer("BEAdel", "100", "http://wsrp.bea.com:7001/producer/producer?WSDL");
+ selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=WSRP");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ clickIfVisible(ID_LINK_CONSCONF);
+ clickIfVisible(LINK_CONSUMER_HOME);
+
+
+ int r = findTableRow(WSRP_CONSUMER_TABLE, name, 0);
+
+ Assert.assertTrue(r<0, "Not created consumer already in table");
+
+ createConsumer(name, "100", "http://wsrp.bea.com:7001/producer/producer?WSDL");
+
+ clickIfVisible(ID_LINK_CONSCONF);
+ clickIfVisible(LINK_CONSUMER_HOME);
+
+ r = findTableRow(WSRP_CONSUMER_TABLE, name, 0);
+ Assert.assertTrue(r>0, "Created consumer not found in table");
+
+ selenium.click(MessageFormat.format(LINK_T_CONS_CON,r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.type("edit-cons-form:id", nameNew);
+ selenium.click("edit-cons-form:refresh-cons-link");
+ clickIfVisible(ID_LINK_CONSCONF);
+ clickIfVisible(LINK_CONSUMER_HOME);
+
+ r = findTableRow(WSRP_CONSUMER_TABLE, name, 0);
+ Assert.assertTrue(r<0, "Renamed consumer still in table");
+
+ r = findTableRow(WSRP_CONSUMER_TABLE, nameNew, 0);
+ Assert.assertTrue(r>0, "Renamed consumer not found in table");
+ }
+
private void createConsumer(String name, String timeout, String address) {
selenium.open("/portal/");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -267,7 +298,6 @@
selenium.click(SUBMIT_CREATECONS);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.type(INPUT_CACHEEXP, timeout);
- // selenium.click("link=14. Web Services for Remote Portlets (WSRP)");
selenium.type(INPUT_CONSWSDL, address);
selenium.click(SUBMIT_REFRESHSAVE);
selenium.waitForPageToLoad(PAGE_LOAD);
Modified: branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java 2008-09-25 20:46:09 UTC (rev 11989)
+++ branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java 2008-09-26 11:51:14 UTC (rev 11990)
@@ -16,7 +16,7 @@
private static final String SUBMIT_RENAME_PORTAL = "renameForm:rename";
private static final String INPUT_RENAME_PORTAL = "renameForm:newName";
- private static final String SUBMIT_DELETE_PORTAL_CONF = "_id29jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:confirm-form:delete";
+ private static final String SUBMIT_DELETE_PORTAL_CONF = "delete-view:confirm-form:delete";
private static final String INPUT_SUBMIT_PAGECREATE = "create-page-form:create-page";
private static final String INPUT_PAGENAME = "create-page-form:pageName";
private static final String INPUT_PORTALNAME = "create-portal-form:name";
@@ -25,7 +25,7 @@
private final String TAB_PORTALOBJ_ID = "//div[@id='current']/a";
private final String LINK_PORTALS_ID = "link=*Portal Objects*";
- private final String LINK_PORTAL_HOME = "_id8jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_id11jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj";
+ private final String LINK_PORTAL_HOME = "obj-temp-form:object-link-0";
private final String TABLE_PORTAL_ADMIN = "obj-nav-form:portal-datatable";
private final String POR_TL_MAIN = "obj-nav-form:portal-datatable:{0}:object-iid-link";
@@ -62,6 +62,7 @@
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
+
clickIfVisible(TAB_PORTALOBJ_ID);
clickIfVisible(LINK_PORTALS_ID);
More information about the portal-commits
mailing list