JBoss Portal SVN: r12885 - branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-02-24 10:55:12 -0500 (Tue, 24 Feb 2009)
New Revision: 12885
Modified:
branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
Log:
CMS editing was failing
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2009-02-24 15:54:10 UTC (rev 12884)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2009-02-24 15:55:12 UTC (rev 12885)
@@ -1488,7 +1488,7 @@
sMakeLive = "on";
}
- if (!"".equals(sFilePath) && !CHECK_FOR_XSS_PATTERN.matcher(sFilePath).matches())
+ if (!"".equals(sFilePath) && CHECK_FOR_XSS_PATTERN.matcher(sFilePath).matches())
{
String sContent = aReq.getParameter("elm1");
15 years, 2 months
JBoss Portal SVN: r12884 - tags/JBoss_Portal_2_7_2/core-cms/src/main/org/jboss/portal/core/cms/ui/admin.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-02-24 10:54:10 -0500 (Tue, 24 Feb 2009)
New Revision: 12884
Modified:
tags/JBoss_Portal_2_7_2/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
Log:
CMS editing was failing
Modified: tags/JBoss_Portal_2_7_2/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
--- tags/JBoss_Portal_2_7_2/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2009-02-24 15:40:51 UTC (rev 12883)
+++ tags/JBoss_Portal_2_7_2/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2009-02-24 15:54:10 UTC (rev 12884)
@@ -1488,7 +1488,7 @@
sMakeLive = "on";
}
- if (!"".equals(sFilePath) && !CHECK_FOR_XSS_PATTERN.matcher(sFilePath).matches())
+ if (!"".equals(sFilePath) && CHECK_FOR_XSS_PATTERN.matcher(sFilePath).matches())
{
String sContent = aReq.getParameter("elm1");
15 years, 2 months
JBoss Portal SVN: r12882 - branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2009-02-24 10:02:58 -0500 (Tue, 24 Feb 2009)
New Revision: 12882
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
Log:
output fix
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2009-02-24 14:30:50 UTC (rev 12881)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2009-02-24 15:02:58 UTC (rev 12882)
@@ -75,7 +75,7 @@
}
if (props == null) {
- System.out.println("props null");
+ //System.out.println("props null");
return subst;
} else {
return props.getProperty(prop) != null ? props.getProperty(prop) : subst;
15 years, 2 months
JBoss Portal SVN: r12881 - branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2009-02-24 09:30:50 -0500 (Tue, 24 Feb 2009)
New Revision: 12881
Added:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/end2end.xml
Log:
[JBPORTAL-2309] end2end suite added
Added: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/end2end.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/end2end.xml (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/end2end.xml 2009-02-24 14:30:50 UTC (rev 12881)
@@ -0,0 +1,14 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="SeleniumTest">
+
+ <test verbose="2" name="org.jboss.portal.test.selenium.portal.EndtoEndPortalAdminTestCase" annotations="JDK">
+ <classes>
+ <class name="org.jboss.portal.test.selenium.portal.EndtoEndPortalAdminTestCase"/>
+ </classes>
+ </test>
+
+<listeners>
+<!-- <listener class-name="org.testng.reporters.JUnitXMLReporter"></listener> -->
+ <listener class-name="org.jboss.portal.test.selenium.JBossSeleniumTestListener"/>
+</listeners>
+</suite>
15 years, 2 months
JBoss Portal SVN: r12880 - in branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium: cms and 1 other directories.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2009-02-24 09:30:01 -0500 (Tue, 24 Feb 2009)
New Revision: 12880
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortletUserCreationTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserLoginTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSDirectoryTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileUploadTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/DashboardsTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletDefinitionsTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletInstancesTestCase.java
Log:
[JBPORTAL-2309] - finishing the jira and refactoring to locator.properties
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java 2009-02-24 13:39:09 UTC (rev 12879)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java 2009-02-24 14:30:01 UTC (rev 12880)
@@ -10,32 +10,35 @@
*/
@Test(groups = { "cms_dashboard" }, enabled = true, description = "Dashboard issues test case.")
public class DashboardTestCase extends JBossPortalSeleniumTestCase {
-
- private static final String SUB_LAYOUT_UPDATE = "//input[contains(@name,'dashboardLayoutForm:j_id12')]";
- private static final String SUB_PAGE_RENAME = "//form[contains(@id,'renameForm')]/input[@type='submit']";
- private static final String INP_PAGE_RENAME = "//input[contains(@id,'renameForm:newName')]";
- private static final String LINK_WEATHER_PORTLET = "link=*WeatherPortlet*";
- private static final String LINK_PORTL2 = "link=*Who's online portlet*";
- private static final String LINK_PORTL1 = "link=*Welcome portlet*";
- //private static final String OPT_PORTL2 = "CurrentUsersPortletWindow";
- private static final String OPT_PORTL1 = "JSPPortletWindow";
- private static final String SEL_CONTENT_TYPE = "//select[contains(@id,'contentTypesForm:instanceId')]";
- private static final String SUB_DEL_FROM_CENTER_REGION = "//input[contains(@id,'layoutForm:l_center')]";
- private static final String SUB_DOWN_CENTER_REGION = "//input[contains(@id,'layoutForm:d_center')]";
- private static final String SUB_UP_CENTER_REGION = "//input[contains(@id,'layoutForm:u_center')]";
- private static final String SEL_CENTER_REGION = "//select[contains(@id,'layoutForm:selectMany_center')]";
- private static final String SUB_ADDCENTER = "//input[contains(@id,'layoutForm:a_center')]";
- private static final String SUB_ADDLEFT = "//input[contains(@id,'layoutForm:a_left')]";
- private static final String LNK_CONFIGURE_DASHBOARD = "link=Configure dashboard";
- private static final String LNK_DASHBOARD = "link=Dashboard";
- private static final String SEL_PAGE = "//select[contains(@id,'pageNameSelector')]";
- private static final String INP_PAGENAME = "//input[contains(@id,':pageName')]";
- private static final String SUB_CREATEPAGE = "//form[contains(@id,'j_id3')]/input[@type='submit']";
- private static final String SEL_LAYOUT = "//select[contains(@id,'dashboardLayoutForm:layoutSelector')]";
-
- private static final String SEL_THEME = "//select[contains(@id,'dashboardThemeForm:themeSelector')]";
- private static final String SUB_THEMESEL = "//form[contains(@id,'dashboardThemeForm')]/input[@type='submit']";
+ public String casePfx = "dash.";
+
+ private final String SUB_LAYOUT_UPDATE = getProp(casePfx + "sub.layout.update", "//input[contains(@name,'dashboardLayoutForm:j_id12')]");
+ private final String SUB_PAGE_RENAME = getProp(casePfx + "sub.page.rename", "//form[contains(@id,'renameForm')]/input[@type='submit']");
+ private final String INP_PAGE_RENAME = getProp(casePfx + "inp.page.rename", "//input[contains(@id,'renameForm:newName')]");
+ private final String LINK_WEATHER_PORTLET = getProp(casePfx + "link.weather.portlet", "link=*WeatherPortlet*");
+ private final String LINK_PORTL2 = getProp(casePfx + "link.portl2", "link=*Who's online portlet*");
+ private final String LINK_PORTL1 = getProp(casePfx + "link.portl1", "link=*Welcome portlet*");
+ // private final String OPT_PORTL2 =
+ // getProp(casePfx+"opt.portl2","CurrentUsersPortletWindow");
+ private final String OPT_PORTL1 = getProp(casePfx + "opt.portl1", "JSPPortletWindow");
+ private final String SEL_CONTENT_TYPE = getProp(casePfx + "sel.content.type", "//select[contains(@id,'contentTypesForm:instanceId')]");
+ private final String SUB_DEL_FROM_CENTER_REGION = getProp(casePfx + "sub.del.from.center.region", "//input[contains(@id,'layoutForm:l_center')]");
+ private final String SUB_DOWN_CENTER_REGION = getProp(casePfx + "sub.down.center.region", "//input[contains(@id,'layoutForm:d_center')]");
+ private final String SUB_UP_CENTER_REGION = getProp(casePfx + "sub.up.center.region", "//input[contains(@id,'layoutForm:u_center')]");
+ private final String SEL_CENTER_REGION = getProp(casePfx + "sel.center.region", "//select[contains(@id,'layoutForm:selectMany_center')]");
+ private final String SUB_ADDCENTER = getProp(casePfx + "sub.addcenter", "//input[contains(@id,'layoutForm:a_center')]");
+ private final String SUB_ADDLEFT = getProp(casePfx + "sub.addleft", "//input[contains(@id,'layoutForm:a_left')]");
+ private final String LNK_CONFIGURE_DASHBOARD = getProp(casePfx + "lnk.configure.dashboard", "link=Configure dashboard");
+ private final String LNK_DASHBOARD = getProp(casePfx + "lnk.dashboard", "link=Dashboard");
+ private final String SEL_PAGE = getProp(casePfx + "sel.page", "//select[contains(@id,'pageNameSelector')]");
+ private final String INP_PAGENAME = getProp(casePfx + "inp.pagename", "//input[contains(@id,':pageName')]");
+ private final String SUB_CREATEPAGE = getProp(casePfx + "sub.createpage", "//form[contains(@id,'j_id3')]/input[@type='submit']");
+ private final String SEL_LAYOUT = getProp(casePfx + "sel.layout", "//select[contains(@id,'dashboardLayoutForm:layoutSelector')]");
+
+ private final String SEL_THEME = getProp(casePfx + "sel.theme", "//select[contains(@id,'dashboardThemeForm:themeSelector')]");
+ private final String SUB_THEMESEL = getProp(casePfx + "sub.themesel", "//form[contains(@id,'dashboardThemeForm')]/input[@type='submit']");
+
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
logoutIfPossible();
@@ -47,7 +50,7 @@
}
- private void wait(int t){
+ private void wait(int t) {
try {
Thread.sleep(t);
} catch (InterruptedException e) {
@@ -55,222 +58,220 @@
e.printStackTrace();
}
}
-
+
@Test(enabled = true)
public void testCreatePage() {
selenium.click(LNK_DASHBOARD);
-
- //selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // selenium.waitForPageToLoad(PAGE_LOAD);
wait(5000);
-
+
selenium.click(LNK_CONFIGURE_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
final String pageName = "DashTestPage";
selenium.type(INP_PAGENAME, pageName);
-
- clickAndWait(SUB_CREATEPAGE);
-
+
+ clickAndWait(SUB_CREATEPAGE);
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isElementPresent("link="+pageName));
- selenium.click("link="+pageName);
+ Assert.assertTrue(selenium.isElementPresent("link=" + pageName));
+ selenium.click("link=" + pageName);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Powered by JBoss Portal"));
}
-
+
@Test(enabled = true, dependsOnMethods = { "testCreatePage" })
public void testRenamePage() {
-
+
// firstly create page
-
+
selenium.click(LNK_DASHBOARD);
wait(5000);
-
+
selenium.click(LNK_CONFIGURE_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
final String pageName = "DashToRenamePage";
final String pageNameNew = "DashRenamedPage";
selenium.type(INP_PAGENAME, pageName);
-
- clickAndWait(SUB_CREATEPAGE);
-
+
+ clickAndWait(SUB_CREATEPAGE);
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isElementPresent("link="+pageName));
- selenium.click("link="+pageName);
+ Assert.assertTrue(selenium.isElementPresent("link=" + pageName));
+ selenium.click("link=" + pageName);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Powered by JBoss Portal"));
-
+
// then rename it
selenium.click(LNK_CONFIGURE_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- selectIfNotSelected(SEL_PAGE,pageName);
+ selectIfNotSelected(SEL_PAGE, pageName);
+
selenium.type(INP_PAGE_RENAME, pageNameNew);
selenium.click(SUB_PAGE_RENAME);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
}
@Test(enabled = true, dependsOnMethods = { "testCreatePage" })
public void testUpdateTheme() {
- //selenium.setSpeed("10000");
+ // selenium.setSpeed("10000");
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
- //selenium.waitForPageToLoad(PAGE_LOAD);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
wait(5000);
- selectIfNotSelected(SEL_PAGE,"DashTestPage");
+ selectIfNotSelected(SEL_PAGE, "DashTestPage");
selenium.select(SEL_THEME, "label=renaissance");
-
+
selenium.click(SUB_THEMESEL);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
- selectIfNotSelected(SEL_PAGE,"DashTestPage");
+ selectIfNotSelected(SEL_PAGE, "DashTestPage");
Assert.assertEquals(selenium.getSelectedLabel(SEL_THEME), "renaissance", "Previously selected theme other then expected.");
}
@Test(enabled = true, dependsOnMethods = { "testCreatePage" })
public void testUpdateLayout() {
- //selenium.setSpeed("10000");
+ // selenium.setSpeed("10000");
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
- //selenium.waitForPageToLoad(PAGE_LOAD);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
wait(5000);
selenium.windowMaximize();
- selectIfNotSelected(SEL_PAGE,"DashTestPage");
+ selectIfNotSelected(SEL_PAGE, "DashTestPage");
selenium.select(SEL_LAYOUT, "label=generic");
-
+
selenium.click(SUB_LAYOUT_UPDATE);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
- selectIfNotSelected(SEL_PAGE,"DashTestPage");
-
+ selectIfNotSelected(SEL_PAGE, "DashTestPage");
+
Assert.assertEquals(selenium.getSelectedLabel(SEL_LAYOUT), "generic", "Previously selected layout other then expected.");
}
@Test(enabled = true, dependsOnMethods = { "testCreatePage" })
public void testAddPortlet() {
- //selenium.setSpeed("10000");
+ // selenium.setSpeed("10000");
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
-
-
+
selenium.click(LNK_CONFIGURE_DASHBOARD);
- //selenium.waitForPageToLoad(PAGE_LOAD);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
wait(5000);
- selectIfNotSelected(SEL_PAGE,"DashTestPage");
+ selectIfNotSelected(SEL_PAGE, "DashTestPage");
selenium.click(LINK_PORTL2);
selenium.waitForPageToLoad(PAGE_LOAD);
waitForElement("portlet-editor-title");
selenium.click(SUB_ADDCENTER);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=DashTestPage");
selenium.waitForPageToLoad(PAGE_LOAD);
-
-
+
Assert.assertTrue(selenium.isTextPresent("Current users"));
Assert.assertTrue(selenium.isTextPresent("Among them: * logged-in"));
Assert.assertTrue(selenium.isTextPresent("[admin]"));
- //selenium.setSpeed("0");
+ // selenium.setSpeed("0");
}
- @Test(enabled = true, dependsOnMethods = { "testCreatePage","testAddPortlet" })
+ @Test(enabled = true, dependsOnMethods = { "testCreatePage", "testAddPortlet" })
public void testMovePortlet() {
final String pageName = "DashMovePage";
-
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
- //selenium.waitForPageToLoad(PAGE_LOAD);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
wait(5000);
-
+
selenium.type(INP_PAGENAME, pageName);
selenium.click(SUB_CREATEPAGE);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- selectIfNotSelected(SEL_PAGE,pageName);
+
+ selectIfNotSelected(SEL_PAGE, pageName);
selenium.click(LINK_PORTL1);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(SUB_ADDCENTER);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- selectIfNotSelected(SEL_PAGE,pageName);
+
+ selectIfNotSelected(SEL_PAGE, pageName);
selenium.click(LINK_PORTL2);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(SUB_ADDCENTER);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link="+pageName);
+ selenium.click("link=" + pageName);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
Assert.assertFalse(assertTextOrder("Current;Greetings"));
Assert.assertTrue(assertTextOrder("Greetings;Current"));
-
+
}
-
- @Test(enabled = true, dependsOnMethods = { "testCreatePage" , "testMovePortlet"})
+
+ @Test(enabled = true, dependsOnMethods = { "testCreatePage", "testMovePortlet" })
public void testReorder() {
final String pageName = "DashMovePage";
-
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
- //selenium.waitForPageToLoad(PAGE_LOAD);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
wait(5000);
- selectIfNotSelected(SEL_PAGE,pageName);
-
+ selectIfNotSelected(SEL_PAGE, pageName);
+
selenium.addSelection(SEL_CENTER_REGION, OPT_PORTL1);
selenium.click(SUB_DOWN_CENTER_REGION);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link="+pageName);
+ selenium.click("link=" + pageName);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
Assert.assertFalse(assertTextOrder("Greetings;Current"));
Assert.assertTrue(assertTextOrder("Current;Greetings"));
}
-
+
@Test(enabled = true, dependsOnMethods = { "testAddPortlet" })
public void testDeletePortlet() {
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
- //selenium.waitForPageToLoad(PAGE_LOAD);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
wait(5000);
- selectIfNotSelected(SEL_PAGE,"DashTestPage");
+ selectIfNotSelected(SEL_PAGE, "DashTestPage");
selenium.addSelection(SEL_CENTER_REGION, "label=CurrentUsersPortletWindow");
selenium.click(SUB_DEL_FROM_CENTER_REGION);
@@ -291,9 +292,9 @@
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
- //selenium.waitForPageToLoad(PAGE_LOAD);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
wait(5000);
- selectIfNotSelected(SEL_PAGE,"DashTestPage");
+ selectIfNotSelected(SEL_PAGE, "DashTestPage");
selenium.select(SEL_CONTENT_TYPE, "label=widget/google");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Band Culinaria");
@@ -322,7 +323,7 @@
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
- //selenium.waitForPageToLoad(PAGE_LOAD);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
wait(5000);
selenium.type(INP_PAGENAME, pageName);
selenium.click(SUB_CREATEPAGE);
@@ -344,7 +345,7 @@
selenium.click(LNK_CONFIGURE_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
- selectIfNotSelected(SEL_PAGE,pageName);
+ selectIfNotSelected(SEL_PAGE, pageName);
selenium.click(LINK_WEATHER_PORTLET);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -371,10 +372,10 @@
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
- //selenium.waitForPageToLoad(PAGE_LOAD);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
wait(5000);
- selectIfNotSelected(SEL_PAGE,pageName);
+ selectIfNotSelected(SEL_PAGE, pageName);
selenium.type(INP_PAGE_RENAME, pageNameNew);
selenium.click(SUB_PAGE_RENAME);
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2009-02-24 13:39:09 UTC (rev 12879)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2009-02-24 14:30:01 UTC (rev 12880)
@@ -16,227 +16,232 @@
*/
public class JBossPortalSeleniumTestCase {
- public static final String LINK_LOGOUT = "link=Logout";
- public static final String SUBMIT_LOGIN = "login";
- public static final String ADDR_PORTAL = "/portal/";
- public static final String FRAME_LOGIN_CONTENT = "login-content";
- public static final String LINK_LOGIN = "link=Login";
- public static final String INPUT_PASSWORD = "j_password";
- public static final String INPUT_USERNAME = "j_username";
- protected Properties props;
- protected Selenium selenium;
+ private String casePfx = "portal.";
- // Generic timeout in miliseconds
- protected static final String PAGE_LOAD = "2400000";
+ static {
+ try {
+ props = getProperties();
+ } catch (Exception e) {
+ // TODO: handle exception
+ }
+ }
+
+ public final String LINK_LOGOUT = getProp(casePfx + "link.logout", "link=Logout");
+ public final String SUBMIT_LOGIN = getProp(casePfx + "submit.login", "login");
+ public final String ADDR_PORTAL = getProp(casePfx + "addr.portal", "/portal/");
+ public final String FRAME_LOGIN_CONTENT = getProp(casePfx + "frame.login.content", "login-content");
+ public final String LINK_LOGIN = getProp(casePfx + "link.login", "link=Login");
+ public final String INPUT_PASSWORD = getProp(casePfx + "input.password", "j_password");
+ public final String INPUT_USERNAME = getProp(casePfx + "input.username", "j_username");
- // Element timeout in seconds
- protected static final int ELEM_TIMEOUT = 220;
+ protected static Properties props;
+ protected Selenium selenium;
- public JBossPortalSeleniumTestCase() {
- try {
- this.props = getProperties();
- } catch (Exception e) {
- // TODO: handle exception
- }
- }
+ // Generic timeout in miliseconds
+ protected static final String PAGE_LOAD = "2400000";
- @BeforeClass
- public void setupChromeForLogin() throws Exception {
+ // Element timeout in seconds
+ protected static final int ELEM_TIMEOUT = 220;
- String browser = System.getProperty("browser");
+ @BeforeClass
+ public void setupChromeForLogin() throws Exception {
+
+ String browser = System.getProperty("browser");
- selenium = new DefaultSelenium("127.0.0.1", 44444, browser, "http://localhost:8080/portal/");
+ selenium = new DefaultSelenium("127.0.0.1", 44444, browser, "http://localhost:8080/portal/");
- JBossSeleniumTestListener.selenium = selenium;
- selenium.start();
- selenium.setTimeout(PAGE_LOAD);
- }
+ JBossSeleniumTestListener.selenium = selenium;
+ selenium.start();
+ selenium.setTimeout(PAGE_LOAD);
+ }
- @AfterClass
- public void tearDownInstaller() throws Exception {
- selenium.stop();
- }
+ @AfterClass
+ public void tearDownInstaller() throws Exception {
+ selenium.stop();
+ }
- private Properties getProperties() throws IOException {
- ClassLoader cl = ClassLoader.getSystemClassLoader();
- InputStream is = cl.getResourceAsStream("org/jboss/portal/test/selenium/locator.properties");
- Properties props = new Properties();
- props.load(is);
- return props;
- }
+ private static Properties getProperties() throws IOException {
+ ClassLoader cl = ClassLoader.getSystemClassLoader();
+ InputStream is = cl.getResourceAsStream("org/jboss/portal/test/selenium/locator.properties");
+ Properties props = new Properties();
+ props.load(is);
+ return props;
+ }
- protected String getProp(String prop, String subst) {
- if (subst == null || "".equals(subst)) {
- subst = "Locator not set";
- }
+ protected String getProp(String prop, String subst) {
+
+ if (subst == null || "".equals(subst)) {
+ subst = "Locator not set";
+ }
- if (props == null) {
- return subst;
- } else {
- return props.getProperty(prop) != null ? props.getProperty(prop) : subst;
- }
- }
+ if (props == null) {
+ System.out.println("props null");
+ return subst;
+ } else {
+ return props.getProperty(prop) != null ? props.getProperty(prop) : subst;
+ }
+ }
- protected void clickIfVisible(String id) {
+ protected void clickIfVisible(String id) {
- if (selenium.isElementPresent(id)) {
- selenium.click(id);
+ if (selenium.isElementPresent(id)) {
+ selenium.click(id);
- selenium.waitForPageToLoad(PAGE_LOAD);
- }
- }
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ }
+ }
- protected int findTableRow(String tableLocation, String searchName, int searchCol) {
- return Integer.valueOf(selenium.getEval("selenium.findTableRow(\"" + tableLocation + "\",'" + searchName + "'," + searchCol + ")"));
- }
+ protected int findTableRow(String tableLocation, String searchName, int searchCol) {
+ return Integer.valueOf(selenium.getEval("selenium.findTableRow(\"" + tableLocation + "\",'" + searchName + "'," + searchCol + ")"));
+ }
- protected int countTableRows(String tableLocation) {
- return Integer.valueOf(selenium.getEval("selenium.countTableRows(\"" + tableLocation + "\")"));
- }
+ protected int countTableRows(String tableLocation) {
+ return Integer.valueOf(selenium.getEval("selenium.countTableRows(\"" + tableLocation + "\")"));
+ }
- // TODO refactor
- protected void safeSelect(String locator, String value) {
- waitForElement(locator);
+ // TODO refactor
+ protected void safeSelect(String locator, String value) {
+ waitForElement(locator);
- for (int second = 0;; second++) {
- if (second >= ELEM_TIMEOUT) {
- Assert.fail("Element " + locator + " not found.");
- }
- try {
- String[] opts = selenium.getSelectOptions(locator);
- boolean isAvailable = false;
+ for (int second = 0;; second++) {
+ if (second >= ELEM_TIMEOUT) {
+ Assert.fail("Element " + locator + " not found.");
+ }
+ try {
+ String[] opts = selenium.getSelectOptions(locator);
+ boolean isAvailable = false;
- for (String opt : opts) {
- if (opt.equals(value)) {
- isAvailable = true;
- }
- }
+ for (String opt : opts) {
+ if (opt.equals(value)) {
+ isAvailable = true;
+ }
+ }
- if (isAvailable) {
- break;
- }
- } catch (Exception e) {
- }
- waitFor(1000);
- }
+ if (isAvailable) {
+ break;
+ }
+ } catch (Exception e) {
+ }
+ waitFor(1000);
+ }
- selenium.select(locator, "label=" + value);
- }
+ selenium.select(locator, "label=" + value);
+ }
- protected void clickAndWait(String locator) {
- waitForElement(locator);
- selenium.click(locator);
- selenium.waitForPageToLoad(PAGE_LOAD);
- }
+ protected void clickAndWait(String locator) {
+ waitForElement(locator);
+ selenium.click(locator);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ }
- protected void openAndWait(String locator) {
- selenium.open(locator);
- selenium.waitForPageToLoad(PAGE_LOAD);
- }
+ protected void openAndWait(String locator) {
+ selenium.open(locator);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ }
- protected void selectIfNotSelected(String selector, String label) {
- waitForElement(selector);
- if (!selenium.getSelectedLabel(selector).equals(label)) {
- selenium.select(selector, "label=" + label);
- selenium.waitForPageToLoad(PAGE_LOAD);
- }
- }
+ protected void selectIfNotSelected(String selector, String label) {
+ waitForElement(selector);
+ if (!selenium.getSelectedLabel(selector).equals(label)) {
+ selenium.select(selector, "label=" + label);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ }
+ }
- protected boolean assertTextOrder(String text) {
- return Boolean.valueOf(selenium.getEval("selenium.assertTextOrder(\"" + text + "\")"));
- }
+ protected boolean assertTextOrder(String text) {
+ return Boolean.valueOf(selenium.getEval("selenium.assertTextOrder(\"" + text + "\")"));
+ }
- protected void waitFor(long time) {
- try {
- Thread.sleep(time);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
+ protected void waitFor(long time) {
+ try {
+ Thread.sleep(time);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
- protected void waitForElement(String locator) {
- for (int second = 0;; second++) {
- if (second >= ELEM_TIMEOUT) {
- Assert.fail("Element " + locator + " not found.");
- }
- try {
- if (selenium.isElementPresent(locator)) {
- break;
- }
- } catch (Exception e) {
- }
- waitFor(1000);
- }
- }
+ protected void waitForElement(String locator) {
+ for (int second = 0;; second++) {
+ if (second >= ELEM_TIMEOUT) {
+ Assert.fail("Element " + locator + " not found.");
+ }
+ try {
+ if (selenium.isElementPresent(locator)) {
+ break;
+ }
+ } catch (Exception e) {
+ }
+ waitFor(1000);
+ }
+ }
- protected void waitForElement(String locatorElem, String locatorLink, long timeToWait, long n) {
- for (int i = 0;; i++) {
- if (i >= n) {
- Assert.fail("Element " + locatorElem + " not found.");
- }
- try {
- if (selenium.isElementPresent(locatorElem)) {
- break;
- }
- } catch (Exception e) {
- }
- waitFor(1000);
- }
- }
+ protected void waitForElement(String locatorElem, String locatorLink, long timeToWait, long n) {
+ for (int i = 0;; i++) {
+ if (i >= n) {
+ Assert.fail("Element " + locatorElem + " not found.");
+ }
+ try {
+ if (selenium.isElementPresent(locatorElem)) {
+ break;
+ }
+ } catch (Exception e) {
+ }
+ waitFor(1000);
+ }
+ }
- public void waitForText(String text) {
- for (int second = 0;; second++) {
- if (second >= ELEM_TIMEOUT) {
- Assert.fail("Text '" + text + "' not found.");
- }
- try {
- if (selenium.isTextPresent(text)) {
- break;
- }
- } catch (Exception e) {
- }
- waitFor(100);
- }
- }
+ public void waitForText(String text) {
+ for (int second = 0;; second++) {
+ if (second >= ELEM_TIMEOUT) {
+ Assert.fail("Text '" + text + "' not found.");
+ }
+ try {
+ if (selenium.isTextPresent(text)) {
+ break;
+ }
+ } catch (Exception e) {
+ }
+ waitFor(100);
+ }
+ }
- protected void login(String username, String password) {
- selenium.open(ADDR_PORTAL);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ protected void login(String username, String password) {
+ selenium.open(ADDR_PORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click(LINK_LOGIN);
- selenium.selectFrame(FRAME_LOGIN_CONTENT);
+ selenium.click(LINK_LOGIN);
+ selenium.selectFrame(FRAME_LOGIN_CONTENT);
- waitForElement(INPUT_USERNAME);
- waitForElement(INPUT_PASSWORD);
- waitForElement(SUBMIT_LOGIN);
+ waitForElement(INPUT_USERNAME);
+ waitForElement(INPUT_PASSWORD);
+ waitForElement(SUBMIT_LOGIN);
- selenium.type(INPUT_USERNAME, username);
- selenium.type(INPUT_PASSWORD, password);
- Assert.assertTrue(selenium.isElementPresent(SUBMIT_LOGIN));
- selenium.click(SUBMIT_LOGIN);
- selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("Logged in as: " + username), "Not logged in, login message missing.");
- }
+ selenium.type(INPUT_USERNAME, username);
+ selenium.type(INPUT_PASSWORD, password);
+ Assert.assertTrue(selenium.isElementPresent(SUBMIT_LOGIN));
+ selenium.click(SUBMIT_LOGIN);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent("Logged in as: " + username), "Not logged in, login message missing.");
+ }
- protected void logout() {
- selenium.open(ADDR_PORTAL);
- selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isElementPresent(LINK_LOGOUT));
- selenium.click(LINK_LOGOUT);
- selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertFalse(selenium.isTextPresent("Logged in as:"), "Not logged in, login message missing.");
- Assert.assertTrue(selenium.isElementPresent("Link=Login"), "Login link not present.");
- }
+ protected void logout() {
+ selenium.open(ADDR_PORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isElementPresent(LINK_LOGOUT));
+ selenium.click(LINK_LOGOUT);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertFalse(selenium.isTextPresent("Logged in as:"), "Not logged in, login message missing.");
+ Assert.assertTrue(selenium.isElementPresent("Link=Login"), "Login link not present.");
+ }
- protected void logoutIfPossible() {
- selenium.open(ADDR_PORTAL);
- selenium.waitForPageToLoad(PAGE_LOAD);
- if (selenium.isElementPresent(LINK_LOGOUT)) {
- selenium.click(LINK_LOGOUT);
- selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertFalse(selenium.isTextPresent("Logged in as:"), "Not logged in, login message missing.");
- Assert.assertTrue(selenium.isElementPresent("Link=Login"), "Login link not present.");
- }
- }
+ protected void logoutIfPossible() {
+ selenium.open(ADDR_PORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ if (selenium.isElementPresent(LINK_LOGOUT)) {
+ selenium.click(LINK_LOGOUT);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertFalse(selenium.isTextPresent("Logged in as:"), "Not logged in, login message missing.");
+ Assert.assertTrue(selenium.isElementPresent("Link=Login"), "Login link not present.");
+ }
+ }
}
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortletUserCreationTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortletUserCreationTestCase.java 2009-02-24 13:39:09 UTC (rev 12879)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortletUserCreationTestCase.java 2009-02-24 14:30:01 UTC (rev 12880)
@@ -9,24 +9,21 @@
@Test(groups = { "portlet_user_creation" }, enabled = true)
public class PortletUserCreationTestCase extends JBossPortalSeleniumTestCase {
- private static final String SUBMIT_CREATE_CONF = "//input[contains(@id,'confirm-form:user')]";
- public static final String SUBMIT_CREATE_CONF_EDIT = "//input[contains(@id,'//input[contains(@id,'confirm-form:revise')]";
+
+ public String casePfx = "user.crea.port.";
+
+ private final String SUBMIT_CREATE_CONF = getProp(casePfx+"submit.create.conf","//input[contains(@id,'confirm-form:user')]");
+ public final String SUBMIT_CREATE_CONF_EDIT = getProp(casePfx+"submit.create.conf.edit","//input[contains(@id,'//input[contains(@id,'confirm-form:revise')]");
+ private final String SUBMIT_CREATE_USER = getProp(casePfx+"submit.create.user","//input[contains(@id,'register-form:submit')]");
+ private final String SUBMIT_CREATE_USER_CANCEL = getProp(casePfx+"submit.create.user.cancel","//input[contains(@id,'register-form:cancel')]");
+ private final String INPUT_USERPASSWDCONF = getProp(casePfx+"input.userpasswdconf","//input[contains(@id,'register-form:passwordCheckv");
+ private final String INPUT_USERPASSWD = getProp(casePfx+"input.userpasswd","//input[contains(@id,'register-form:password')]");
+ private final String INPUT_USERMAIL = getProp(casePfx+"input.usermail","//input[contains(@id,'register-form:email')]");
+ private final String INPUT_USERNAME = getProp(casePfx+"input.username","//input[contains(@id,'register-form:username')]");
+ private final String LINK_CREATE_USER = getProp(casePfx+"link.create.user","//a[contains(@id,'create-account-form:register')]");
+ private final String TAB_WELCOME = getProp(casePfx+"tab.welcome","//a[contains(@id,'register-temp-form:start-link')]");
- private static final String SUBMIT_CREATE_USER = "//input[contains(@id,'register-form:submit')]";
- private static final String SUBMIT_CREATE_USER_CANCEL = "//input[contains(@id,'register-form:cancel')]";
- private static final String INPUT_USERPASSWDCONF = "//input[contains(@id,'register-form:passwordCheckv";
-
- private static final String INPUT_USERPASSWD = "//input[contains(@id,'register-form:password')]";
-
- private static final String INPUT_USERMAIL = "//input[contains(@id,'register-form:email')]";
-
- private static final String INPUT_USERNAME = "//input[contains(@id,'register-form:username')]";
-
- private static final String LINK_CREATE_USER = "//a[contains(@id,'create-account-form:register')]";
-
- private static final String TAB_WELCOME = "//a[contains(@id,'register-temp-form:start-link')]";
-
@Test(enabled = true, description = "Simple user creation.")
public void userCreationTest() {
selenium.open("/portal");
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserLoginTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserLoginTestCase.java 2009-02-24 13:39:09 UTC (rev 12879)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserLoginTestCase.java 2009-02-24 14:30:01 UTC (rev 12880)
@@ -12,7 +12,7 @@
@Test(groups = { "login" }, enabled = true)
public class UserLoginTestCase extends JBossPortalSeleniumTestCase {
- public static final String casePfx = "";
+ public final String casePfx = "user.login.";
private final String ADR_PORTAL = getProp(casePfx+"adr.portal","/portal");
private final String FRM_MAIN = getProp(casePfx+"frm.main","relative=up");
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java 2009-02-24 13:39:09 UTC (rev 12879)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java 2009-02-24 14:30:01 UTC (rev 12880)
@@ -14,39 +14,35 @@
public static String casePfx = "test.wsrp.";
- private static final String INP_CONSUMER_NAME = "//input[contains(@id,'edit-cons-form:id')]";
- private static final String SUBMIT_REFRESH_CANCEL = "//a[contains(@id,'edit-cons-form:list-cons-link')]";
- private static final String SUBMIT_PROD_SAVE = "//input[contains(@id,'producer-form:save-producer')]";
- private static final String SUBMIT_CONSDEL_CONF = "//a[contains(@id,'confirm-delete-form:destroy-link')]";
+ private final String INP_CONSUMER_NAME = getProp(casePfx+"inp.consumer.name","//input[contains(@id,'edit-cons-form:id')]");
+ private final String SUB_REFRESH_CANCEL = getProp(casePfx+"submit.refresh.cancel","//a[contains(@id,'edit-cons-form:list-cons-link')]");
+ private final String SUB_PROD_SAVE = getProp(casePfx+"submit.prod.save","//input[contains(@id,'producer-form:save-producer')]");
+ private final String SUB_CONSDEL_CONF = getProp(casePfx+"submit.consdel.conf","//a[contains(@id,'confirm-delete-form:destroy-link')]");
+ private final String SUB_CONS_REGVAL = getProp(casePfx+"submit.cons.regval","//input[contains(@id,'edit-cons-form:refresh-cons-link')]");
+ private final String SUB_REFRESHFINAL = getProp(casePfx+"submit.refreshfinal","//input[contains(@id,'edit-cons-form:refresh-cons-link')]");
+ private final String INPUT_CONS_REGVALUE = getProp(casePfx+"input.cons.regvalue","//input[contains(@id,'edit-cons-form:existingProps:0:prop-value-input')]");
+ private final String SUBMIT_REFRESHSAVE = getProp(casePfx+"submit.refreshsave","//input[contains(@id,'edit-cons-form:refresh-cons-link')]");
+ private final String INPUT_CONSWSDL = getProp(casePfx+"input.conswsdl","//input[contains(@id,'edit-cons-form:wsdl')]");
+ private final String INPUT_CACHEEXP = getProp(casePfx+"input.cacheexp","//input[contains(@id,'edit-cons-form:cache')]");
+ private final String SUBMIT_ADDPROP_INIT = getProp(casePfx+"submit.addprop.init","//a[contains(@id,'producer-form:add-reg-prop')]");
+ private final String SUBMIT_ADDPROP = getProp(casePfx+"submit.addprop","//a[contains(@id,'producer-form:add-reg-prop')]");
+ private final String INPUT_PROPHINT = getProp(casePfx+"input.prophint","//input[contains(@id,'producer-form:reg-properties:0:hint')]");
+ private final String INPUT_PROPLABEL = getProp(casePfx+"input.proplabel","//input[contains(@id,'producer-form:reg-properties:0:label')]");
+ private final String INPUT_PROPNAME = getProp(casePfx+"input.propname","//input[contains(@id,'producer-form:reg-properties:0:name')]");
+ private final String SUBMIT_CREATECONS = getProp(casePfx+"submit.createcons","//input[contains(@id,'createConsumer:createConsumerButton')]");
+ private final String INPUT_CREATECONS = getProp(casePfx+"input.createcons","//input[contains(@id,'createConsumer:consumerName')]");
+ private final String ID_LINK_PRODCONF = getProp(casePfx+"id.link.prodconf","//a[contains(@id,'cons-temp-form:producer-link')]");
+ private final String ID_LINK_CONSCONF = getProp(casePfx+"id.link.consconf","//a[contains(@id,'producer-temp-form:consumersTab')]");
+ private final String LINK_CONSUMER_HOME =getProp(casePfx+"link.consumer.home","//a[contains(@id,'cons-temp-form1:list-cons-link')]");
+ private final String LINK_T_CONS_CON=getProp(casePfx+"link.t.cons.con","//a[contains(@id,''consumer-list-form:consumersList:{0}:configure'')]");
+ private final String LINK_T_CONS_REF=getProp(casePfx+"link.t.cons.ref","//a[contains(@id,''consumer-list-form:consumersList:{0}:refresh'')]");
+ private final String LINK_T_CONS_ACT=getProp(casePfx+"link.t.cons.act","//a[contains(@id,''consumer-list-form:consumersList:{0}:activate'')]");
+ private final String LINK_T_CONS_DEA=getProp(casePfx+"link.t.cons.dea","//a[contains(@id,''consumer-list-form:consumersList:{0}:activate'')]");
+ private final String LINK_T_CONS_REG=getProp(casePfx+"link.t.cons.reg","//a[contains(@id,''consumer-list-form:consumersList:{0}:register'')]");
+ private final String LINK_T_CONS_DER=getProp(casePfx+"link.t.cons.der","//a[contains(@id,''consumer-list-form:consumersList:{0}:register'')]");
+ private final String LINK_T_CONS_DEL=getProp(casePfx+"link.t.cons.del","//a[contains(@id,''consumer-list-form:consumersList:{0}:delete'')]");
+ private final String WSRP_CONSUMER_TABLE = getProp(casePfx+"link.wsrp.consumer.table","//table[contains(@id,':consumer-list-form:consumersList')]");
- private static final String SUBMIT_CONS_REGVAL = "//input[contains(@id,'edit-cons-form:refresh-cons-link')]";
- private static final String SUBMIT_REFRESHFINAL = "//input[contains(@id,'edit-cons-form:refresh-cons-link')]";
-
- private static final String INPUT_CONS_REGVALUE = "//input[contains(@id,'edit-cons-form:existingProps:0:prop-value-input')]";
- private static final String SUBMIT_REFRESHSAVE = "//input[contains(@id,'edit-cons-form:refresh-cons-link')]";
- private static final String INPUT_CONSWSDL = "//input[contains(@id,'edit-cons-form:wsdl')]";
- private static final String INPUT_CACHEEXP = "//input[contains(@id,'edit-cons-form:cache')]";
- private static final String SUBMIT_ADDPROP_INIT = "//a[contains(@id,'producer-form:add-reg-prop')]";
- private static final String SUBMIT_ADDPROP = "//a[contains(@id,'producer-form:add-reg-prop')]";
- private static final String INPUT_PROPHINT = "//input[contains(@id,'producer-form:reg-properties:0:hint')]";
- private static final String INPUT_PROPLABEL = "//input[contains(@id,'producer-form:reg-properties:0:label')]";
- private static final String INPUT_PROPNAME = "//input[contains(@id,'producer-form:reg-properties:0:name')]";
- private static final String SUBMIT_CREATECONS = "//input[contains(@id,'createConsumer:createConsumerButton')]";
- private static final String INPUT_CREATECONS = "//input[contains(@id,'createConsumer:consumerName')]";
- private static final String ID_LINK_PRODCONF = "//a[contains(@id,'cons-temp-form:producer-link')]";
- private static final String ID_LINK_CONSCONF = "//a[contains(@id,'producer-temp-form:consumersTab')]";
- private static final String LINK_CONSUMER_HOME ="//a[contains(@id,'cons-temp-form1:list-cons-link')]";
-
- private static final String LINK_T_CONS_CON="//a[contains(@id,''consumer-list-form:consumersList:{0}:configure'')]";
- private static final String LINK_T_CONS_REF="//a[contains(@id,''consumer-list-form:consumersList:{0}:refresh'')]";
- private static final String LINK_T_CONS_ACT="//a[contains(@id,''consumer-list-form:consumersList:{0}:activate'')]";
- private static final String LINK_T_CONS_DEA="//a[contains(@id,''consumer-list-form:consumersList:{0}:activate'')]";
- private static final String LINK_T_CONS_REG="//a[contains(@id,''consumer-list-form:consumersList:{0}:register'')]";
- private static final String LINK_T_CONS_DER="//a[contains(@id,''consumer-list-form:consumersList:{0}:register'')]";
- private static final String LINK_T_CONS_DEL="//a[contains(@id,''consumer-list-form:consumersList:{0}:delete'')]";
-
- public static String WSRP_CONSUMER_TABLE = "//table[contains(@id,':consumer-list-form:consumersList')]";
-
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
logoutIfPossible();
@@ -81,10 +77,10 @@
Assert.assertTrue(selenium.isTextPresent("Missing value"));
selenium.type(INPUT_CONS_REGVALUE, "public");
- selenium.click(SUBMIT_CONS_REGVAL);
+ selenium.click(SUB_CONS_REGVAL);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Refresh was successful."));
- selenium.click(SUBMIT_REFRESHFINAL);
+ selenium.click(SUB_REFRESHFINAL);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("BEA"));
}
@@ -130,7 +126,7 @@
selenium.click(MessageFormat.format(LINK_T_CONS_DER,r));
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click(SUBMIT_REFRESH_CANCEL);
+ selenium.click(SUB_REFRESH_CANCEL);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertEquals(selenium.getText(MessageFormat.format(LINK_T_CONS_DER,r)), "Register");
@@ -210,7 +206,7 @@
Assert.assertTrue(selenium.isTextPresent("Delete 'BEAdel' consumer?"));
- clickAndWait(SUBMIT_CONSDEL_CONF);
+ clickAndWait(SUB_CONSDEL_CONF);
Assert.assertFalse(selenium.isTextPresent("BEAdel"));
}
@@ -232,7 +228,7 @@
selenium.type(INPUT_PROPLABEL, "testProp label");
selenium.type(INPUT_PROPHINT, "tetsPropHint");
- selenium.click(SUBMIT_PROD_SAVE);
+ selenium.click(SUB_PROD_SAVE);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Producer configuration successfully saved!"));
@@ -311,10 +307,10 @@
selenium.waitForPageToLoad(PAGE_LOAD);
waitForElement(INPUT_CONS_REGVALUE);
selenium.type(INPUT_CONS_REGVALUE, "public");
- selenium.click(SUBMIT_CONS_REGVAL);
+ selenium.click(SUB_CONS_REGVAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click(SUBMIT_REFRESHFINAL);
+ selenium.click(SUB_REFRESHFINAL);
selenium.waitForPageToLoad(PAGE_LOAD);
}
}
\ No newline at end of file
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java 2009-02-24 13:39:09 UTC (rev 12879)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java 2009-02-24 14:30:01 UTC (rev 12880)
@@ -24,13 +24,16 @@
System.setProperty("workspace", "/home/vrockai/workspace/p2.7tests/ui-tests/");
}
*/
- private static final String SUB_CANCEL_ARCH_UPLOAD = "cancel";
- private static final String LNK_ADMIN = "link=Admin";
- private static final String LNK_CMS = "link=CMS";
- private static final String SUB_SEND_ARCHIVE = "submit";
- private static final String INP_ARCHIVE_FILE = "response";
- private static final String DIV_ARCHIVE_STATUS = "//div[@id='center']/div/div/table/tbody/tr[2]/td/font";
- private static final String SEL_ACTION = "//div[@id='center']/div/div/div[1]/div/select";
+
+ private final String casePfx = "cms.arch.";
+ private final String SUB_CANCEL_ARCH_UPLOAD = getProp(casePfx+"sub.cancel.arch.upload","cancel");
+ private final String LNK_ADMIN = getProp(casePfx+"lnk.admin","link=Admin");
+ private final String LNK_CMS = getProp(casePfx+"lnk.cms","link=CMS");
+ private final String SUB_SEND_ARCHIVE = getProp(casePfx+"sub.send.archive","submit");
+ private final String INP_ARCHIVE_FILE = getProp(casePfx+"inp.archive.file","response");
+ private final String DIV_ARCHIVE_STATUS = getProp(casePfx+"div.archive.status","//div[@id='center']/div/div/table/tbody/tr[2]/td/font");
+ private final String SEL_ACTION = getProp(casePfx+"sel.action","//div[@id='center']/div/div/div[1]/div/select");
+
private final String WORKSPACE = System.getProperty("workspace");
@BeforeMethod(groups = { "log" })
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSDirectoryTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSDirectoryTestCase.java 2009-02-24 13:39:09 UTC (rev 12879)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSDirectoryTestCase.java 2009-02-24 14:30:01 UTC (rev 12880)
@@ -12,17 +12,18 @@
@Test(groups = { "cms_directory" }, enabled = true)
public class CMSDirectoryTestCase extends JBossPortalSeleniumTestCase {
+ private final String casePfx = "cms.dir.";
+ private final String SEL_CMS_ACTION = getProp(casePfx + "sel.cms.action", "//div[@id='center']/div/div/div[1]/div/select");
+ private final String ADR_CMS_INTERFACE = getProp(casePfx + "adr.cms.interface", "/portal/auth/portal/admin/CMS");
- private static final String SEL_CMS_ACTION = "//div[@id='center']/div/div/div[1]/div/select";
- private static final String ADR_CMS_INTERFACE = "/portal/auth/portal/admin/CMS";
private final String defaultDirName = "default";
private final String tempDirName = "tempDir";
private final String copyDirName = "copySrc";
private final String moveDirName = "moveSrc";
- private final String CMS_FILE_TABLE = "//div[@id='center']/div/div/div[3]/table";
+ private final String CMS_FILE_TABLE = getProp(casePfx + "cms.file.table", "//div[@id='center']/div/div/div[3]/table");
- @BeforeMethod( groups = { "log" })
+ @BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
logoutIfPossible();
login("admin", "admin");
@@ -33,11 +34,11 @@
}
- @Test(enabled = true, description="Directory creation.")
+ @Test(enabled = true, description = "Directory creation.")
public void testCreateDirectory() {
-
+
// cancelling of creating
-
+
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=CMS");
@@ -45,7 +46,7 @@
selenium.open(ADR_CMS_INTERFACE);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
Assert.assertFalse(selenium.isTextPresent(tempDirName), "Test folder is already present.");
selenium.select(SEL_CMS_ACTION, "label=Create Folder");
@@ -54,11 +55,11 @@
selenium.type("newcollectionname", tempDirName);
selenium.type("newcollectiondescription", "test folder");
selenium.click("cancel");
-
+
// really creating
selenium.open(ADDR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=CMS");
@@ -66,7 +67,7 @@
selenium.open(ADR_CMS_INTERFACE);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
Assert.assertFalse(selenium.isTextPresent(tempDirName), "Test folder is already present.");
selenium.select(SEL_CMS_ACTION, "label=Create Folder");
@@ -75,9 +76,9 @@
selenium.type("newcollectionname", tempDirName);
selenium.type("newcollectiondescription", "test folder");
selenium.click("submit");
-
+
// assuring that the directory is deleted
-
+
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isElementPresent("//div[@id='center']/div/div/ul/li[3]"));
Assert.assertEquals(tempDirName, selenium.getText("//div[@id='center']/div/div/ul/li[3]"));
@@ -87,16 +88,16 @@
}
- @Test(enabled = true, dependsOnMethods = "testCreateDirectory",description="Directory delete.")
+ @Test(enabled = true, dependsOnMethods = "testCreateDirectory", description = "Directory delete.")
public void testDeleteDirectory() {
-
+
// firstly cancel the delete process
-
+
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=CMS");
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
Assert.assertTrue(selenium.isElementPresent("link=" + tempDirName));
selenium.select(takeAction(tempDirName) + "/select", "label=Delete");
selenium.click(takeAction(tempDirName) + "/select/option[4]");
@@ -109,10 +110,10 @@
Assert.assertTrue(selenium.isTextPresent("Are you sure you want to delete this resource?"));
selenium.click("cancel");
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
// really deleting
selenium.open(ADDR_PORTAL);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=CMS");
@@ -133,16 +134,16 @@
// assuring that the deletition was processed
selenium.open(ADDR_PORTAL);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=CMS");
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
Assert.assertFalse(selenium.isElementPresent("link=" + tempDirName));
}
- @Test(enabled = true, dependsOnMethods = "testCreateDirectory",description="Copying of directory.")
+ @Test(enabled = true, dependsOnMethods = "testCreateDirectory", description = "Copying of directory.")
public void testCopyDirectory() {
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -185,9 +186,9 @@
}
- @Test(enabled = true, dependsOnMethods = "testCreateDirectory",description="Canceling of copying of directory.")
+ @Test(enabled = true, dependsOnMethods = "testCreateDirectory", description = "Canceling of copying of directory.")
public void testCopyCancelDirectory() {
- String copyCancelDirName = "L"+ "copyLDirName" + "Cancel";
+ String copyCancelDirName = "L" + "copyLDirName" + "Cancel";
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -226,9 +227,9 @@
}
- @Test(enabled = true, dependsOnMethods = "testCreateDirectory",description="Moving a directory.")
+ @Test(enabled = true, dependsOnMethods = "testCreateDirectory", description = "Moving a directory.")
public void testMoveDirectory() {
- //selenium.setSpeed("3000");
+ // selenium.setSpeed("3000");
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=CMS");
@@ -273,7 +274,7 @@
}
- @Test(enabled = true, dependsOnMethods = "testCreateDirectory", description="Canceling of moving a directory.")
+ @Test(enabled = true, dependsOnMethods = "testCreateDirectory", description = "Canceling of moving a directory.")
public void testMoveCancelDirectory() {
String moveCancelDirName = "X" + "moveXDirName" + "Cancel";
@@ -311,10 +312,10 @@
selenium.click("link=Home");
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.click("link=" + defaultDirName);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
Assert.assertFalse(selenium.isElementPresent("link=" + moveCancelDirName));
}
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileTestCase.java 2009-02-24 13:39:09 UTC (rev 12879)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileTestCase.java 2009-02-24 14:30:01 UTC (rev 12880)
@@ -13,9 +13,11 @@
@Test(groups = { "cms_file" }, enabled = true)
public class CMSFileTestCase extends JBossPortalSeleniumTestCase {
- private static final String TBL_CMS_FILEVER = "//div[@id='center']/div/div/table";
- public static final String TBL_CMS_FILE = "//div[@id='center']/div/div/div[3]/table";
- public static final String TBL_FILE_PENDING = "//div[@id='center']/div/div/table[2]";
+ private final String casePfx = "cms.file.";
+
+ private final String TBL_CMS_FILEVER = getProp(casePfx+"tbl.cms.filever","//div[@id='center']/div/div/table");
+ public final String TBL_CMS_FILE = getProp(casePfx+"tbl.cms.file","//div[@id='center']/div/div/div[3]/table");
+ public final String TBL_FILE_PENDING = getProp(casePfx+"tbl.file.pending","//div[@id='center']/div/div/table[2]");
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileUploadTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileUploadTestCase.java 2009-02-24 13:39:09 UTC (rev 12879)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileUploadTestCase.java 2009-02-24 14:30:01 UTC (rev 12880)
@@ -19,7 +19,9 @@
System.setProperty("workspace","/home/vrockai/workspace/selenium/selenium/"
); }
*/
- private final String CMS_FILE_TABLE = "//div[@id='center']/div/div/div[3]/table";
+ private final String casePfx = "cms.file.up.";
+
+ private final String CMS_FILE_TABLE = getProp(casePfx+"cms.file.table","//div[@id='center']/div/div/div[3]/table");
private final String WORKSPACE = System.getProperty("workspace");
@BeforeMethod(groups = { "log" })
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowTestCase.java 2009-02-24 13:39:09 UTC (rev 12879)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowTestCase.java 2009-02-24 14:30:01 UTC (rev 12880)
@@ -12,18 +12,15 @@
@Test(groups = { "cms_file_workflow" }, enabled = true)
public class CMSFileWorkflowTestCase extends JBossPortalSeleniumTestCase {
+ public final String casePfx = "cms.file.work.";
- private static final String SELECT_CMS_MAIN = "//div[@id='center']/div/div/div[1]/div/select";
+ public final String SELECT_CMS_MAIN = getProp(casePfx+"select.cms.main","//div[@id='center']/div/div/div[1]/div/select");
+ public final String CMS_FILE_TABLE = getProp(casePfx+"cms.file.table","//div[@id='center']/div/div/div[3]/table");
+ public final String CMS_WF_TABLE = getProp(casePfx+"cms.wf.table","//div[@id='center']/div/div/table[2]");
+ public final String CMS_FV_TABLE = getProp(casePfx+"cms.fv.table","//div[@id='center']/div/div/table");
+ public final String WYSIWYG_EDITOR_LOCATOR = getProp(casePfx+"wysiwyg.editor.locator","mce_editor_0");
- private final String CMS_FILE_TABLE = "//div[@id='center']/div/div/div[3]/table";
- // file workflow table in CMS
- private final String CMS_WF_TABLE = "//div[@id='center']/div/div/table[2]";
-
- // file version table in CMS
- private final String CMS_FV_TABLE = "//div[@id='center']/div/div/table";
- public static String WYSIWYG_EDITOR_LOCATOR = "mce_editor_0";
-
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
logoutIfPossible();
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java 2009-02-24 13:39:09 UTC (rev 12879)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java 2009-02-24 14:30:01 UTC (rev 12880)
@@ -10,29 +10,30 @@
import org.testng.annotations.Test;
/**
- * @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
+ * @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
*/
@Test(groups = { "cms_secure" }, enabled = true, description = "Setting permissions on the default portlet.")
public class CMSSecureTestCase extends JBossPortalSeleniumTestCase {
+ private final String casePfx = "cms.sec.";
- private static final String LNK_EXPLORE = "//area[@href='/portal/content/default/epp.html']";
- private static final String LNK_CMS_EXPLORE = "Link=epp.html";
- private static final String LNK_MEMBERS = "link=Members";
- private static final String SUB_SECURITY_SET = "//input[contains(@name,'submit')]";
- private static final String SEL_SECUREUSERS_MANAGE = "//select[contains(@name,'secureusers:manage')]";
- private static final String SEL_SECUREROLES_MANAGE = "//select[contains(@name,'secureroles:manage')]";
- private static final String SEL_SECUREUSERS_WRITE = "//select[contains(@name,'secureusers:write')]";
- private static final String SEL_SECUREROLES_WRITE = "//select[contains(@name,'secureroles:write')]";
- private static final String SEL_SECUREUSERS_READ = "//select[contains(@name,'secureusers:read')]";
- private static final String SEL_SECUREROLES_READ = "//select[contains(@name,'secureroles:read')]";
- private static final String LNK_INDEX_HTML = "link=index.html";
- private static final String LNK_DEFAULT = "link=default";
- private static final String LNK_CMS = "link=CMS";
- private static final String LNK_ADMIN = "link=Admin";
- private static final String LNK_LOGOUT = "link=Logout";
- private static final String SEL_CMS_ACTION = "//div[@id='center']/div/div/div[1]/div/select";
-
+ private final String LNK_EXPLORE = getProp(casePfx + "lnk.explore", "//area[@href='/portal/content/default/epp.html']");
+ private final String LNK_CMS_EXPLORE = getProp(casePfx + "lnk.cms.explore", "Link=epp.html");
+ private final String LNK_MEMBERS = getProp(casePfx + "lnk.members", "link=Members");
+ private final String SUB_SECURITY_SET = getProp(casePfx + "sub.security.set", "//input[contains(@name,'submit')]");
+ private final String SEL_SECUREUSERS_MANAGE = getProp(casePfx + "sel.secureusers.manage", "//select[contains(@name,'secureusers:manage')]");
+ private final String SEL_SECUREROLES_MANAGE = getProp(casePfx + "sel.secureroles.manage", "//select[contains(@name,'secureroles:manage')]");
+ private final String SEL_SECUREUSERS_WRITE = getProp(casePfx + "sel.secureusers.write", "//select[contains(@name,'secureusers:write')]");
+ private final String SEL_SECUREROLES_WRITE = getProp(casePfx + "sel.secureroles.write", "//select[contains(@name,'secureroles:write')]");
+ private final String SEL_SECUREUSERS_READ = getProp(casePfx + "sel.secureusers.read", "//select[contains(@name,'secureusers:read')]");
+ private final String SEL_SECUREROLES_READ = getProp(casePfx + "sel.secureroles.read", "//select[contains(@name,'secureroles:read')]");
+ private final String LNK_INDEX_HTML = getProp(casePfx + "lnk.index.html", "link=index.html");
+ private final String LNK_DEFAULT = getProp(casePfx + "lnk.default", "link=default");
+ private final String LNK_CMS = getProp(casePfx + "lnk.cms", "link=CMS");
+ private final String LNK_ADMIN = getProp(casePfx + "lnk.admin", "link=Admin");
+ private final String LNK_LOGOUT = getProp(casePfx + "lnk.logout", "link=Logout");
+ private final String SEL_CMS_ACTION = getProp(casePfx + "sel.cms.action", "//div[@id='center']/div/div/div[1]/div/select");
+
public String caseIPfx = "iden.man.";
public final String LNK_ROLETAB = getProp(caseIPfx + "lnk.roletab", "//a[contains(@id,'user-temp-form:role-mgm-link')]");
public final String LNK_ROLEMAIN = getProp(caseIPfx + "lnk.rolemain", "//a[contains(@id, 'role-temp-form1:role-admin-link')]");
@@ -49,7 +50,9 @@
public final String INP_SEARCH_USER = getProp(caseIPfx + "inp.search.user", "//input[contains(@id,'search-user-form:searchString')]");
public final String LNK_SEARCH_USER = getProp(caseIPfx + "lnk.search.user", "//a[contains(@id,'user-form:search-user-link')]");
public final String TBL_USERLIST = getProp(caseIPfx + "tbl.userlist", "//table[contains(@id,'search-user-form1:userlist')]");
- public final String LNK_T_USRLIST_ROLES = getProp(caseIPfx + "lnk.t.usrlist.roles", "//a[contains(@id,''search-user-form1:userlist:{0}:assign-role-link'')]");
+ public final String LNK_T_USRLIST_ROLES = getProp(caseIPfx + "lnk.t.usrlist.roles",
+ "//a[contains(@id,''search-user-form1:userlist:{0}:assign-role-link'')]");
+
@AfterMethod(groups = { "log" })
public void logoutAfterTestIfPossible() {
@@ -314,7 +317,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Enteprise Portal Platform"));
Assert.assertFalse(selenium.isElementPresent("//img[@alt='JBoss Portal 2.7: Go Faster!']"));
-
+
login("admin", "admin");
selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties 2009-02-24 13:39:09 UTC (rev 12879)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties 2009-02-24 14:30:01 UTC (rev 12880)
@@ -1,3 +1,25 @@
+# JBossPortalSeleniumTestCase
+
+portal.link.logout=link=Logout
+portal.submit.login=login
+portal.addr.portal=/portal/
+portal.frame.login.content=login-content
+portal.link.login=link=Login
+portal.input.password=j_password
+portal.input.username=j_username
+
+# UserLoginTestCase
+
+user.login.adr.portal=/portal
+user.login.frm.main=relative=up
+user.login.sub.portal=cancel
+user.login.adr.portal=link=Logout
+user.login.adr.portal=login
+user.login.adr.portal=xpath=id('j_password')
+user.login.adr.portal=xpath=id('j_username')
+user.login.adr.portal=login-content
+user.login.adr.portal=link=Login
+
# IdentityAdminTestCase
iden.man.sel.searchuser.limit=//select[contains(@id,'search-user-form:limit')]
@@ -52,7 +74,279 @@
iden.man.lnk.create.user=//a[contains(@id,':user-form:create-user-link')]
iden.man.chk.role=//input[contains(@name,''assign-roles-form:roles'') and @value=''{0}'']
+# DashboardTestCase
+dash.sub.layout.update=//input[contains(@name,'dashboardLayoutForm:j_id12')]
+dash.sub.page.rename=//form[contains(@id,'renameForm')]/input[@type='submit']
+dash.inp.page.rename=//input[contains(@id,'renameForm:newName')]
+dash.link.weather.portlet=link=*WeatherPortlet*
+dash.link.portl2=link=*Who's online portlet*
+dash.link.portl1=link=*Welcome portlet*
+dash.opt.portl2=CurrentUsersPortletWindow
+dash.opt.portl1=JSPPortletWindow
+dash.sel.content.type=//select[contains(@id,'contentTypesForm:instanceId')]
+dash.sub.del.from.center.region=//input[contains(@id,'layoutForm:l_center')]
+dash.sub.down.center.region=//input[contains(@id,'layoutForm:d_center')]
+dash.sub.up.center.region=//input[contains(@id,'layoutForm:u_center')]
+dash.sel.center.region=//select[contains(@id,'layoutForm:selectMany_center')]
+dash.sub.addcenter=//input[contains(@id,'layoutForm:a_center')]
+dash.sub.addleft=//input[contains(@id,'layoutForm:a_left')]
+dash.lnk.configure.dashboard=link=Configure dashboard
+dash.lnk.dashboard=link=Dashboard
+dash.sel.page=//select[contains(@id,'pageNameSelector')]
+dash.inp.pagename=//input[contains(@id,':pageName')]
+dash.sub.createpage=//form[contains(@id,'j_id3')]/input[@type='submit']
+dash.sel.layout=//select[contains(@id,'dashboardLayoutForm:layoutSelector')]
+dash.sel.theme=//select[contains(@id,'dashboardThemeForm:themeSelector')]
+dash.sub.themesel=//form[contains(@id,'dashboardThemeForm')]/input[@type='submit']
+
+# PortletUserCreationTestCase
+
+user.crea.port.submit.create.conf=//input[contains(@id,'confirm-form:user')]
+user.crea.port.submit.create.conf.edit=//input[contains(@id,'//input[contains(@id,'confirm-form:revise')]
+user.crea.port.submit.create.user=//input[contains(@id,'register-form:submit')]
+user.crea.port.submit.create.user.cancel=//input[contains(@id,'register-form:cancel')]
+user.crea.port.input.userpasswdconf=//input[contains(@id,'register-form:passwordCheckv
+user.crea.port.input.userpasswd=//input[contains(@id,'register-form:password')]
+user.crea.port.input.usermail=//input[contains(@id,'register-form:email')]
+user.crea.port.input.username=//input[contains(@id,'register-form:username')]
+user.crea.port.link.create.user=//a[contains(@id,'create-account-form:register')]
+user.crea.port.tab.welcome=//a[contains(@id,'register-temp-form:start-link')]
+
+# WSRPTestCase
+
+test.wsrp.inp.consumer.name=//input[contains(@id,'edit-cons-form:id')]
+test.wsrp.submit.refresh.cancel=//a[contains(@id,'edit-cons-form:list-cons-link')]
+test.wsrp.submit.prod.save=//input[contains(@id,'producer-form:save-producer')]
+test.wsrp.submit.consdel.conf=//a[contains(@id,'confirm-delete-form:destroy-link')]
+test.wsrp.submit.cons.regval=//input[contains(@id,'edit-cons-form:refresh-cons-link')]
+test.wsrp.submit.refreshfinal=//input[contains(@id,'edit-cons-form:refresh-cons-link')]
+test.wsrp.input.cons.regvalue=//input[contains(@id,'edit-cons-form:existingProps:0:prop-value-input')]
+test.wsrp.submit.refreshsave=//input[contains(@id,'edit-cons-form:refresh-cons-link')]
+test.wsrp.input.conswsdl=//input[contains(@id,'edit-cons-form:wsdl')]
+test.wsrp.input.cacheexp=//input[contains(@id,'edit-cons-form:cache')]
+test.wsrp.submit.addprop.init=//a[contains(@id,'producer-form:add-reg-prop')]
+test.wsrp.submit.addprop=//a[contains(@id,'producer-form:add-reg-prop')]
+test.wsrp.input.prophint=//input[contains(@id,'producer-form:reg-properties:0:hint')]
+test.wsrp.input.proplabel=//input[contains(@id,'producer-form:reg-properties:0:label')]
+test.wsrp.input.propname=//input[contains(@id,'producer-form:reg-properties:0:name')]
+test.wsrp.submit.createcons=//input[contains(@id,'createConsumer:createConsumerButton')]
+test.wsrp.input.createcons=//input[contains(@id,'createConsumer:consumerName')]
+test.wsrp.id.link.prodconf=//a[contains(@id,'cons-temp-form:producer-link')]
+test.wsrp.id.link.consconf=//a[contains(@id,'producer-temp-form:consumersTab')]
+test.wsrp.link.consumer.home=//a[contains(@id,'cons-temp-form1:list-cons-link')]
+test.wsrp.link.t.cons.con=//a[contains(@id,''consumer-list-form:consumersList:{0}:configure'')]
+test.wsrp.link.t.cons.ref=//a[contains(@id,''consumer-list-form:consumersList:{0}:refresh'')]
+test.wsrp.link.t.cons.act=//a[contains(@id,''consumer-list-form:consumersList:{0}:activate'')]
+test.wsrp.link.t.cons.dea=//a[contains(@id,''consumer-list-form:consumersList:{0}:activate'')]
+test.wsrp.link.t.cons.reg=//a[contains(@id,''consumer-list-form:consumersList:{0}:register'')]
+test.wsrp.link.t.cons.der=//a[contains(@id,''consumer-list-form:consumersList:{0}:register'')]
+test.wsrp.link.t.cons.del=//a[contains(@id,''consumer-list-form:consumersList:{0}:delete'')]
+test.wsrp.link.wsrp.consumer.table=//table[contains(@id,':consumer-list-form:consumersList')]
+
+# CMSArchiveUploadTestCase
+
+cms.arch.sub.cancel.arch.upload=cancel
+cms.arch.lnk.admin=link=Admin
+cms.arch.lnk.cms=link=CMS
+cms.arch.sub.send.archive=submit
+cms.arch.inp.archive.file=response
+cms.arch.div.archive.status=//div[@id='center']/div/div/table/tbody/tr[2]/td/font
+cms.arch.sel.action=//div[@id='center']/div/div/div[1]/div/select
+
+# CMSDirectoryTestCase
+
+cms.dir.sel.cms.action=//div[@id='center']/div/div/div[1]/div/select
+cms.dir.adr.cms.interface=/portal/auth/portal/admin/CMS
+cms.dir.cms.file.table=//div[@id='center']/div/div/div[3]/table
+
+# CMSFileTestCase
+
+cms.file.tbl.cms.filever=//div[@id='center']/div/div/table
+cms.file.tbl.cms.file=//div[@id='center']/div/div/div[3]/table
+cms.file.tbl.file.pending=//div[@id='center']/div/div/table[2]
+
+# CMSFileUploadTestCase
+
+cms.file.up.cms.file.table=//div[@id='center']/div/div/div[3]/table
+
+# CMSFileWorkflowTestCase
+
+cms.file.work.select.cms.main=//div[@id='center']/div/div/div[1]/div/select
+cms.file.work.cms.file.table=//div[@id='center']/div/div/div[3]/table
+cms.file.work.cms.wf.table=//div[@id='center']/div/div/table[2]
+cms.file.work.cms.fv.table=//div[@id='center']/div/div/table
+cms.file.work.wysiwyg.editor.locator=mce_editor_0
+
+# CMSSecureTestCase
+
+cms.sec.lnk.explore=//area[@href='/portal/content/default/epp.html']
+cms.sec.lnk.cms.explore=Link=epp.html
+cms.sec.lnk.members=link=Members
+cms.sec.sub.security.set=//input[contains(@name,'submit')]
+cms.sec.sel.secureusers.manage=//select[contains(@name,'secureusers:manage')]
+cms.sec.sel.secureroles.manage=//select[contains(@name,'secureroles:manage')]
+cms.sec.sel.secureusers.write=//select[contains(@name,'secureusers:write')]
+cms.sec.sel.secureroles.write=//select[contains(@name,'secureroles:write')]
+cms.sec.sel.secureusers.read=//select[contains(@name,'secureusers:read')]
+cms.sec.sel.secureroles.read=//select[contains(@name,'secureroles:read')]
+cms.sec.lnk.index.html=link=index.html
+cms.sec.lnk.default=link=default
+cms.sec.lnk.cms=link=CMS
+cms.sec.lnk.admin=link=Admin
+cms.sec.lnk.logout=link=Logout
+cms.sec.sel.cms.action=//div[@id='center']/div/div/div[1]/div/select
+
+# AdminPortalTestCase
+
+portal.admin.sub.layout.add.center=//input[contains(@id,'layoutForm:a_center')]
+portal.admin.inp.window.name=//input[contains(@id,'windowForm:windowName')]
+portal.admin.submit.rename.portal=//input[contains(@id,'renameForm:rename')]
+portal.admin.input.rename.portal=//input[contains(@id,'renameForm:newName')]
+portal.admin.submit.delete.portal.conf=//input[contains(@id,'delete-view:confirm-form:delete')]
+portal.admin.input.submit.pagecreate=//input[contains(@id,'create-page-form:create-page')]
+portal.admin.input.pagename=//input[contains(@id,'create-page-form:pageName')]
+portal.admin.input.portalname=//input[contains(@id,'create-portal-form:name')]
+portal.admin.input.submit.createportal=//input[contains(@id,'create-portal-form:create-portal')]
+portal.admin.tab.portalobj.id=Link=Admin
+portal.admin.link.portals.id=link=*Portal Objects*
+portal.admin.link.portal.home=//a[contains(@id,'obj-temp-form:object-link-0')]
+portal.admin.table.portal.admin=//table[contains(@id,'obj-nav-form:portal-datatable')]
+portal.admin.por.tl.main=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:object-iid-link'')]
+portal.admin.por.tl.security=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:security-link'')]
+portal.admin.por.tl.properties=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:prop-link'')]
+portal.admin.por.tl.theme=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:theme-link'')]
+portal.admin.por.tl.rename=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:rename'')]
+portal.admin.por.tl.delete=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:delete'')]
+portal.admin.por.tl.makedef=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:default-link'')]
+portal.admin.table.portalpage.admin=//table[contains(@id,'obj-nav-form:pages-datatable')]
+portal.admin.pag.tl.main=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:object-link'')]
+portal.admin.pag.tl.layout=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:edit-page-layout'')]
+portal.admin.pag.tl.security=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:security-link'')]
+portal.admin.pag.tl.properties=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:prop-link'')]
+portal.admin.pag.tl.theme=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:theme-link'')]
+portal.admin.pag.tl.rename=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-link'')]
+portal.admin.pag.tl.display=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-display'')]
+portal.admin.pag.tl.delete=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:delete-link'')]
+portal.admin.pag.tl.makedef=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:default-link'')]
+
+portal.admin.lnk.pp.prop.delete=//a[contains(@id,''common-manage-prop-form:prop-data-table:{0}:delete'')]
+portal.admin.sub.pp.propval.update=//input[contains(@id,'common-manage-prop-form:update')]
+portal.admin.inp.pp.prop.val=//input[contains(@id,''common-manage-prop-form:prop-data-table:{0}:prop-value-input'')]
+portal.admin.sub.ppa.form.update=//input[contains(@id,'common-edit-page-error-form:update')]
+portal.admin.inp.ppa.res.select=//input[contains(@id,'common-edit-page-error-form:page-res-select')]
+portal.admin.sel.ppa.nf.select=//select[contains(@id,'common-edit-page-error-form:page-not-found-select')]
+portal.admin.sel.ppa.internal.select=//select[contains(@id,'common-edit-page-error-form:page-internal-select')]
+portal.admin.sel.ppa.error.select=//select[contains(@id,'common-edit-page-error-form:page-error-select')]
+portal.admin.sel.ppa.control.select=//select[contains(@id,'common-edit-page-error-form:page-control-select')]
+portal.admin.sel.ppa.access.select=//select[contains(@id,'common-edit-page-error-form:page-access-select')]
+portal.admin.chk.ppa.res.check=//input[contains(@id,'common-edit-page-error-form:page-res-check')]
+portal.admin.chk.ppa.nf.check=//input[contains(@id,'common-edit-page-error-form:page-not-found-check')]
+portal.admin.chk.ppa.internal.check=//input[contains(@id,'common-edit-page-error-form:page-internal-check')]
+portal.admin.chk.ppa.error.check=//input[contains(@id,'common-edit-page-error-form:page-error-check')]
+portal.admin.chk.ppa.control.check=//input[contains(@id,'common-edit-page-error-form:page-control-check')]
+portal.admin.chk.ppa.access.check=//input[contains(@id,'common-edit-page-error-form:page-access-check')]
+portal.admin.sub.pp.error.form.update=//input[contains(@id,'common-edit-portal-error-form:update')]
+portal.admin.inp.pp.res.input=//input[contains(@id,'common-edit-portal-error-form:portal-res-input')]
+portal.admin.sel.pp.nf.select=//select[contains(@id,'common-edit-portal-error-form:portal-not-found-select')]
+portal.admin.sel.pp.internal.select=//select[contains(@id,'common-edit-portal-error-form:portal-internal-select')]
+portal.admin.sel.pp.error.select=//select[contains(@id,'common-edit-portal-error-form:portal-error-select')]
+portal.admin.sel.pp.unavail.select=//select[contains(@id,'common-edit-portal-error-form:portal-unavail-select')]
+portal.admin.sel.pp.access.select=//select[contains(@id,'common-edit-portal-error-form:portal-access-select')]
+portal.admin.chk.pp.res.check=//input[contains(@id,'common-edit-portal-error-form:portal-res-check')]
+portal.admin.chk.pp.nf.check=//input[contains(@id,'common-edit-portal-error-form:portal-not-found-check')]
+portal.admin.chk.pp.internal.check=//input[contains(@id,'common-edit-portal-error-form:portal-internal-check')]
+portal.admin.chk.pp.error.check=//input[contains(@id,'common-edit-portal-error-form:portal-error-check')]
+portal.admin.chk.pp.access.check=//input[contains(@id,'common-edit-portal-error-form:portal-access-check')]
+portal.admin.chk.pp.unavail.check=//input[contains(@id,'common-edit-portal-error-form:portal-unavail-check')]
+portal.admin.sub.pp.propadd=//input[contains(@id,'common-edit-prop-form:add-property')]
+portal.admin.inp.pp.propname=//input[contains(@id,'common-edit-prop-form:property')]
+portal.admin.sub.pp.listener=//input[contains(@id,'edit-prop-form:update')]
+portal.admin.sel.pp.listener=//select[contains(@id,'edit-prop-form:listener')]
+portal.admin.tbl.pp.props=//table[contains(@id,'common-manage-prop-form:prop-data-table')]
+
+# DashboardsTestCase
+
+portal.dash.t.dh.sub.update=//form[contains(@id,'common-edit-theme-form')]/input[@type='submit']
+portal.dash.t.dh.sel.renderset=//select[contains(@id,'common-edit-theme-form:renderSet')]
+portal.dash.t.dh.sel.theme=//select[contains(@id,'common-edit-theme-form:theme')]
+portal.dash.t.dh.sel.layout=//select[contains(@id,'common-edit-theme-form:layout')]
+portal.dash.t.pa.sub.update=//input[contains(@id,'common-edit-page-error-form:update')]
+portal.dash.t.po.sub.update=//input[contains(@id,'common-edit-portal-error-form:update')]
+portal.dash.t.pa.inp.pageadd=//input[contains(@id,'common-edit-page-error-form:page-res-select')]
+portal.dash.t.po.inp.pageadd=//input[contains(@id,'common-edit-portal-error-form:portal-res-input')]
+portal.dash.t.pa.sel.pnf=//select[contains(@id,'common-edit-page-error-form:page-not-found-select')]
+portal.dash.t.pa.sel.intern=//select[contains(@id,'common-edit-page-error-form:page-internal-select')]
+portal.dash.t.pa.sel.error=//select[contains(@id,'common-edit-page-error-form:page-error-select')]
+portal.dash.t.pa.sel.control=//select[contains(@id,'common-edit-page-error-form:page-control-select')]
+portal.dash.t.pa.sel.access=//select[contains(@id,'common-edit-page-error-form:page-access-select')]
+portal.dash.t.po.sel.pnf=//select[contains(@id,'common-edit-portal-error-form:portal-not-found-select')]
+portal.dash.t.po.sel.unavail=//select[contains(@id,'common-edit-portal-error-form:portal-unavail-select')]
+portal.dash.t.po.sel.access=//select[contains(@id,'common-edit-portal-error-form:portal-access-select')]
+portal.dash.submit.update.value=//input[contains(@id,'common-manage-prop-form:update')]
+portal.dash.table.props=//table[contains(@id,'common-manage-prop-form:prop-data-table')]
+portal.dash.t.props.input.value=//input[contains(@id,''common-manage-prop-form:prop-data-table:{0}:prop-value-input'')]
+portal.dash.t.props.link.del=//a[contains(@id,''common-manage-prop-form:prop-data-table:{0}:delete'')]
+portal.dash.table.pa.err=//form[@id='common-edit-page-error-form']/table
+portal.dash.table.po.err=//form[@id='common-edit-portal-error-form']/table
+portal.dash.table.dh.thm=//form[@id='common-edit-theme-form']/table
+portal.dash.input.prop.name=//input[contains(@id,'common-edit-prop-form:property')]
+portal.dash.submit.add.prop=//input[contains(@id,'common-edit-prop-form:add-property')]
+portal.dash.link.admin=link=Admin
+portal.dash.link.tab.dash=//a[contains(@id,'admin-subtab-form:dashboard-link')]
+
+# PortletDefinitionsTestCase
+
+portal.port.def.t.link.pref=//a[contains(@id,''def-list:portlet-pref-{0}'')]
+portal.port.def.submit.create.inst=//input[contains(@name,'add_instance_form:j_id19')]
+portal.port.def.input.instance.name=//input[contains(@id,'add_instance_form:instanceId')]
+portal.port.def.t.link.create=//a[contains(@id,''def-list:create-instance-{0}'')]
+portal.port.def.submit.provider.view=//input[contains(@id,'definition-form:view-portlets')]
+portal.port.def.select.provider=//select[contains(@id,'definition-form:menu')]
+portal.port.def.table.portlet=//form[contains(@id,'def-list')]/table
+portal.port.def.link.name.admin.port=//a[contains(@id,'common-show-portlet-detail-form:field1:select')]
+portal.port.def.link.admin.port=//a[contains(@id,'def-list:portlet-def-0')]
+portal.port.def.link.admin=link=Admin
+portal.port.def.link.tab.pd=//a[contains(@id,'admin-subtab-form:portlet-def-link')]
+portal.port.def.link.pd.main=//a[contains(@id,'man-form:def-link')]
+
+# PortletInstancesTestCase
+
+portal.port.ins.tab.portlet.instances=//table[contains(@id,'instancesTable2')]
+portal.port.ins.ul.paginator=//ul[@class='pagination property-container']
+portal.port.ins.submit.security.update=//input[contains(@id,'common-edit-security-form:update')]
+portal.port.ins.submit.security.cancel=//input[contains(@id,'common-edit-security-form:cancel')]
+portal.port.ins.link.20.page=link=20
+portal.port.ins.link.pref.welcomeport=//a[contains(@id,'security-JSPPortletInstance')]
+portal.port.ins.table.pref.key=//form[contains(@id,'common-edit-pref-form')]/table
+portal.port.ins.submit.pref.delete=//input[contains(@id,'common-edit-exisiting-form:row_0')]
+portal.port.ins.link.pref.guestnum=//a[contains(@id,'common-edit-pref-form:pref-link-0')]
+portal.port.ins.input.pref.newval=//input[contains(@id,'common-append-form:new_value')]
+portal.port.ins.submit.pref.update=//input[contains(@id,'common-append-form:append-button')]
+portal.port.ins.submit.pref.save=//input[contains(@id,':save')]
+portal.port.ins.input.pref.update=//input[contains(@id,'common-edit-exisiting-form:update')]
+portal.port.ins.input.pref.append=//input[contains(@id,'common-edit-exisiting-form:pref-input-0')]
+portal.port.ins.submit.pref.cancel=//input[contains(@id,':cancel')]
+portal.port.ins.link.curuser.preferences=//a[contains(@id,'instances-form:preference-CurrentUsersPortletInstance')]
+portal.port.ins.link.del.exceptport=//a[contains(@id,'instances-form:delete-GoogleMapPortletInstance')]
+portal.port.ins.submit.pi.delete.conf=//input[contains(@id,'confirm-delete-form1:delete')]
+portal.port.ins.submit.pi.delete.canc=//input[contains(@id,'confirm-delete-form1:cancel')]
+portal.port.ins.t.link.deletename=//a[contains(@id,''instance-display-form:locale-datatable:{0}:delete-link'')]
+portal.port.ins.t.link.modifyname=//a[contains(@id,''instance-display-form:locale-datatable:{0}:edit-link'')]
+portal.port.ins.link.countport=//a[contains(@id,'instances-form:CurrentUsersPortletInstance')]
+portal.port.ins.name.countport=CurrentUsersPortletInstance
+portal.port.ins.submit.modify.name=//input[contains(@id,'add-display-name-form:addDisplay')]
+portal.port.ins.input.name=//input[contains(@id,'add-display-name-form:newName')]
+portal.port.ins.select.language=//select[contains(@id,'add-display-name-form:locales')]
+portal.port.ins.link.admin=link=Admin
+portal.port.ins.link.tab.pi=//a[contains(@id,'admin-subtab-form:portlet-instance-link')]
+portal.port.ins.link.pi.main=//a[contains(@id,'instance-form1:instance-link')]
+portal.port.ins.table.dispnames=//table[contains(@id,'instance-display-form:locale-datatable')]
+portal.port.ins.lnk.sec.button=//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td/table/tbody/tr/td/a[contains(@class,''Security'')]
+portal.port.ins.lnk.pref.button=//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td/table/tbody/tr/td/a[contains(@class,''actionPreferences'')]
+portal.port.ins.lnk.del.button=//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td/table/tbody/tr/td/a[contains(@class,''actionDeleteInstance'')]
+portal.port.ins.lnk.instance.button=//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td[1]/a[1]
+
# EndToEndBeaPortlet
e2e.wsrp.inp.consumer.name=//input[contains(@id,'edit-cons-form:id')]
@@ -85,34 +379,35 @@
# EndtoEndPortalAdminTestCase
-e2e.portal.sel.portlet.type=_jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_viewRoot:windowForm:instanceId
-e2e.portal.sub.layout.add.center=//input[contains(@id,'layoutForm:a_center')]
-e2e.portal.inp.window.name=//input[contains(@id,'windowForm:windowName')]
-e2e.portal.sub.rename.portal=//input[contains(@id,'renameForm:rename')]
-e2e.portal.inp.rename.portal=//input[contains(@id,'renameForm:newName')]
-e2e.portal.sub.delete.portal.conf=//input[contains(@id,'delete-view:confirm-form:delete')]
-e2e.portal.inp.submit.pagecreate=//input[contains(@id,'create-page-form:create-page')]
-e2e.portal.inp.pagename=//input[contains(@id,'create-page-form:pageName')]
-e2e.portal.inp.portalname=//input[contains(@id,'create-portal-form:name')]
-e2e.portal.inp.submit.createportal=//input[contains(@id,'create-portal-form:create-portal')]
-e2e.portal.tab.portalobj.id=Link=Admin
-e2e.portal.lnk.portals.id=link=*Portal Objects*
-e2e.portal.lnk.portal.home=//a[contains(@id,'obj-temp-form:object-link-0')]
-e2e.portal.tbl.portal.admin=//table[contains(@id,'obj-nav-form:portal-datatable')]
-e2e.portal.por.tl.main=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:object-iid-link'')]
-e2e.portal.por.tl.security=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:security-link'')]
-e2e.portal.por.tl.properties=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:prop-link'')]
-e2e.portal.por.tl.theme=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:theme-link'')]
-e2e.portal.por.tl.rename=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:rename'')]
-e2e.portal.por.tl.delete=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:delete'')]
-e2e.portal.por.tl.makedef=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:default-link'')]
-e2e.portal.tbl.portalpage.admin=//table[contains(@id,'obj-nav-form:pages-datatable')]
-e2e.portal.pag.tl.main=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:object-link'')]
-e2e.portal.pag.tl.layout=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:edit-page-layout'')]
-e2e.portal.pag.tl.security=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:security-link'')]
-e2e.portal.pag.tl.properties=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:prop-link'')]
-e2e.portal.pag.tl.theme=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:theme-link'')]
-e2e.portal.pag.tl.rename=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-link'')]
-e2e.portal.pag.tl.display=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-display'')]
-e2e.portal.pag.tl.delete=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:delete-link'')]
-e2e.portal.pag.tl.makedef=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:default-link'')]
+portal.e2e.sel.portlet.type=//select[contains(@id,'windowForm:instanceId')]
+portal.e2e.sub.layout.add.center=//input[contains(@id,'layoutForm:a_center')]
+portal.e2e.inp.window.name=//input[contains(@id,'windowForm:windowName')]
+portal.e2e.sub.rename.portal=//input[contains(@id,'renameForm:rename')]
+portal.e2e.inp.rename.portal=//input[contains(@id,'renameForm:newName')]
+portal.e2e.sub.delete.portal.conf=//input[contains(@id,'delete-view:confirm-form:delete')]
+portal.e2e.inp.submit.pagecreate=//input[contains(@id,'create-page-form:create-page')]
+portal.e2e.inp.pagename=//input[contains(@id,'create-page-form:pageName')]
+portal.e2e.inp.portalname=//input[contains(@id,'create-portal-form:name')]
+portal.e2e.inp.submit.createportal=//input[contains(@id,'create-portal-form:create-portal')]
+portal.e2e.tab.portalobj.id=Link=Admin
+portal.e2e.lnk.portals.id=link=*Portal Objects*
+portal.e2e.lnk.portal.home=//a[contains(@id,'obj-temp-form:object-link-0')]
+portal.e2e.tbl.portal.admin=//table[contains(@id,'obj-nav-form:portal-datatable')]
+portal.e2e.por.tl.main=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:object-iid-link'')]
+portal.e2e.por.tl.security=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:security-link'')]
+portal.e2e.por.tl.properties=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:prop-link'')]
+portal.e2e.por.tl.theme=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:theme-link'')]
+portal.e2e.por.tl.rename=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:rename'')]
+portal.e2e.por.tl.delete=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:delete'')]
+portal.e2e.por.tl.makedef=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:default-link'')]
+portal.e2e.tbl.portalpage.admin=//table[contains(@id,'obj-nav-form:pages-datatable')]
+portal.e2e.pag.tl.main=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:object-link'')]
+portal.e2e.pag.tl.layout=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:edit-page-layout'')]
+portal.e2e.pag.tl.security=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:security-link'')]
+portal.e2e.pag.tl.properties=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:prop-link'')]
+portal.e2e.pag.tl.theme=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:theme-link'')]
+portal.e2e.pag.tl.rename=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-link'')]
+portal.e2e.pag.tl.display=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-display'')]
+portal.e2e.pag.tl.delete=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:delete-link'')]
+portal.e2e.pag.tl.makedef=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:default-link'')]
+portal.e2e.div.por.cont=content-container
\ No newline at end of file
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java 2009-02-24 13:39:09 UTC (rev 12879)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java 2009-02-24 14:30:01 UTC (rev 12880)
@@ -11,352 +11,577 @@
/**
* @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
*/
-@Test(groups = {"admin_portal"}, enabled = true, description = "Partal administrating.")
+@Test(groups = { "admin_portal" }, enabled = true, description = "Partal administrating.")
public class AdminPortalTestCase extends JBossPortalSeleniumTestCase {
- private static final String SUB_LAYOUT_ADD_CENTER = "//input[contains(@id,'layoutForm:a_center')]";
- private static final String INP_WINDOW_NAME = "//input[contains(@id,'windowForm:windowName')]";
- private static final String SUBMIT_RENAME_PORTAL = "//input[contains(@id,'renameForm:rename')]";
- private static final String INPUT_RENAME_PORTAL = "//input[contains(@id,'renameForm:newName')]";
- private static final String SUBMIT_DELETE_PORTAL_CONF = "//input[contains(@id,'delete-view:confirm-form:delete')]";
- private static final String INPUT_SUBMIT_PAGECREATE = "//input[contains(@id,'create-page-form:create-page')]";
- private static final String INPUT_PAGENAME = "//input[contains(@id,'create-page-form:pageName')]";
- private static final String INPUT_PORTALNAME = "//input[contains(@id,'create-portal-form:name')]";
- private static final String INPUT_SUBMIT_CREATEPORTAL = "//input[contains(@id,'create-portal-form:create-portal')]";
- private final String TAB_PORTALOBJ_ID = "Link=Admin";
- private final String LINK_PORTALS_ID = "link=*Portal Objects*";
- private final String LINK_PORTAL_HOME = "//a[contains(@id,'obj-temp-form:object-link-0')]";
- private final String TABLE_PORTAL_ADMIN = "//table[contains(@id,'obj-nav-form:portal-datatable')]";
- private final String POR_TL_MAIN = "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:object-iid-link'')]";
- private final String POR_TL_SECURITY = "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:security-link'')]";
- private final String POR_TL_PROPERTIES = "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:prop-link'')]";
- private final String POR_TL_THEME = "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:theme-link'')]";
- private final String POR_TL_RENAME = "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:rename'')]";
- private final String POR_TL_DELETE = "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:delete'')]";
- private final String POR_TL_MAKEDEF = "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:default-link'')]";
- private final String TABLE_PORTALPAGE_ADMIN = "//table[contains(@id,'obj-nav-form:pages-datatable')]";
- private final String PAG_TL_MAIN = "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:object-link'')]";
- private final String PAG_TL_LAYOUT = "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:edit-page-layout'')]";
- private final String PAG_TL_SECURITY = "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:security-link'')]";
- private final String PAG_TL_PROPERTIES = "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:prop-link'')]";
- private final String PAG_TL_THEME = "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:theme-link'')]";
- private final String PAG_TL_RENAME = "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-link'')]";
- private final String PAG_TL_DISPLAY = "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-display'')]";
- private final String PAG_TL_DELETE = "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:delete-link'')]";
- private final String PAG_TL_MAKEDEF = "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:default-link'')]";
+ public final String casePfx = "portal.admin.";
- @BeforeMethod(groups = {"log"})
- public void loginBeforeTest() {
- logoutIfPossible();
- login("admin", "admin");
- }
+ private final String LNK_PP_PROP_DELETE = getProp(casePfx+"lnk.pp.prop.delete","//a[contains(@id,''common-manage-prop-form:prop-data-table:{0}:delete'')]");
+ private final String SUB_PP_PROPVAL_UPDATE = getProp(casePfx+"sub.pp.propval.update","//input[contains(@id,'common-manage-prop-form:update')]");
+ private final String INP_PP_PROP_VAL = getProp(casePfx+"inp.pp.prop.val","//input[contains(@id,''common-manage-prop-form:prop-data-table:{0}:prop-value-input'')]");
+ private final String SUB_PPA_FORM_UPDATE = getProp(casePfx+"sub.ppa.form.update","//input[contains(@id,'common-edit-page-error-form:update')]");
+ private final String INP_PPA_RES_SELECT = getProp(casePfx+"inp.ppa.res.select","//input[contains(@id,'common-edit-page-error-form:page-res-select')]");
+ private final String SEL_PPA_NF_SELECT = getProp(casePfx+"sel.ppa.nf.select","//select[contains(@id,'common-edit-page-error-form:page-not-found-select')]");
+ private final String SEL_PPA_INTERNAL_SELECT = getProp(casePfx+"sel.ppa.internal.select","//select[contains(@id,'common-edit-page-error-form:page-internal-select')]");
+ private final String SEL_PPA_ERROR_SELECT = getProp(casePfx+"sel.ppa.error.select","//select[contains(@id,'common-edit-page-error-form:page-error-select')]");
+ private final String SEL_PPA_CONTROL_SELECT = getProp(casePfx+"sel.ppa.control.select","//select[contains(@id,'common-edit-page-error-form:page-control-select')]");
+ private final String SEL_PPA_ACCESS_SELECT = getProp(casePfx+"sel.ppa.access.select","//select[contains(@id,'common-edit-page-error-form:page-access-select')]");
+ private final String CHK_PPA_RES_CHECK = getProp(casePfx+"chk.ppa.res.check","//input[contains(@id,'common-edit-page-error-form:page-res-check')]");
+ private final String CHK_PPA_NF_CHECK = getProp(casePfx+"chk.ppa.nf.check","//input[contains(@id,'common-edit-page-error-form:page-not-found-check')]");
+ private final String CHK_PPA_INTERNAL_CHECK = getProp(casePfx+"chk.ppa.internal.check","//input[contains(@id,'common-edit-page-error-form:page-internal-check')]");
+ private final String CHK_PPA_ERROR_CHECK = getProp(casePfx+"chk.ppa.error.check","//input[contains(@id,'common-edit-page-error-form:page-error-check')]");
+ private final String CHK_PPA_CONTROL_CHECK = getProp(casePfx+"chk.ppa.control.check","//input[contains(@id,'common-edit-page-error-form:page-control-check')]");
+ private final String CHK_PPA_ACCESS_CHECK = getProp(casePfx+"chk.ppa.access.check","//input[contains(@id,'common-edit-page-error-form:page-access-check')]");
+ private final String SUB_PP_ERROR_FORM_UPDATE = getProp(casePfx+"sub.pp.error.form.update","//input[contains(@id,'common-edit-portal-error-form:update')]");
+ private final String INP_PP_RES_INPUT = getProp(casePfx+"inp.pp.res.input","//input[contains(@id,'common-edit-portal-error-form:portal-res-input')]");
+ private final String SEL_PP_NF_SELECT = getProp(casePfx+"sel.pp.nf.select","//select[contains(@id,'common-edit-portal-error-form:portal-not-found-select')]");
+ private final String SEL_PP_INTERNAL_SELECT = getProp(casePfx+"sel.pp.internal.select","//select[contains(@id,'common-edit-portal-error-form:portal-internal-select')]");
+ private final String SEL_PP_ERROR_SELECT = getProp(casePfx+"sel.pp.error.select","//select[contains(@id,'common-edit-portal-error-form:portal-error-select')]");
+ private final String SEL_PP_UNAVAIL_SELECT = getProp(casePfx+"sel.pp.unavail.select","//select[contains(@id,'common-edit-portal-error-form:portal-unavail-select')]");
+ private final String SEL_PP_ACCESS_SELECT = getProp(casePfx+"sel.pp.access.select","//select[contains(@id,'common-edit-portal-error-form:portal-access-select')]");
+ private final String CHK_PP_RES_CHECK = getProp(casePfx+"chk.pp.res.check","//input[contains(@id,'common-edit-portal-error-form:portal-res-check')]");
+ private final String CHK_PP_NF_CHECK = getProp(casePfx+"chk.pp.nf.check","//input[contains(@id,'common-edit-portal-error-form:portal-not-found-check')]");
+ private final String CHK_PP_INTERNAL_CHECK = getProp(casePfx+"chk.pp.internal.check","//input[contains(@id,'common-edit-portal-error-form:portal-internal-check')]");
+ private final String CHK_PP_ERROR_CHECK = getProp(casePfx+"chk.pp.error.check","//input[contains(@id,'common-edit-portal-error-form:portal-error-check')]");
+ private final String CHK_PP_ACCESS_CHECK = getProp(casePfx+"chk.pp.access.check","//input[contains(@id,'common-edit-portal-error-form:portal-access-check')]");
+ private final String CHK_PP_UNAVAIL_CHECK = getProp(casePfx+"chk.pp.unavail.check","//input[contains(@id,'common-edit-portal-error-form:portal-unavail-check')]");
+ private final String SUB_PP_PROPADD = getProp(casePfx+"sub.pp.propadd","//input[contains(@id,'common-edit-prop-form:add-property')]");
+ private final String INP_PP_PROPNAME = getProp(casePfx+"inp.pp.propname","//input[contains(@id,'common-edit-prop-form:property')]");
+ private final String SUB_PP_LISTENER = getProp(casePfx+"sub.pp.listener","//input[contains(@id,'edit-prop-form:update')]");
+ private final String SEL_PP_LISTENER = getProp(casePfx+"sel.pp.listener","//select[contains(@id,'edit-prop-form:listener')]");
+ private final String TBL_PP_PROPS = getProp(casePfx+"tbl.pp.props","//table[contains(@id,'common-manage-prop-form:prop-data-table')]");
- @AfterMethod(groups = {"log"})
- public void logoutAfterTest() {
- }
+ private final String SUB_LAYOUT_ADD_CENTER = getProp(casePfx + "sub.layout.add.center", "//input[contains(@id,'layoutForm:a_center')]");
+ private final String INP_WINDOW_NAME = getProp(casePfx + "inp.window.name", "//input[contains(@id,'windowForm:windowName')]");
+ private final String SUBMIT_RENAME_PORTAL = getProp(casePfx + "submit.rename.portal", "//input[contains(@id,'renameForm:rename')]");
+ private final String INPUT_RENAME_PORTAL = getProp(casePfx + "input.rename.portal", "//input[contains(@id,'renameForm:newName')]");
+ private final String SUBMIT_DELETE_PORTAL_CONF = getProp(casePfx + "submit.delete.portal.conf", "//input[contains(@id,'delete-view:confirm-form:delete')]");
+ private final String INPUT_SUBMIT_PAGECREATE = getProp(casePfx + "input.submit.pagecreate", "//input[contains(@id,'create-page-form:create-page')]");
+ private final String INPUT_PAGENAME = getProp(casePfx + "input.pagename", "//input[contains(@id,'create-page-form:pageName')]");
+ private final String INPUT_PORTALNAME = getProp(casePfx + "input.portalname", "//input[contains(@id,'create-portal-form:name')]");
+ private final String INPUT_SUBMIT_CREATEPORTAL = getProp(casePfx + "input.submit.createportal", "//input[contains(@id,'create-portal-form:create-portal')]");
+ private final String TAB_PORTALOBJ_ID = getProp(casePfx + "tab.portalobj.id", "Link=Admin");
+ private final String LINK_PORTALS_ID = getProp(casePfx + "link.portals.id", "link=*Portal Objects*");
+ private final String LINK_PORTAL_HOME = getProp(casePfx + "link.portal.home", "//a[contains(@id,'obj-temp-form:object-link-0')]");
+ private final String TABLE_PORTAL_ADMIN = getProp(casePfx + "table.portal.admin", "//table[contains(@id,'obj-nav-form:portal-datatable')]");
+ private final String POR_TL_MAIN = getProp(casePfx + "por.tl.main", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:object-iid-link'')]");
+ private final String POR_TL_SECURITY = getProp(casePfx + "por.tl.security", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:security-link'')]");
+ private final String POR_TL_PROPERTIES = getProp(casePfx + "por.tl.properties", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:prop-link'')]");
+ private final String POR_TL_THEME = getProp(casePfx + "por.tl.theme", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:theme-link'')]");
+ private final String POR_TL_RENAME = getProp(casePfx + "por.tl.rename", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:rename'')]");
+ private final String POR_TL_DELETE = getProp(casePfx + "por.tl.delete", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:delete'')]");
+ private final String POR_TL_MAKEDEF = getProp(casePfx + "por.tl.makedef", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:default-link'')]");
+ private final String TABLE_PORTALPAGE_ADMIN = getProp(casePfx + "table.portalpage.admin", "//table[contains(@id,'obj-nav-form:pages-datatable')]");
+ private final String PAG_TL_MAIN = getProp(casePfx + "pag.tl.main", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:object-link'')]");
+ private final String PAG_TL_LAYOUT = getProp(casePfx + "pag.tl.layout", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:edit-page-layout'')]");
+ private final String PAG_TL_SECURITY = getProp(casePfx + "pag.tl.security", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:security-link'')]");
+ private final String PAG_TL_PROPERTIES = getProp(casePfx + "pag.tl.properties", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:prop-link'')]");
+ private final String PAG_TL_THEME = getProp(casePfx + "pag.tl.theme", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:theme-link'')]");
+ private final String PAG_TL_RENAME = getProp(casePfx + "pag.tl.rename", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-link'')]");
+ private final String PAG_TL_DISPLAY = getProp(casePfx + "pag.tl.display", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-display'')]");
+ private final String PAG_TL_DELETE = getProp(casePfx + "pag.tl.delete", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:delete-link'')]");
+ private final String PAG_TL_MAKEDEF = getProp(casePfx + "pag.tl.makedef", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:default-link'')]");
- @Test(enabled = true)
- public void testPortalCreate() {
- selenium.click("link=Admin");
- selenium.waitForPageToLoad(PAGE_LOAD);
+ @BeforeMethod(groups = { "log" })
+ public void loginBeforeTest() {
+ logoutIfPossible();
+ login("admin", "admin");
+ }
- clickIfVisible(TAB_PORTALOBJ_ID);
- clickIfVisible(LINK_PORTALS_ID);
+ @AfterMethod(groups = { "log" })
+ public void logoutAfterTest() {
+ }
- final String portalName = "TestPortal";
- Assert.assertFalse(selenium.isTextPresent(portalName), "Not created page already exist.");
+ @Test(enabled = true)
+ public void testPortalCreate() {
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(INPUT_PORTALNAME, portalName);
- selenium.click(INPUT_SUBMIT_CREATEPORTAL);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
- Assert.assertTrue(selenium.isTextPresent(portalName));
+ final String portalName = "TestPortal";
+ Assert.assertFalse(selenium.isTextPresent(portalName), "Not created page already exist.");
- int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+ selenium.type(INPUT_PORTALNAME, portalName);
+ selenium.click(INPUT_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(POR_TL_MAIN, r)));
- Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(POR_TL_SECURITY, r)));
- Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(POR_TL_PROPERTIES, r)));
- Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(POR_TL_MAKEDEF, r)));
- Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(POR_TL_RENAME, r)));
- Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(POR_TL_THEME, r)));
- }
+ Assert.assertTrue(selenium.isTextPresent(portalName));
- @Test(enabled = true, dependsOnMethods = {"testPortalCreate"})
- public void testPortalRename() {
- // first create a portal
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
- selenium.click("link=Admin");
- selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(POR_TL_MAIN, r)));
+ Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(POR_TL_SECURITY, r)));
+ Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(POR_TL_PROPERTIES, r)));
+ Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(POR_TL_MAKEDEF, r)));
+ Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(POR_TL_RENAME, r)));
+ Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(POR_TL_THEME, r)));
+ }
- clickIfVisible(TAB_PORTALOBJ_ID);
- clickIfVisible(LINK_PORTALS_ID);
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate" })
+ public void testPortalRename() {
+ // first create a portal
- final String portalName = "TestRenPortal";
- Assert.assertFalse(selenium.isTextPresent(portalName), "Not created page already exist.");
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(INPUT_PORTALNAME, portalName);
- selenium.click(INPUT_SUBMIT_CREATEPORTAL);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
- // then rename it
+ final String portalName = "TestRenPortal";
+ Assert.assertFalse(selenium.isTextPresent(portalName), "Not created page already exist.");
- selenium.click("link=Admin");
- selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(INPUT_PORTALNAME, portalName);
+ selenium.click(INPUT_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(TAB_PORTALOBJ_ID);
- clickIfVisible(LINK_PORTALS_ID);
+ // then rename it
- final String portalToRename = "TestRenPortal";
- Assert.assertTrue(selenium.isTextPresent(portalToRename));
- final String portalRenamed = "AestPortal";
- Assert.assertFalse(selenium.isTextPresent(portalRenamed), "Not created page already exist.");
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
- int r = findTableRow(TABLE_PORTAL_ADMIN, portalToRename, 0) - 1;
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
- selenium.click(MessageFormat.format(POR_TL_RENAME, r));
- selenium.waitForPageToLoad(PAGE_LOAD);
+ final String portalToRename = "TestRenPortal";
+ Assert.assertTrue(selenium.isTextPresent(portalToRename));
+ final String portalRenamed = "AestPortal";
+ Assert.assertFalse(selenium.isTextPresent(portalRenamed), "Not created page already exist.");
- selenium.type(INPUT_RENAME_PORTAL, portalRenamed);
- selenium.click(SUBMIT_RENAME_PORTAL);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalToRename, 0) - 1;
- Assert.assertFalse(selenium.isTextPresent(portalToRename));
- Assert.assertTrue(selenium.isTextPresent(portalRenamed));
- }
+ selenium.click(MessageFormat.format(POR_TL_RENAME, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
- @Test(enabled = true, dependsOnMethods = {"testPortalCreate"})
- public void testPortalDelete() {
- // first create a portal
+ selenium.type(INPUT_RENAME_PORTAL, portalRenamed);
+ selenium.click(SUBMIT_RENAME_PORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Admin");
- selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertFalse(selenium.isTextPresent(portalToRename));
+ Assert.assertTrue(selenium.isTextPresent(portalRenamed));
+ }
- clickIfVisible(TAB_PORTALOBJ_ID);
- clickIfVisible(LINK_PORTALS_ID);
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate" })
+ public void testPortalDelete() {
+ // first create a portal
- final String portalName = "TestDelete";
- Assert.assertFalse(selenium.isTextPresent(portalName), "Not created page already exist.");
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(INPUT_PORTALNAME, portalName);
- selenium.click(INPUT_SUBMIT_CREATEPORTAL);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
- // then delete it
+ final String portalName = "TestDelete";
+ Assert.assertFalse(selenium.isTextPresent(portalName), "Not created page already exist.");
- selenium.click("link=Admin");
- selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(INPUT_PORTALNAME, portalName);
+ selenium.click(INPUT_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(TAB_PORTALOBJ_ID);
- clickIfVisible(LINK_PORTALS_ID);
+ // then delete it
- final String portalToDelete = "TestDelete";
- selenium.type(INPUT_PORTALNAME, portalToDelete);
- selenium.click(INPUT_SUBMIT_CREATEPORTAL);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent(portalToDelete));
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
- int r = findTableRow(TABLE_PORTAL_ADMIN, portalToDelete, 0) - 1;
+ final String portalToDelete = "TestDelete";
+ selenium.type(INPUT_PORTALNAME, portalToDelete);
+ selenium.click(INPUT_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click(MessageFormat.format(POR_TL_DELETE, r));
- selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("WARNING! You are about to delete the " + portalToDelete + " portal from the context!"));
- Assert.assertTrue(selenium.isTextPresent("Delete portal"));
- Assert.assertTrue(selenium.isTextPresent("Are you sure you want to delete this portal?"));
- selenium.click(SUBMIT_DELETE_PORTAL_CONF);
- selenium.waitForPageToLoad(PAGE_LOAD);
- //Assert.assertTrue(selenium.isTextPresent("TestDelete has successfully been destroyed"));
+ Assert.assertTrue(selenium.isTextPresent(portalToDelete));
- clickIfVisible("link=Admin");
- clickIfVisible(TAB_PORTALOBJ_ID);
- Assert.assertFalse(selenium.isTextPresent(portalToDelete));
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalToDelete, 0) - 1;
- }
+ selenium.click(MessageFormat.format(POR_TL_DELETE, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent("WARNING! You are about to delete the " + portalToDelete + " portal from the context!"));
+ Assert.assertTrue(selenium.isTextPresent("Delete portal"));
+ Assert.assertTrue(selenium.isTextPresent("Are you sure you want to delete this portal?"));
+ selenium.click(SUBMIT_DELETE_PORTAL_CONF);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ // Assert.assertTrue(selenium.isTextPresent(
+ // "TestDelete has successfully been destroyed"));
- @Test(enabled = true, dependsOnMethods = {"testPortalCreate"})
- public void testAddPage() {
+ clickIfVisible("link=Admin");
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ Assert.assertFalse(selenium.isTextPresent(portalToDelete));
- final String portalName = "TestAddPagePortal";
- final String portalPage = "tToAddPage";
+ }
- selenium.click("link=Admin");
- selenium.waitForPageToLoad(PAGE_LOAD);
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate" })
+ public void testPortalProperties() {
+ // first create a portal
- clickIfVisible(TAB_PORTALOBJ_ID);
- clickIfVisible(LINK_PORTALS_ID);
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
- selenium.type(INPUT_PORTALNAME, portalName);
- selenium.click(INPUT_SUBMIT_CREATEPORTAL);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ final String portalName = "TestProperties";
+ Assert.assertFalse(selenium.isTextPresent(portalName), "Not created page already exist.");
- int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+ selenium.type(INPUT_PORTALNAME, portalName);
+ selenium.click(INPUT_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click(MessageFormat.format(POR_TL_MAIN, r));
- selenium.waitForPageToLoad(PAGE_LOAD);
+ // then property it
- Assert.assertFalse(selenium.isTextPresent(portalPage), "Portal page already present");
- Assert.assertTrue(selenium.isTextPresent("Create a page named:"));
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(INPUT_PAGENAME, portalPage);
- selenium.click(INPUT_SUBMIT_PAGECREATE);
- selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent(portalPage));
- }
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
- @Test(enabled = true, dependsOnMethods = {"testPortalCreate", "testAddPage"})
- public void testRemovePage() {
+ selenium.type(INPUT_PORTALNAME, portalName);
+ selenium.click(INPUT_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
- final String portalName = "TestRemovePagePortal";
- final String portalPage = "tRemPage";
+ Assert.assertTrue(selenium.isTextPresent(portalName));
- createPortal(portalName);
- createPage(portalName, portalPage);
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
- selenium.click("link=Admin");
- selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(MessageFormat.format(POR_TL_PROPERTIES, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(TAB_PORTALOBJ_ID);
- clickIfVisible(LINK_PORTALS_ID);
- clickIfVisible(LINK_PORTAL_HOME);
+ // Event Listener Binding
- int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+ selenium.select(SEL_PP_LISTENER, "label=release_sessions_listener_self");
+ selenium.click(SUB_PP_LISTENER);
+ selenium.waitForPageToLoad("30000");
+ selenium.select(SEL_PP_LISTENER, "label=user_listener");
+ selenium.click(SUB_PP_LISTENER);
+ selenium.waitForPageToLoad("30000");
- selenium.click(MessageFormat.format(POR_TL_MAIN, r));
- selenium.waitForPageToLoad(PAGE_LOAD);
+ // Properties
- r = findTableRow(TABLE_PORTALPAGE_ADMIN, portalPage, 0) - 1;
+ final String propName1 = "viliamProp";
+ final String propVal1 = "hier!";
+ final String propName2 = "danielProp";
+ final String propVal2 = "ohne!";
+
+ selenium.type(INP_PP_PROPNAME, propName1);
+ selenium.click(SUB_PP_PROPADD);
+ selenium.waitForPageToLoad("30000");
+
+ r = findTableRow(TBL_PP_PROPS, propName1, 0) - 1;
+
+ selenium.type(MessageFormat.format(INP_PP_PROP_VAL,r), propVal1);
+ selenium.click(SUB_PP_PROPVAL_UPDATE);
+ selenium.waitForPageToLoad("30000");
+ selenium.type(INP_PP_PROPNAME, propName2);
+ selenium.click(SUB_PP_PROPADD);
+ selenium.waitForPageToLoad("30000");
+
+ r = findTableRow(TBL_PP_PROPS, propName2, 0) - 1;
+
+ selenium.type(MessageFormat.format(INP_PP_PROP_VAL,r), propVal2);
+ selenium.click(SUB_PP_PROPVAL_UPDATE);
+ selenium.waitForPageToLoad("30000");
+
+ r = findTableRow(TBL_PP_PROPS, propName1, 0) - 1;
+
+ selenium.click(MessageFormat.format(LNK_PP_PROP_DELETE,r));
+ selenium.waitForPageToLoad("30000");
- selenium.click(MessageFormat.format(PAG_TL_DELETE, r));
- selenium.waitForPageToLoad(PAGE_LOAD);
+ // Portal & Page Error Handling
- Assert.assertTrue(selenium.isTextPresent("Delete page"));
- Assert.assertTrue(selenium.isTextPresent("WARNING! You are about to delete the " + portalPage + " page from the " + portalName + " portal! "));
- Assert.assertTrue(selenium.isTextPresent("Are you sure you want to delete this page?"));
+ selenium.click(CHK_PP_UNAVAIL_CHECK);
+ selenium.waitForPageToLoad("30000");
+ selenium.click(CHK_PP_ACCESS_CHECK);
+ selenium.waitForPageToLoad("30000");
+ selenium.click(CHK_PP_ERROR_CHECK);
+ selenium.waitForPageToLoad("30000");
+ selenium.click(CHK_PP_INTERNAL_CHECK);
+ selenium.waitForPageToLoad("30000");
+ selenium.click(CHK_PP_NF_CHECK);
+ selenium.waitForPageToLoad("30000");
+ selenium.click(CHK_PP_RES_CHECK);
+ selenium.waitForPageToLoad("30000");
+ selenium.select(SEL_PP_ACCESS_SELECT, "label=Redirect to the specified resource");
+ selenium.waitForPageToLoad("30000");
+ selenium.select(SEL_PP_UNAVAIL_SELECT, "label=Redirect to the specified resource");
+ selenium.waitForPageToLoad("30000");
+ selenium.select(SEL_PP_ERROR_SELECT, "label=Display the default error message");
+ selenium.waitForPageToLoad("30000");
+ selenium.select(SEL_PP_INTERNAL_SELECT, "label=Display the default error message");
+ selenium.waitForPageToLoad("30000");
+ selenium.select(SEL_PP_NF_SELECT, "label=Redirect to the specified resource");
+ selenium.waitForPageToLoad("30000");
+ selenium.type(INP_PP_RES_INPUT, "/WEB-INF/jsp/error/portalx.jsp");
+ selenium.click(SUB_PP_ERROR_FORM_UPDATE);
+ selenium.waitForPageToLoad("30000");
- }
+ selenium.click(CHK_PPA_ACCESS_CHECK);
+ selenium.waitForPageToLoad("30000");
+ selenium.click(CHK_PPA_CONTROL_CHECK);
+ selenium.waitForPageToLoad("30000");
+ selenium.click(CHK_PPA_ERROR_CHECK);
+ selenium.waitForPageToLoad("30000");
+ selenium.click(CHK_PPA_INTERNAL_CHECK);
+ selenium.waitForPageToLoad("30000");
+ selenium.click(CHK_PPA_NF_CHECK);
+ selenium.waitForPageToLoad("30000");
+ selenium.click(CHK_PPA_RES_CHECK);
+ selenium.waitForPageToLoad("30000");
+ selenium.select(SEL_PPA_ACCESS_SELECT, "label=Redirect to the specified resource");
+ selenium.waitForPageToLoad("30000");
+ selenium.select(SEL_PPA_CONTROL_SELECT, "label=Redirect to the specified resource");
+ selenium.waitForPageToLoad("30000");
+ selenium.select(SEL_PPA_ERROR_SELECT, "label=Display the default error message");
+ selenium.waitForPageToLoad("30000");
+ selenium.select(SEL_PPA_INTERNAL_SELECT, "label=Display the default error message");
+ selenium.waitForPageToLoad("30000");
+ selenium.select(SEL_PPA_NF_SELECT, "label=Redirect to the specified resource");
+ selenium.waitForPageToLoad("30000");
+ selenium.type(INP_PPA_RES_SELECT, "/WEB-INF/jsp/error/pagey.jsp");
+ selenium.click(SUB_PPA_FORM_UPDATE);
+ selenium.waitForPageToLoad("30000");
- @Test(enabled = true, dependsOnMethods = {"testPortalCreate", "testAddPage"})
- public void testCreateWindow() {
+ // logout login and property again
+
+ logout();
+ login("admin","admin");
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
- final String portalName = "toAddWindowPortal";
- final String pageName = "windowContainer";
- final String windowName = "myFancyWindow";
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
- createPortal(portalName);
- createPage(portalName, pageName);
+ selenium.type(INPUT_PORTALNAME, portalName);
+ selenium.click(INPUT_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.open("/portal/");
- selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent(portalName));
- selenium.click("link=Admin");
- selenium.waitForPageToLoad(PAGE_LOAD);
+ r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
- clickIfVisible(TAB_PORTALOBJ_ID);
- clickIfVisible(LINK_PORTALS_ID);
- clickIfVisible(LINK_PORTAL_HOME);
+ selenium.click(MessageFormat.format(POR_TL_PROPERTIES, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // assert time!
+
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PP_LISTENER),"user_listener");
+
+ r = findTableRow(TBL_PP_PROPS, propName1, 0) - 1;
+ Assert.assertFalse(r>0, propName1+" was deleted previously but now it's found in property table");
+ r = findTableRow(TBL_PP_PROPS, propName2, 0) - 1;
+ Assert.assertEquals(selenium.getValue(MessageFormat.format(INP_PP_PROP_VAL,r)), propVal2, "previously changed value other than expected");
+
+ Assert.assertFalse(selenium.isChecked(CHK_PP_UNAVAIL_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PP_ACCESS_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PP_ERROR_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PP_INTERNAL_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PP_NF_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PP_RES_CHECK));
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PP_ACCESS_SELECT),"Redirect to the specified resource");
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PP_UNAVAIL_SELECT),"Redirect to the specified resource");
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PP_ERROR_SELECT),"Display the default error message");
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PP_INTERNAL_SELECT),"Display the default error message");
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PP_NF_SELECT),"Redirect to the specified resource");
+ Assert.assertEquals(selenium.getValue(INP_PP_RES_INPUT),"/WEB-INF/jsp/error/portalx.jsp");
+
+ Assert.assertFalse(selenium.isChecked(CHK_PPA_ACCESS_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PPA_CONTROL_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PPA_ERROR_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PPA_INTERNAL_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PPA_NF_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PPA_RES_CHECK));
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PPA_ACCESS_SELECT),"Redirect to the specified resource");
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PPA_CONTROL_SELECT),"Redirect to the specified resource");
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PPA_ERROR_SELECT),"Display the default error message");
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PPA_INTERNAL_SELECT),"Display the default error message");
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PPA_NF_SELECT),"Redirect to the specified resource");
+ Assert.assertEquals(selenium.getValue(INP_PPA_RES_SELECT),"/WEB-INF/jsp/error/pagey.jsp");
+
+ }
- int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
- selenium.click(MessageFormat.format(POR_TL_MAIN, r));
- selenium.waitForPageToLoad(PAGE_LOAD);
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate" })
+ public void testAddPage() {
- r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
+ final String portalName = "TestAddPagePortal";
+ final String portalPage = "tToAddPage";
- // click on the page layout
- selenium.click(MessageFormat.format(PAG_TL_LAYOUT, r));
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ selenium.type(INPUT_PORTALNAME, portalName);
+ selenium.click(INPUT_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Who's online portlet");
- selenium.waitForPageToLoad(PAGE_LOAD);
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
- selenium.type(INP_WINDOW_NAME, windowName);
+ selenium.click(MessageFormat.format(POR_TL_MAIN, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click(SUB_LAYOUT_ADD_CENTER);
- selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent(windowName));
+ Assert.assertFalse(selenium.isTextPresent(portalPage), "Portal page already present");
+ Assert.assertTrue(selenium.isTextPresent("Create a page named:"));
- selenium.open("/portal/auth/portal/mimikry");
- Assert.assertTrue(selenium.isTextPresent("Current users"));
+ selenium.type(INPUT_PAGENAME, portalPage);
+ selenium.click(INPUT_SUBMIT_PAGECREATE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent(portalPage));
+ }
- }
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate", "testAddPage" })
+ public void testRemovePage() {
- @Test(enabled = true, dependsOnMethods = {"testPortalCreate", "testAddPage"})
- public void testPageRename() {
- String portalName = "TestPortal";
- String pageName = "PageToRename";
+ final String portalName = "TestRemovePagePortal";
+ final String portalPage = "tRemPage";
- createPage("TestPortal", "PageToRename");
+ createPortal(portalName);
+ createPage(portalName, portalPage);
- openAndWait("/portal");
- clickAndWait("link=Admin");
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(TAB_PORTALOBJ_ID);
- clickIfVisible(LINK_PORTALS_ID);
- //selenium.setSpeed("8000");
- clickIfVisible(LINK_PORTAL_HOME);
- Assert.assertTrue(selenium.isTextPresent("Create a portal named:"));
- int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
- clickAndWait(MessageFormat.format(POR_TL_MAIN, r));
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
- r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
+ selenium.click(MessageFormat.format(POR_TL_MAIN, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
- clickAndWait(MessageFormat.format(PAG_TL_RENAME, r));
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, portalPage, 0) - 1;
- }
+ selenium.click(MessageFormat.format(PAG_TL_DELETE, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
- @Test(enabled = false)
- public void testPageSecurity() {
- }
+ Assert.assertTrue(selenium.isTextPresent("Delete page"));
+ Assert.assertTrue(selenium.isTextPresent("WARNING! You are about to delete the " + portalPage + " page from the " + portalName + " portal! "));
+ Assert.assertTrue(selenium.isTextPresent("Are you sure you want to delete this page?"));
- @Test(enabled = false)
- public void testPageTheme() {
- }
+ }
- @Test(enabled = false)
- public void testPageLayout() {
- }
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate", "testAddPage" })
+ public void testCreateWindow() {
- private void createPortal(String name) {
- selenium.open("/portal/");
- selenium.waitForPageToLoad(PAGE_LOAD);
+ final String portalName = "toAddWindowPortal";
+ final String pageName = "windowContainer";
+ final String windowName = "myFancyWindow";
- selenium.click("link=Admin");
- selenium.waitForPageToLoad(PAGE_LOAD);
+ createPortal(portalName);
+ createPage(portalName, pageName);
- clickIfVisible(TAB_PORTALOBJ_ID);
- clickIfVisible(LINK_PORTALS_ID);
+ selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(INPUT_PORTALNAME, name);
- selenium.click(INPUT_SUBMIT_CREATEPORTAL);
- selenium.waitForPageToLoad(PAGE_LOAD);
- }
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
- private void createPage(String portalName, String pageName) {
- selenium.open("/portal/");
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Admin");
- selenium.waitForPageToLoad(PAGE_LOAD);
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
- clickIfVisible(TAB_PORTALOBJ_ID);
- clickIfVisible(LINK_PORTALS_ID);
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+ selenium.click(MessageFormat.format(POR_TL_MAIN, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
- int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
- selenium.click(MessageFormat.format(POR_TL_MAIN, r));
- selenium.waitForPageToLoad(PAGE_LOAD);
+ // click on the page layout
+ selenium.click(MessageFormat.format(PAG_TL_LAYOUT, r));
- selenium.type(INPUT_PAGENAME, pageName);
- selenium.click(INPUT_SUBMIT_PAGECREATE);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
- }
+ selenium.click("link=Who's online portlet");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.type(INP_WINDOW_NAME, windowName);
+
+ selenium.click(SUB_LAYOUT_ADD_CENTER);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent(windowName));
+
+ selenium.open("/portal/auth/portal/mimikry");
+ Assert.assertTrue(selenium.isTextPresent("Current users"));
+
+ }
+
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate", "testAddPage" })
+ public void testPageRename() {
+ String portalName = "TestPortal";
+ String pageName = "PageToRename";
+
+ createPage("TestPortal", "PageToRename");
+
+ openAndWait("/portal");
+ clickAndWait("link=Admin");
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ // selenium.setSpeed("8000");
+ clickIfVisible(LINK_PORTAL_HOME);
+ Assert.assertTrue(selenium.isTextPresent("Create a portal named:"));
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(POR_TL_MAIN, r));
+
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(PAG_TL_RENAME, r));
+
+ }
+
+ @Test(enabled = false)
+ public void testPageSecurity() {
+ }
+
+ @Test(enabled = false)
+ public void testPageTheme() {
+ }
+
+ @Test(enabled = false)
+ public void testPageLayout() {
+ }
+
+ private void createPortal(String name) {
+ selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+
+ selenium.type(INPUT_PORTALNAME, name);
+ selenium.click(INPUT_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ }
+
+ private void createPage(String portalName, String pageName) {
+ selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+ selenium.click(MessageFormat.format(POR_TL_MAIN, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.type(INPUT_PAGENAME, pageName);
+ selenium.click(INPUT_SUBMIT_PAGECREATE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ }
}
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/DashboardsTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/DashboardsTestCase.java 2009-02-24 13:39:09 UTC (rev 12879)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/DashboardsTestCase.java 2009-02-24 14:30:01 UTC (rev 12880)
@@ -10,34 +10,36 @@
public class DashboardsTestCase extends JBossPortalSeleniumTestCase {
- private static final String T_DH_SUB_UPDATE = "//form[contains(@id,'common-edit-theme-form')]/input[@type='submit']";
- private static final String T_DH_SEL_RENDERSET = "//select[contains(@id,'common-edit-theme-form:renderSet')]";
- private static final String T_DH_SEL_THEME = "//select[contains(@id,'common-edit-theme-form:theme')]";
- private static final String T_DH_SEL_LAYOUT = "//select[contains(@id,'common-edit-theme-form:layout')]";
- private static final String T_PA_SUB_UPDATE = "//input[contains(@id,'common-edit-page-error-form:update')]";
- private static final String T_PO_SUB_UPDATE = "//input[contains(@id,'common-edit-portal-error-form:update')]";
- private static final String T_PA_INP_PAGEADD = "//input[contains(@id,'common-edit-page-error-form:page-res-select')]";
- private static final String T_PO_INP_PAGEADD = "//input[contains(@id,'common-edit-portal-error-form:portal-res-input')]";
- private static final String T_PA_SEL_PNF = "//select[contains(@id,'common-edit-page-error-form:page-not-found-select')]";
- private static final String T_PA_SEL_INTERN = "//select[contains(@id,'common-edit-page-error-form:page-internal-select')]";
- private static final String T_PA_SEL_ERROR = "//select[contains(@id,'common-edit-page-error-form:page-error-select')]";
- private static final String T_PA_SEL_CONTROL = "//select[contains(@id,'common-edit-page-error-form:page-control-select')]";
- private static final String T_PA_SEL_ACCESS = "//select[contains(@id,'common-edit-page-error-form:page-access-select')]";
- private static final String T_PO_SEL_PNF = "//select[contains(@id,'common-edit-portal-error-form:portal-not-found-select')]";
- private static final String T_PO_SEL_UNAVAIL = "//select[contains(@id,'common-edit-portal-error-form:portal-unavail-select')]";
- private static final String T_PO_SEL_ACCESS = "//select[contains(@id,'common-edit-portal-error-form:portal-access-select')]";
- private static final String SUBMIT_UPDATE_VALUE = "//input[contains(@id,'common-manage-prop-form:update')]";
- private static final String TABLE_PROPS = "//table[contains(@id,'common-manage-prop-form:prop-data-table')]";
- private static final String T_PROPS_INPUT_VALUE = "//input[contains(@id,''common-manage-prop-form:prop-data-table:{0}:prop-value-input'')]";
- private static final String T_PROPS_LINK_DEL = "//a[contains(@id,''common-manage-prop-form:prop-data-table:{0}:delete'')]";
+ public final String casePfx = "portal.dash.";
+
+ private final String T_DH_SUB_UPDATE = getProp(casePfx+"t.dh.sub.update","//form[contains(@id,'common-edit-theme-form')]/input[@type='submit']");
+ private final String T_DH_SEL_RENDERSET = getProp(casePfx+"t.dh.sel.renderset","//select[contains(@id,'common-edit-theme-form:renderSet')]");
+ private final String T_DH_SEL_THEME = getProp(casePfx+"t.dh.sel.theme","//select[contains(@id,'common-edit-theme-form:theme')]");
+ private final String T_DH_SEL_LAYOUT = getProp(casePfx+"t.dh.sel.layout","//select[contains(@id,'common-edit-theme-form:layout')]");
+ private final String T_PA_SUB_UPDATE = getProp(casePfx+"t.pa.sub.update","//input[contains(@id,'common-edit-page-error-form:update')]");
+ private final String T_PO_SUB_UPDATE = getProp(casePfx+"t.po.sub.update","//input[contains(@id,'common-edit-portal-error-form:update')]");
+ private final String T_PA_INP_PAGEADD = getProp(casePfx+"t.pa.inp.pageadd","//input[contains(@id,'common-edit-page-error-form:page-res-select')]");
+ private final String T_PO_INP_PAGEADD = getProp(casePfx+"t.po.inp.pageadd","//input[contains(@id,'common-edit-portal-error-form:portal-res-input')]");
+ private final String T_PA_SEL_PNF = getProp(casePfx+"t.pa.sel.pnf","//select[contains(@id,'common-edit-page-error-form:page-not-found-select')]");
+ private final String T_PA_SEL_INTERN = getProp(casePfx+"t.pa.sel.intern","//select[contains(@id,'common-edit-page-error-form:page-internal-select')]");
+ private final String T_PA_SEL_ERROR = getProp(casePfx+"t.pa.sel.error","//select[contains(@id,'common-edit-page-error-form:page-error-select')]");
+ private final String T_PA_SEL_CONTROL = getProp(casePfx+"t.pa.sel.control","//select[contains(@id,'common-edit-page-error-form:page-control-select')]");
+ private final String T_PA_SEL_ACCESS = getProp(casePfx+"t.pa.sel.access","//select[contains(@id,'common-edit-page-error-form:page-access-select')]");
+ private final String T_PO_SEL_PNF = getProp(casePfx+"t.po.sel.pnf","//select[contains(@id,'common-edit-portal-error-form:portal-not-found-select')]");
+ private final String T_PO_SEL_UNAVAIL = getProp(casePfx+"t.po.sel.unavail","//select[contains(@id,'common-edit-portal-error-form:portal-unavail-select')]");
+ private final String T_PO_SEL_ACCESS = getProp(casePfx+"t.po.sel.access","//select[contains(@id,'common-edit-portal-error-form:portal-access-select')]");
+ private final String SUBMIT_UPDATE_VALUE = getProp(casePfx+"submit.update.value","//input[contains(@id,'common-manage-prop-form:update')]");
+ private final String TABLE_PROPS = getProp(casePfx+"table.props","//table[contains(@id,'common-manage-prop-form:prop-data-table')]");
+ private final String T_PROPS_INPUT_VALUE = getProp(casePfx+"t.props.input.value","//input[contains(@id,''common-manage-prop-form:prop-data-table:{0}:prop-value-input'')]");
+ private final String T_PROPS_LINK_DEL = getProp(casePfx+"t.props.link.del","//a[contains(@id,''common-manage-prop-form:prop-data-table:{0}:delete'')]");
+ private final String TABLE_PA_ERR = getProp(casePfx+"table.pa.err","//form[@id='common-edit-page-error-form']/table");
+ private final String TABLE_PO_ERR = getProp(casePfx+"table.po.err","//form[@id='common-edit-portal-error-form']/table");
+ private final String TABLE_DH_THM = getProp(casePfx+"table.dh.thm","//form[@id='common-edit-theme-form']/table");
+ private final String INPUT_PROP_NAME = getProp(casePfx+"input.prop.name","//input[contains(@id,'common-edit-prop-form:property')]");
+ private final String SUBMIT_ADD_PROP = getProp(casePfx+"submit.add.prop","//input[contains(@id,'common-edit-prop-form:add-property')]");
+ private final String LINK_ADMIN = getProp(casePfx+"link.admin","link=Admin");
+ private final String LINK_TAB_DASH = getProp(casePfx+"link.tab.dash","//a[contains(@id,'admin-subtab-form:dashboard-link')]");
- private static final String TABLE_PA_ERR = "//form[@id='common-edit-page-error-form']/table";
- private static final String TABLE_PO_ERR = "//form[@id='common-edit-portal-error-form']/table";
- private static final String TABLE_DH_THM = "//form[@id='common-edit-theme-form']/table";
- private static final String INPUT_PROP_NAME = "//input[contains(@id,'common-edit-prop-form:property')]";
- private static final String SUBMIT_ADD_PROP = "//input[contains(@id,'common-edit-prop-form:add-property')]";
- private static final String LINK_ADMIN = "link=Admin";
- private static final String LINK_TAB_DASH = "//a[contains(@id,'admin-subtab-form:dashboard-link')]";
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java 2009-02-24 13:39:09 UTC (rev 12879)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java 2009-02-24 14:30:01 UTC (rev 12880)
@@ -14,199 +14,267 @@
/**
* @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
*/
-@Test(groups = {"end2end"}, enabled = true, description = "Creating of new portal with content.")
+@Test(groups = { "end2end" }, enabled = true, description = "Creating of new portal with content.")
public class EndtoEndPortalAdminTestCase extends JBossPortalSeleniumTestCase {
public static String casePfx = "portal.e2e.";
+
+ public final String SEL_PORTLET_TYPE = getProp(casePfx + "sel.portlet.type",
+ "_jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_viewRoot:windowForm:instanceId");
+ private final String SUB_LAYOUT_ADD_CENTER = getProp(casePfx + "sub.layout.add.center", "//input[contains(@id,'layoutForm:a_center')]");
+ private final String INP_WINDOW_NAME = getProp(casePfx + "inp.window.name", "//input[contains(@id,'windowForm:windowName')]");
+ private final String SUB_RENAME_PORTAL = getProp(casePfx + "sub.rename.portal", "//input[contains(@id,'renameForm:rename')]");
+ private final String INP_RENAME_PORTAL = getProp(casePfx + "inp.rename.portal", "//input[contains(@id,'renameForm:newName')]");
+ private final String SUB_DELETE_PORTAL_CONF = getProp(casePfx + "sub.delete.portal.conf", "//input[contains(@id,'delete-view:confirm-form:delete')]");
+ private final String INP_SUBMIT_PAGECREATE = getProp(casePfx + "inp.submit.pagecreate", "//input[contains(@id,'create-page-form:create-page')]");
+ private final String INP_PAGENAME = getProp(casePfx + "inp.pagename", "//input[contains(@id,'create-page-form:pageName')]");
+ private final String INP_PORTALNAME = getProp(casePfx + "inp.portalname", "//input[contains(@id,'create-portal-form:name')]");
+ private final String INP_SUBMIT_CREATEPORTAL = getProp(casePfx + "inp.submit.createportal", "//input[contains(@id,'create-portal-form:create-portal')]");
+ private final String TAB_PORTALOBJ_ID = getProp(casePfx + "tab.portalobj.id", "Link=Admin");
+ private final String LNK_PORTALS_ID = getProp(casePfx + "lnk.portals.id", "link=*Portal Objects*");
+ private final String LNK_PORTAL_HOME = getProp(casePfx + "lnk.portal.home", "//a[contains(@id,'obj-temp-form:object-link-0')]");
+ private final String TBL_PORTAL_ADMIN = getProp(casePfx + "tbl.portal.admin", "//table[contains(@id,'obj-nav-form:portal-datatable')]");
+ private final String POR_TL_MAIN = getProp(casePfx + "por.tl.main", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:object-iid-link'')]");
+ private final String POR_TL_SECURITY = getProp(casePfx + "por.tl.security", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:security-link'')]");
+ private final String POR_TL_PROPERTIES = getProp(casePfx + "por.tl.properties", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:prop-link'')]");
+ private final String POR_TL_THEME = getProp(casePfx + "por.tl.theme", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:theme-link'')]");
+ private final String POR_TL_RENAME = getProp(casePfx + "por.tl.rename", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:rename'')]");
+ private final String POR_TL_DELETE = getProp(casePfx + "por.tl.delete", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:delete'')]");
+ private final String POR_TL_MAKEDEF = getProp(casePfx + "por.tl.makedef", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:default-link'')]");
+ private final String TBL_PORTALPAGE_ADMIN = getProp(casePfx + "tbl.portalpage.admin", "//table[contains(@id,'obj-nav-form:pages-datatable')]");
+ private final String PAG_TL_MAIN = getProp(casePfx + "pag.tl.main", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:object-link'')]");
+ private final String PAG_TL_LAYOUT = getProp(casePfx + "pag.tl.layout", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:edit-page-layout'')]");
+ private final String PAG_TL_SECURITY = getProp(casePfx + "pag.tl.security", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:security-link'')]");
+ private final String PAG_TL_PROPERTIES = getProp(casePfx + "pag.tl.properties", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:prop-link'')]");
+ private final String PAG_TL_THEME = getProp(casePfx + "pag.tl.theme", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:theme-link'')]");
+ private final String PAG_TL_RENAME = getProp(casePfx + "pag.tl.rename", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-link'')]");
+ private final String PAG_TL_DISPLAY = getProp(casePfx + "pag.tl.display", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-display'')]");
+ private final String PAG_TL_DELETE = getProp(casePfx + "pag.tl.delete", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:delete-link'')]");
+ private final String PAG_TL_MAKEDEF = getProp(casePfx + "pag.tl.makedef", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:default-link'')]");
+ private final String DIV_PORT_CONTENT = getProp(casePfx + "div.por.cont", "content-container");
+ private final String INP_GOO_SEARCH = getProp(casePfx + "inp.goo.search", "//div[contains(@id,'directory_search_div')]/form/input[@name='query']");
+ private final String SUB_GOO_SEARCH = getProp(casePfx + "sup.goo.search", "//div[contains(@id,'directory_search_div')]/form/input[@type='submit']");
+ private final String INP_NET_SEARCH = getProp(casePfx + "inp.goo.search", "//div[contains(@id,'directory_search_div')]/form/input[@name='query']");
+ private final String SUB_NET_SEARCH = getProp(casePfx + "sub.goo.search", "//div[contains(@id,'directory_search_div')]/form/input[@type='submit']");
+
+ /*
+ * - create a new portal - add couple of page to the portal - add few
+ * portlets of different kinds (csm, widget, regular portlets) in each page
+ * - verify that new portal, pages and portlets get added correctly. - Make
+ * the new portal default and verify that it becomes default portal
+ */
+
+ @BeforeMethod(groups = { "log" })
+ public void loginBeforeTest() {
+ logoutIfPossible();
+ login("admin", "admin");
+ }
+
+ @AfterMethod(groups = { "log" })
+ public void logoutAfterTest() {
+ }
+
+ final String portalName = "UseCasePortal";
+ final String page1Name = "firstPage";
+ final String page2Name = "anotherPage";
+ final String page3Name = "lastPage with whitespace";
+ final String page4Name = "dseer";
+ final String page5Name = "cemese";
+ final String PORTLET1 = "Cart Portlet";
+ final String por1str = "Cart Portlet";
+ final String PORTLET2 = "Band Culinaria";
+ final String por2str = "Band Culinaria";
+ final String PORTLET3 = "Cahuete.com";
+ final String por3str = "Cahuete.com";
+ final String PORTLET4 = "dir1/foo.txt";
+ final String por4str = "File Portlet";
+ final String PORTLET5 = "default/project.html";
+ final String por5str = "Our wiki knowledge base";
+
+ @Test(enabled = true, description = "Usecase for creating small portal with content.")
+ public void testCreatePortalUsecase() {
+ createPortal(portalName);
+
+ addPage(page1Name);
+ addPage(page2Name);
+ addPage(page3Name);
+ addPage(page4Name);
+ addPage(page5Name);
+
+ addPortlet(portalName, page1Name, PORTLET1, "portlet");
+ addPortlet(portalName, page2Name, PORTLET2, "widget/google");
+ addPortlet(portalName, page3Name, PORTLET3, "widget/netvibes");
+ addPortlet(portalName, page4Name, PORTLET4, "filesystem");
+ addPortlet(portalName, page5Name, PORTLET5, "cms");
+
+ makeDefaultPortal(portalName);
+
+ // Assert the portal is default
+ selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertEquals("", selenium.getText(DIV_PORT_CONTENT));
+ Assert.assertTrue(selenium.isElementPresent("link=" + page1Name));
+ Assert.assertTrue(selenium.isElementPresent("link=" + page2Name));
+ Assert.assertTrue(selenium.isElementPresent("link=" + page3Name));
+ Assert.assertTrue(selenium.isElementPresent("link=" + page4Name));
+ Assert.assertTrue(selenium.isElementPresent("link=" + page5Name));
+
+ // Assert pages contain what they should
+ assertPageContains(page1Name, por1str);
+ assertPageContains(page2Name, por2str);
+ assertPageContains(page3Name, por3str);
+ assertPageContains(page4Name, por4str);
+ assertPageContains(page5Name, por5str);
+
+ }
- public final String SEL_PORTLET_TYPE = getProp(casePfx+"sel.portlet.type","_jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:_viewRoot:windowForm:instanceId");
- private final String SUB_LAYOUT_ADD_CENTER = getProp(casePfx+"sub.layout.add.center","//input[contains(@id,'layoutForm:a_center')]");
- private final String INP_WINDOW_NAME = getProp(casePfx+"inp.window.name","//input[contains(@id,'windowForm:windowName')]");
- private final String SUB_RENAME_PORTAL = getProp(casePfx+"sub.rename.portal","//input[contains(@id,'renameForm:rename')]");
- private final String INP_RENAME_PORTAL = getProp(casePfx+"inp.rename.portal","//input[contains(@id,'renameForm:newName')]");
- private final String SUB_DELETE_PORTAL_CONF = getProp(casePfx+"sub.delete.portal.conf","//input[contains(@id,'delete-view:confirm-form:delete')]");
- private final String INP_SUBMIT_PAGECREATE = getProp(casePfx+"inp.submit.pagecreate","//input[contains(@id,'create-page-form:create-page')]");
- private final String INP_PAGENAME = getProp(casePfx+"inp.pagename","//input[contains(@id,'create-page-form:pageName')]");
- private final String INP_PORTALNAME = getProp(casePfx+"inp.portalname","//input[contains(@id,'create-portal-form:name')]");
- private final String INP_SUBMIT_CREATEPORTAL = getProp(casePfx+"inp.submit.createportal","//input[contains(@id,'create-portal-form:create-portal')]");
- private final String TAB_PORTALOBJ_ID = getProp(casePfx+"tab.portalobj.id","Link=Admin");
- private final String LNK_PORTALS_ID = getProp(casePfx+"lnk.portals.id","link=*Portal Objects*");
- private final String LNK_PORTAL_HOME = getProp(casePfx+"lnk.portal.home","//a[contains(@id,'obj-temp-form:object-link-0')]");
- private final String TBL_PORTAL_ADMIN = getProp(casePfx+"tbl.portal.admin","//table[contains(@id,'obj-nav-form:portal-datatable')]");
- private final String POR_TL_MAIN = getProp(casePfx+"por.tl.main","//a[contains(@id,''obj-nav-form:portal-datatable:{0}:object-iid-link'')]");
- private final String POR_TL_SECURITY = getProp(casePfx+"por.tl.security","//a[contains(@id,''obj-nav-form:portal-datatable:{0}:security-link'')]");
- private final String POR_TL_PROPERTIES = getProp(casePfx+"por.tl.properties","//a[contains(@id,''obj-nav-form:portal-datatable:{0}:prop-link'')]");
- private final String POR_TL_THEME = getProp(casePfx+"por.tl.theme","//a[contains(@id,''obj-nav-form:portal-datatable:{0}:theme-link'')]");
- private final String POR_TL_RENAME = getProp(casePfx+"por.tl.rename","//a[contains(@id,''obj-nav-form:portal-datatable:{0}:rename'')]");
- private final String POR_TL_DELETE = getProp(casePfx+"por.tl.delete","//a[contains(@id,''obj-nav-form:portal-datatable:{0}:delete'')]");
- private final String POR_TL_MAKEDEF = getProp(casePfx+"por.tl.makedef","//a[contains(@id,''obj-nav-form:portal-datatable:{0}:default-link'')]");
- private final String TBL_PORTALPAGE_ADMIN = getProp(casePfx+"tbl.portalpage.admin","//table[contains(@id,'obj-nav-form:pages-datatable')]");
- private final String PAG_TL_MAIN = getProp(casePfx+"pag.tl.main","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:object-link'')]");
- private final String PAG_TL_LAYOUT = getProp(casePfx+"pag.tl.layout","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:edit-page-layout'')]");
- private final String PAG_TL_SECURITY = getProp(casePfx+"pag.tl.security","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:security-link'')]");
- private final String PAG_TL_PROPERTIES = getProp(casePfx+"pag.tl.properties","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:prop-link'')]");
- private final String PAG_TL_THEME = getProp(casePfx+"pag.tl.theme","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:theme-link'')]");
- private final String PAG_TL_RENAME = getProp(casePfx+"pag.tl.rename","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-link'')]");
- private final String PAG_TL_DISPLAY = getProp(casePfx+"pag.tl.display","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-display'')]");
- private final String PAG_TL_DELETE = getProp(casePfx+"pag.tl.delete","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:delete-link'')]");
- private final String PAG_TL_MAKEDEF = getProp(casePfx+"pag.tl.makedef","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:default-link'')]");
-
- /*
- - create a new portal
- - add couple of page to the portal
- - add few portlets of different kinds (csm, widget, regular portlets) in each page
- - verify that new portal, pages and portlets get added correctly.
- - Make the new portal default and verify that it becomes default portal
- */
+ public void testManagePortal(){
+
+ }
- @BeforeMethod(groups = {"log"})
- public void loginBeforeTest() {
- logoutIfPossible();
- login("admin", "admin");
- }
+ private void assertPageContains(String pageName, String awaitStr) {
+ selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
- @AfterMethod(groups = {"log"})
- public void logoutAfterTest() {
- }
-
- final String portalName = "UseCasePortal";
- final String page1Name = "firstPage";
- final String page2Name = "anotherPage";
- final String page3Name = "lastPage with whitespace";
- final String page4Name = "_.s t R*a^n g e NAME _.][\\page";
- final String PORTLET1 = "link=*ExceptionPortletInstance*";
- final String PORTLET2 = "link=*CMSPortletInstance*";
- final String PORTLET3 = "link=*ExceptionPortletInstance*";
- final String PORTLET4 = "link=*ExceptionPortletInstance*";
+ selenium.click("link=" + pageName);
+ selenium.waitForPageToLoad(PAGE_LOAD);
- @Test(enabled = true, description = "Usecase for creating small portal with content.")
- public void testCreatePortalUsecase() {
- createPortal(portalName);
+ Assert.assertTrue(selenium.isTextPresent(awaitStr));
+ }
- addPage(page1Name);
- addPage(page2Name);
- addPage(page3Name);
- addPage(page4Name);
+ private void createPortal(String portalName) {
+ selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
- addPortlet(portalName, page1Name, PORTLET1, "portlet");
- addPortlet(portalName, page1Name, PORTLET2, "portlet");
- addPortlet(portalName, page1Name, PORTLET3, "portlet");
- addPortlet(portalName, page1Name, PORTLET4, "portlet");
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
- makeDefaultPortal(portalName);
- }
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LNK_PORTALS_ID);
+ clickIfVisible(LNK_PORTAL_HOME);
- private void createPortal(String portalName) {
- selenium.open("/portal/");
- selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertFalse(selenium.isTextPresent(portalName), "Not created page already exist.");
- selenium.click("link=Admin");
- selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(INP_PORTALNAME, portalName);
+ selenium.click(INP_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(TAB_PORTALOBJ_ID);
- clickIfVisible(LNK_PORTALS_ID);
- clickIfVisible(LNK_PORTAL_HOME);
+ Assert.assertTrue(selenium.isTextPresent(portalName));
+ }
- Assert.assertFalse(selenium.isTextPresent(portalName), "Not created page already exist.");
+ private void addPage(String pageName) {
+ selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(INP_PORTALNAME, portalName);
- selenium.click(INP_SUBMIT_CREATEPORTAL);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent(portalName));
- }
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LNK_PORTALS_ID);
+ clickIfVisible(LNK_PORTAL_HOME);
- private void addPage(String pageName) {
- selenium.open("/portal/");
- selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(INP_PORTALNAME, portalName);
+ selenium.click(INP_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Admin");
- selenium.waitForPageToLoad(PAGE_LOAD);
+ int r = findTableRow(TBL_PORTAL_ADMIN, portalName, 0) - 1;
- clickIfVisible(TAB_PORTALOBJ_ID);
- clickIfVisible(LNK_PORTALS_ID);
- clickIfVisible(LNK_PORTAL_HOME);
+ selenium.click(MessageFormat.format(POR_TL_MAIN, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(INP_PORTALNAME, portalName);
- selenium.click(INP_SUBMIT_CREATEPORTAL);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertFalse(selenium.isTextPresent(pageName), "Portal page already present");
+ Assert.assertTrue(selenium.isTextPresent("Create a page named:"));
- int r = findTableRow(TBL_PORTAL_ADMIN, portalName, 0) - 1;
+ selenium.type(INP_PAGENAME, pageName);
+ selenium.click(INP_SUBMIT_PAGECREATE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent(pageName));
+ }
- selenium.click(MessageFormat.format(POR_TL_MAIN, r));
- selenium.waitForPageToLoad(PAGE_LOAD);
+ private void addPortlet(String portalName, String pageName, String portletName, String type) {
+ selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertFalse(selenium.isTextPresent(pageName), "Portal page already present");
- Assert.assertTrue(selenium.isTextPresent("Create a page named:"));
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(INP_PAGENAME, pageName);
- selenium.click(INP_SUBMIT_PAGECREATE);
- selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent(pageName));
- }
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LNK_PORTALS_ID);
+ clickIfVisible(LNK_PORTAL_HOME);
- private void addPortlet(String portalName, String pageName, String portletName, String type) {
- selenium.open("/portal/");
- selenium.waitForPageToLoad(PAGE_LOAD);
+ int r = findTableRow(TBL_PORTAL_ADMIN, portalName, 0) - 1;
+ selenium.click(MessageFormat.format(POR_TL_MAIN, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Admin");
- selenium.waitForPageToLoad(PAGE_LOAD);
+ r = findTableRow(TBL_PORTALPAGE_ADMIN, pageName, 0) - 1;
- clickIfVisible(TAB_PORTALOBJ_ID);
- clickIfVisible(LNK_PORTALS_ID);
- clickIfVisible(LNK_PORTAL_HOME);
+ // click on the page layout
+ selenium.click(MessageFormat.format(PAG_TL_LAYOUT, r));
- int r = findTableRow(TBL_PORTAL_ADMIN, portalName, 0) - 1;
- selenium.click(MessageFormat.format(POR_TL_MAIN, r));
- selenium.waitForPageToLoad(PAGE_LOAD);
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
- r = findTableRow(TBL_PORTALPAGE_ADMIN, pageName, 0) - 1;
+ // hack
+ selenium.select(SEL_PORTLET_TYPE, "label=" + "cms");
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
- // click on the page layout
- selenium.click(MessageFormat.format(PAG_TL_LAYOUT, r));
+ selenium.select(SEL_PORTLET_TYPE, "label=" + type);
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
-
- //hack
- selenium.select(SEL_PORTLET_TYPE, "label=" + "cms");
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
-
- selenium.select(SEL_PORTLET_TYPE, "label=" + type);
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
+ if ("portlet".equals(type)) {
- selenium.click(portletName);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ } else if ("widget/google".equals(type)) {
+ selenium.type(INP_GOO_SEARCH, portletName);
+ selenium.click(SUB_GOO_SEARCH);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ } else if ("widget/netvibes".equals(type)) {
+ selenium.type(INP_NET_SEARCH, portletName);
+ selenium.click(SUB_NET_SEARCH);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ } else if ("cms".equals(type)) {
+ String[] links = portletName.split("/");
+ selenium.click("link="+links[0]);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ portletName = links[1];
+ } else if ("filesystem".equals(type)) {
+ String[] links = portletName.split("/");
+ selenium.click("link="+links[0]);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ portletName = links[1];
+ }
- selenium.click(SUB_LAYOUT_ADD_CENTER);
- selenium.waitForPageToLoad(PAGE_LOAD);
- }
+ selenium.click("link=*" + portletName+"*");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(SUB_LAYOUT_ADD_CENTER);
+ selenium.waitForPageToLoad(PAGE_LOAD);
- private void makeDefaultPortal(String portalName) {
- selenium.open("/portal/");
- selenium.waitForPageToLoad(PAGE_LOAD);
+ }
- selenium.click("link=Admin");
- selenium.waitForPageToLoad(PAGE_LOAD);
+ private void makeDefaultPortal(String portalName) {
+ selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(TAB_PORTALOBJ_ID);
- clickIfVisible(LNK_PORTALS_ID);
- clickIfVisible(LNK_PORTAL_HOME);
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
- int r = findTableRow(TBL_PORTAL_ADMIN, portalName, 0) - 1;
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LNK_PORTALS_ID);
+ clickIfVisible(LNK_PORTAL_HOME);
- selenium.click(MessageFormat.format(POR_TL_MAKEDEF, r));
- selenium.waitForPageToLoad(PAGE_LOAD);
- }
+ int r = findTableRow(TBL_PORTAL_ADMIN, portalName, 0) - 1;
+
+ selenium.click(MessageFormat.format(POR_TL_MAKEDEF, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ }
}
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletDefinitionsTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletDefinitionsTestCase.java 2009-02-24 13:39:09 UTC (rev 12879)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletDefinitionsTestCase.java 2009-02-24 14:30:01 UTC (rev 12880)
@@ -10,19 +10,22 @@
public class PortletDefinitionsTestCase extends JBossPortalSeleniumTestCase{
- private static final String T_LINK_PREF = "//a[contains(@id,''def-list:portlet-pref-{0}'')]";
- private static final String SUBMIT_CREATE_INST = "//input[contains(@name,'add_instance_form:j_id19')]";
- private static final String INPUT_INSTANCE_NAME = "//input[contains(@id,'add_instance_form:instanceId')]";
- private static final String T_LINK_CREATE = "//a[contains(@id,''def-list:create-instance-{0}'')]";
- private static final String SUBMIT_PROVIDER_VIEW = "//input[contains(@id,'definition-form:view-portlets')]";
- private static final String SELECT_PROVIDER = "//select[contains(@id,'definition-form:menu')]";
- private static final String TABLE_PORTLET = "//form[contains(@id,'def-list')]/table";
- private static final String LINK_NAME_ADMIN_PORT = "//a[contains(@id,'common-show-portlet-detail-form:field1:select')]";
- private static final String LINK_ADMIN_PORT = "//a[contains(@id,'def-list:portlet-def-0')]";
- private static final String LINK_ADMIN = "link=Admin";
- private static final String LINK_TAB_PD = "//a[contains(@id,'admin-subtab-form:portlet-def-link')]";
- private static final String LINK_PD_MAIN = "//a[contains(@id,'man-form:def-link')]";
+ public final String casePfx = "portal.port.def.";
+ private final String T_LINK_PREF = getProp(casePfx+"t.link.pref","//a[contains(@id,''def-list:portlet-pref-{0}'')]");
+ private final String SUBMIT_CREATE_INST = getProp(casePfx+"submit.create.inst","//input[contains(@name,'add_instance_form:j_id19')]");
+ private final String INPUT_INSTANCE_NAME = getProp(casePfx+"input.instance.name","//input[contains(@id,'add_instance_form:instanceId')]");
+ private final String T_LINK_CREATE = getProp(casePfx+"t.link.create","//a[contains(@id,''def-list:create-instance-{0}'')]");
+ private final String SUBMIT_PROVIDER_VIEW = getProp(casePfx+"submit.provider.view","//input[contains(@id,'definition-form:view-portlets')]");
+ private final String SELECT_PROVIDER = getProp(casePfx+"select.provider","//select[contains(@id,'definition-form:menu')]");
+ private final String TABLE_PORTLET = getProp(casePfx+"table.portlet","//form[contains(@id,'def-list')]/table");
+ private final String LINK_NAME_ADMIN_PORT = getProp(casePfx+"link.name.admin.port","//a[contains(@id,'common-show-portlet-detail-form:field1:select')]");
+ private final String LINK_ADMIN_PORT = getProp(casePfx+"link.admin.port","//a[contains(@id,'def-list:portlet-def-0')]");
+ private final String LINK_ADMIN = getProp(casePfx+"link.admin","link=Admin");
+ private final String LINK_TAB_PD = getProp(casePfx+"link.tab.pd","//a[contains(@id,'admin-subtab-form:portlet-def-link')]");
+ private final String LINK_PD_MAIN = getProp(casePfx+"link.pd.main","//a[contains(@id,'man-form:def-link')]");
+
+
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
logoutIfPossible();
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletInstancesTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletInstancesTestCase.java 2009-02-24 13:39:09 UTC (rev 12879)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletInstancesTestCase.java 2009-02-24 14:30:01 UTC (rev 12880)
@@ -10,45 +10,44 @@
public class PortletInstancesTestCase extends JBossPortalSeleniumTestCase {
- private static final String TAB_PORTLET_INSTANCES = "//table[contains(@id,'instancesTable2')]";
- private static final String UL_PAGINATOR = "//ul[@class='pagination property-container']";
- private static final String SUBMIT_SECURITY_UPDATE = "//input[contains(@id,'common-edit-security-form:update')]";
- private static final String SUBMIT_SECURITY_CANCEL = "//input[contains(@id,'common-edit-security-form:cancel')]";
+ public final String casePfx = "portal.port.ins.";
- private static final String LINK_20_PAGE = "link=20";
- private static final String LINK_PREF_WELCOMEPORT = "//a[contains(@id,'security-JSPPortletInstance')]";
+ private final String TAB_PORTLET_INSTANCES = getProp(casePfx + "tab.portlet.instances", "//table[contains(@id,'instancesTable2')]");
+ private final String UL_PAGINATOR = getProp(casePfx + "ul.paginator", "//ul[@class='pagination property-container']");
+ private final String SUBMIT_SECURITY_UPDATE = getProp(casePfx + "submit.security.update", "//input[contains(@id,'common-edit-security-form:update')]");
+ private final String SUBMIT_SECURITY_CANCEL = getProp(casePfx + "submit.security.cancel", "//input[contains(@id,'common-edit-security-form:cancel')]");
+ private final String LINK_20_PAGE = getProp(casePfx + "link.20.page", "link=20");
+ private final String LINK_PREF_WELCOMEPORT = getProp(casePfx + "link.pref.welcomeport", "//a[contains(@id,'security-JSPPortletInstance')]");
+ private final String TABLE_PREF_KEY = getProp(casePfx + "table.pref.key", "//form[contains(@id,'common-edit-pref-form')]/table");
+ private final String SUBMIT_PREF_DELETE = getProp(casePfx + "submit.pref.delete", "//input[contains(@id,'common-edit-exisiting-form:row_0')]");
+ private final String LINK_PREF_GUESTNUM = getProp(casePfx + "link.pref.guestnum", "//a[contains(@id,'common-edit-pref-form:pref-link-0')]");
+ private final String INPUT_PREF_NEWVAL = getProp(casePfx + "input.pref.newval", "//input[contains(@id,'common-append-form:new_value')]");
+ private final String SUBMIT_PREF_UPDATE = getProp(casePfx + "submit.pref.update", "//input[contains(@id,'common-append-form:append-button')]");
+ private final String SUBMIT_PREF_SAVE = getProp(casePfx + "submit.pref.save", "//input[contains(@id,':save')]");
+ private final String INPUT_PREF_UPDATE = getProp(casePfx + "input.pref.update", "//input[contains(@id,'common-edit-exisiting-form:update')]");
+ private final String INPUT_PREF_APPEND = getProp(casePfx + "input.pref.append", "//input[contains(@id,'common-edit-exisiting-form:pref-input-0')]");
+ private final String SUBMIT_PREF_CANCEL = getProp(casePfx + "submit.pref.cancel", "//input[contains(@id,':cancel')]");
+ private final String LINK_CURUSER_PREFERENCES = getProp(casePfx + "link.curuser.preferences","//a[contains(@id,'instances-form:preference-CurrentUsersPortletInstance')]");
+ private final String LINK_DEL_EXCEPTPORT = getProp(casePfx + "link.del.exceptport", "//a[contains(@id,'instances-form:delete-GoogleMapPortletInstance')]");
+ private final String SUBMIT_PI_DELETE_CONF = getProp(casePfx + "submit.pi.delete.conf", "//input[contains(@id,'confirm-delete-form1:delete')]");
+ private final String SUBMIT_PI_DELETE_CANC = getProp(casePfx + "submit.pi.delete.canc", "//input[contains(@id,'confirm-delete-form1:cancel')]");
+ private final String T_LINK_DELETENAME = getProp(casePfx + "t.link.deletename","//a[contains(@id,''instance-display-form:locale-datatable:{0}:delete-link'')]");
+ private final String T_LINK_MODIFYNAME = getProp(casePfx + "t.link.modifyname","//a[contains(@id,''instance-display-form:locale-datatable:{0}:edit-link'')]");
+ private final String LINK_COUNTPORT = getProp(casePfx + "link.countport", "//a[contains(@id,'instances-form:CurrentUsersPortletInstance')]");
+ private final String NAME_COUNTPORT = getProp(casePfx + "name.countport", "CurrentUsersPortletInstance");
+ private final String SUBMIT_MODIFY_NAME = getProp(casePfx + "submit.modify.name", "//input[contains(@id,'add-display-name-form:addDisplay')]");
+ private final String INPUT_NAME = getProp(casePfx + "input.name", "//input[contains(@id,'add-display-name-form:newName')]");
+ private final String SELECT_LANGUAGE = getProp(casePfx + "select.language", "//select[contains(@id,'add-display-name-form:locales')]");
+ private final String LINK_ADMIN = getProp(casePfx + "link.admin", "link=Admin");
+ private final String LINK_TAB_PI = getProp(casePfx + "link.tab.pi", "//a[contains(@id,'admin-subtab-form:portlet-instance-link')]");
+ private final String LINK_PI_MAIN = getProp(casePfx + "link.pi.main", "//a[contains(@id,'instance-form1:instance-link')]");
+ private final String TABLE_DISPNAMES = getProp(casePfx + "table.dispnames", "//table[contains(@id,'instance-display-form:locale-datatable')]");
+ private final String LNK_SEC_BUTTON = getProp(casePfx + "lnk.sec.button","//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td/table/tbody/tr/td/a[contains(@class,''Security'')]");
+ private final String LNK_PREF_BUTTON = getProp(casePfx + "lnk.pref.button","//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td/table/tbody/tr/td/a[contains(@class,''actionPreferences'')]");
+ private final String LNK_DEL_BUTTON = getProp(casePfx + "lnk.del.button","//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td/table/tbody/tr/td/a[contains(@class,''actionDeleteInstance'')]");
+ private final String LNK_INSTANCE_BUTTON = getProp(casePfx + "lnk.instance.button", "//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td[1]/a[1]");
- private static final String TABLE_PREF_KEY = "//form[contains(@id,'common-edit-pref-form')]/table";
-
- private static final String SUBMIT_PREF_DELETE = "//input[contains(@id,'common-edit-exisiting-form:row_0')]";
- private static final String LINK_PREF_GUESTNUM = "//a[contains(@id,'common-edit-pref-form:pref-link-0')]";
- private static final String INPUT_PREF_NEWVAL = "//input[contains(@id,'common-append-form:new_value')]";
- private static final String SUBMIT_PREF_UPDATE = "//input[contains(@id,'common-append-form:append-button')]";
- private static final String SUBMIT_PREF_SAVE = "//input[contains(@id,':save')]";
- private static final String INPUT_PREF_UPDATE = "//input[contains(@id,'common-edit-exisiting-form:update')]";
- private static final String INPUT_PREF_APPEND = "//input[contains(@id,'common-edit-exisiting-form:pref-input-0')]";
- private static final String SUBMIT_PREF_CANCEL = "//input[contains(@id,':cancel')]";
- private static final String LINK_CURUSER_PREFERENCES = "//a[contains(@id,'instances-form:preference-CurrentUsersPortletInstance')]";
- private static final String LINK_DEL_EXCEPTPORT = "//a[contains(@id,'instances-form:delete-GoogleMapPortletInstance')]";
- private static final String SUBMIT_PI_DELETE_CONF = "//input[contains(@id,'confirm-delete-form1:delete')]";
- private static final String SUBMIT_PI_DELETE_CANC = "//input[contains(@id,'confirm-delete-form1:cancel')]";
- private static final String T_LINK_DELETENAME = "//a[contains(@id,''instance-display-form:locale-datatable:{0}:delete-link'')]";
- private static final String T_LINK_MODIFYNAME = "//a[contains(@id,''instance-display-form:locale-datatable:{0}:edit-link'')]";
- private static final String LINK_COUNTPORT = "//a[contains(@id,'instances-form:CurrentUsersPortletInstance')]";
- private static final String NAME_COUNTPORT = "CurrentUsersPortletInstance";
- private static final String SUBMIT_MODIFY_NAME = "//input[contains(@id,'add-display-name-form:addDisplay')]";
- private static final String INPUT_NAME = "//input[contains(@id,'add-display-name-form:newName')]";
- private static final String SELECT_LANGUAGE = "//select[contains(@id,'add-display-name-form:locales')]";
- private static final String LINK_ADMIN = "link=Admin";
- private static final String LINK_TAB_PI = "//a[contains(@id,'admin-subtab-form:portlet-instance-link')]";
- private static final String LINK_PI_MAIN = "//a[contains(@id,'instance-form1:instance-link')]";
- private static final String TABLE_DISPNAMES = "//table[contains(@id,'instance-display-form:locale-datatable')]";
- private static final String LNK_SEC_BUTTON = "//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td/table/tbody/tr/td/a[contains(@class,''Security'')]";
- private static final String LNK_PREF_BUTTON = "//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td/table/tbody/tr/td/a[contains(@class,''actionPreferences'')]";
- private static final String LNK_DEL_BUTTON = "//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td/table/tbody/tr/td/a[contains(@class,''actionDeleteInstance'')]";
- private static final String LNK_INSTANCE_BUTTON = "//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td[1]/a[1]";
-
- // private static final String LNK_PREF_WELCOMEPORT =
+ // private final String LNK_PREF_WELCOMEPORT =
// "//a[contains(@id,'security-JSPPortletInstance')]";
@BeforeMethod(groups = { "log" })
@@ -65,11 +64,11 @@
@Test(enabled = true)
public void testAddName() {
- int r = traversePortlets(NAME_COUNTPORT,0);
+ int r = traversePortlets(NAME_COUNTPORT, 0);
clickAndWait(MessageFormat.format(LNK_INSTANCE_BUTTON, r));
-
+
safeSelect(SELECT_LANGUAGE, "English");
-
+
final String name = "Administracning";
selenium.type(INPUT_NAME, name);
clickAndWait(SUBMIT_MODIFY_NAME);
@@ -79,8 +78,8 @@
@Test(enabled = true)
public void testDeleteName() {
// adding the name
- int r = traversePortlets(NAME_COUNTPORT,0);
- clickAndWait(MessageFormat.format(LNK_INSTANCE_BUTTON, r));
+ int r = traversePortlets(NAME_COUNTPORT, 0);
+ clickAndWait(MessageFormat.format(LNK_INSTANCE_BUTTON, r));
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.select(SELECT_LANGUAGE, "label=Japanese");
@@ -101,9 +100,9 @@
@Test(enabled = true)
public void testModifyName() {
- int r = traversePortlets(NAME_COUNTPORT,0);
+ int r = traversePortlets(NAME_COUNTPORT, 0);
clickAndWait(MessageFormat.format(LNK_INSTANCE_BUTTON, r));
-
+
selenium.select(SELECT_LANGUAGE, "label=Japanese");
final String name = "Adminisimo";
final String nameNew = "Adminiprisimo";
@@ -126,20 +125,18 @@
Assert.assertTrue(findTableRow(TABLE_DISPNAMES, nameNew, 1) >= 0);
}
-
-
@Test(enabled = true)
public void testSecure() {
String instance_name = "JSPPortletInstance";
- //String table = TAB_PORTLET_INSTANCES;
+ // String table = TAB_PORTLET_INSTANCES;
// selenium.click(LINK_20_PAGE);
// selenium.waitForPageToLoad(PAGE_LOAD);
- //int r = findTableRow(table, instance_name, 0);
- int r = traversePortlets(instance_name,0);
+ // int r = findTableRow(table, instance_name, 0);
+ int r = traversePortlets(instance_name, 0);
selenium.click(MessageFormat.format(LNK_SEC_BUTTON, r));
-
+
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("//input[contains(@name,'common-edit-security-form:cars_2')]");
selenium.click("//input[contains(@name,'common-edit-security-form:cars_1')]");
@@ -160,9 +157,9 @@
// selenium.click(LINK_20_PAGE);
// selenium.waitForPageToLoad(PAGE_LOAD);
- //r = findTableRow(table, instance_name, 0);
- r = traversePortlets(instance_name,0);
-
+ // r = findTableRow(table, instance_name, 0);
+ r = traversePortlets(instance_name, 0);
+
selenium.click(MessageFormat.format(LNK_SEC_BUTTON, r));
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("//input[contains(@name,'common-edit-security-form:cars_0')]");
@@ -181,8 +178,8 @@
// selenium.setSpeed("5000");
// selenium.click(LINK_20_PAGE);
// selenium.waitForPageToLoad(PAGE_LOAD);
- //r = findTableRow(table, instance_name, 0);
- r = traversePortlets(instance_name,0);
+ // r = findTableRow(table, instance_name, 0);
+ r = traversePortlets(instance_name, 0);
selenium.click(MessageFormat.format(LNK_SEC_BUTTON, r));
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("//input[contains(@name,'common-edit-security-form:cars_0')]");
@@ -202,47 +199,47 @@
public void testDeleteInstance() {
// cancel first
String instance_name = "WeatherPortletInstance";
- //selenium.setSpeed("5000");
- int r = traversePortlets(instance_name,1);
-
- Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(LNK_INSTANCE_BUTTON, r)), instance_name+" portlet not found.");
+ // selenium.setSpeed("5000");
+ int r = traversePortlets(instance_name, 1);
+
+ Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(LNK_INSTANCE_BUTTON, r)), instance_name + " portlet not found.");
clickAndWait(MessageFormat.format(LNK_DEL_BUTTON, r));
-
+
Assert.assertTrue(selenium.isTextPresent("WARNING!"));
Assert.assertTrue(selenium.isTextPresent("Are you sure you want to delete this portlet instance ?"));
selenium.click(SUBMIT_PI_DELETE_CANC);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
// delete
- goToPI();
- r = traversePortlets(instance_name,1);
- Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(LNK_INSTANCE_BUTTON, r)), instance_name+" portlet not found.");
+ goToPI();
+ r = traversePortlets(instance_name, 1);
+ Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(LNK_INSTANCE_BUTTON, r)), instance_name + " portlet not found.");
clickAndWait(MessageFormat.format(LNK_DEL_BUTTON, r));
-
+
Assert.assertTrue(selenium.isTextPresent("WARNING!"));
Assert.assertTrue(selenium.isTextPresent("Are you sure you want to delete this portlet instance ?"));
selenium.click(SUBMIT_PI_DELETE_CONF);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- r = traversePortlets(instance_name,1);
- Assert.assertFalse(selenium.isElementPresent(MessageFormat.format(LNK_INSTANCE_BUTTON, r)), "previously deleted "+instance_name+" portlet found.");
-
+
+ r = traversePortlets(instance_name, 1);
+ Assert.assertFalse(selenium.isElementPresent(MessageFormat.format(LNK_INSTANCE_BUTTON, r)), "previously deleted " + instance_name + " portlet found.");
+
}
@Test(enabled = true)
public void testPreferences() {
-
- int r = traversePortlets(NAME_COUNTPORT,0);
- clickAndWait(MessageFormat.format(LNK_PREF_BUTTON, r));
- //selenium.click(LINK_CURUSER_PREFERENCES);
-
+
+ int r = traversePortlets(NAME_COUNTPORT, 0);
+ clickAndWait(MessageFormat.format(LNK_PREF_BUTTON, r));
+ // selenium.click(LINK_CURUSER_PREFERENCES);
+
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(SUBMIT_PREF_CANCEL);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- r = traversePortlets(NAME_COUNTPORT,0);
- clickAndWait(MessageFormat.format(LNK_PREF_BUTTON, r));
-
+
+ r = traversePortlets(NAME_COUNTPORT, 0);
+ clickAndWait(MessageFormat.format(LNK_PREF_BUTTON, r));
+
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(findTableRow(TABLE_PREF_KEY, "guestNumber", 0) >= 0);
selenium.click(LINK_PREF_GUESTNUM);
@@ -270,7 +267,7 @@
selenium.click(SUBMIT_PREF_SAVE);
selenium.waitForPageToLoad(PAGE_LOAD);
}
-
+
// acquiring link names from paginator
private String[] getPages(String paginator_location) {
@@ -281,32 +278,34 @@
}
/*
- * function for traversing the portles in the portles table. when a string in
- * selected columns is not found, links form paginator are used to look to the next page
+ * function for traversing the portles in the portles table. when a string
+ * in selected columns is not found, links form paginator are used to look
+ * to the next page
*/
- private int traversePortlets(String instance_name,int row) {
+ private int traversePortlets(String instance_name, int row) {
int r = -1;
-
+
r = findTableRow(TAB_PORTLET_INSTANCES, instance_name, row);
-
+
if (r >= 0)
return r;
-
+
String pages[] = getPages(UL_PAGINATOR);
for (String page : pages) {
if ("".equals(page.trim()))
continue;
selenium.click("link=" + page);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
r = findTableRow(TAB_PORTLET_INSTANCES, instance_name, row);
-
+
if (r >= 0)
break;
}
return r;
}
+
private void goToPI() {
selenium.open(ADDR_PORTAL);
clickIfVisible(LINK_ADMIN);
15 years, 2 months
JBoss Portal SVN: r12879 - in tags/JBoss_Portal_2_7_2: server/src/main/org/jboss/portal/server and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-02-24 08:39:09 -0500 (Tue, 24 Feb 2009)
New Revision: 12879
Modified:
tags/JBoss_Portal_2_7_2/build/build.xml
tags/JBoss_Portal_2_7_2/server/src/main/org/jboss/portal/server/PortalConstants.java
Log:
2.7.2
Modified: tags/JBoss_Portal_2_7_2/build/build.xml
===================================================================
--- tags/JBoss_Portal_2_7_2/build/build.xml 2009-02-24 12:41:16 UTC (rev 12878)
+++ tags/JBoss_Portal_2_7_2/build/build.xml 2009-02-24 13:39:09 UTC (rev 12879)
@@ -61,7 +61,7 @@
<property name="version.major" value="2"/>
<property name="version.minor" value="7"/>
- <property name="version.revision" value="1"/>
+ <property name="version.revision" value="2"/>
<property name="version.tag" value="GA"/>
<property name="version.name" value="Community"/>
Modified: tags/JBoss_Portal_2_7_2/server/src/main/org/jboss/portal/server/PortalConstants.java
===================================================================
--- tags/JBoss_Portal_2_7_2/server/src/main/org/jboss/portal/server/PortalConstants.java 2009-02-24 12:41:16 UTC (rev 12878)
+++ tags/JBoss_Portal_2_7_2/server/src/main/org/jboss/portal/server/PortalConstants.java 2009-02-24 13:39:09 UTC (rev 12879)
@@ -36,7 +36,7 @@
{
/** Current version. */
- public static final Version VERSION = new Version("JBoss Portal", 2, 7, 2, new Version.Qualifier(Version.Qualifier.Prefix.SNAPSHOT), "Community");
+ public static final Version VERSION = new Version("JBoss Portal", 2, 7, 2, new Version.Qualifier(Version.Qualifier.Prefix.GA), "Community");
/** The default portal name. */
public static final String DEFAULT_PORTAL_NAME = "default";
15 years, 2 months
JBoss Portal SVN: r12878 - tags.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-02-24 07:41:16 -0500 (Tue, 24 Feb 2009)
New Revision: 12878
Added:
tags/JBoss_Portal_2_7_2/
Log:
Tagging JBoss Portal 2.7.2
Copied: tags/JBoss_Portal_2_7_2 (from rev 12877, branches/JBoss_Portal_Branch_2_7)
15 years, 2 months
JBoss Portal SVN: r12877 - in branches/JBoss_Portal_Branch_2_7/core-admin/src: resources/portal-admin-war/jsf/common and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-02-24 06:12:12 -0500 (Tue, 24 Feb 2009)
New Revision: 12877
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/DisplayNameAction.java
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/showPortletDetails.xhtml
Log:
- JBPORTAL-2317: Better target for messages.
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/DisplayNameAction.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/DisplayNameAction.java 2009-02-24 10:26:55 UTC (rev 12876)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/DisplayNameAction.java 2009-02-24 11:12:12 UTC (rev 12877)
@@ -102,7 +102,7 @@
public void addDisplayName() throws ConversionException
{
- newText = checkNameValidity(newText, null);
+ newText = checkNameValidity(newText, "display-names-view:add-display-name-form:newName");
if (newText != null)
{
HasDisplayName hasDisplayName = getTarget();
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/showPortletDetails.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/showPortletDetails.xhtml 2009-02-24 10:26:55 UTC (rev 12876)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/jsf/common/showPortletDetails.xhtml 2009-02-24 11:12:12 UTC (rev 12877)
@@ -123,69 +123,68 @@
<div class="half-width float-right details-right-col">
-<f:subview rendered="#{showDisplayNameEditor}">
+<f:subview rendered="#{showDisplayNameEditor}" id="display-names-view">
<div class="whiteWithLtGreyHeader meta-box">
<h3 class="blue">#{bundle.COMMON_ADD_INSTANCE_DISPLAY_NAMES}</h3>
<div class="pad5">
- <h:form id="add-display-name-form" style="background-color:transparent;width:100%;margin:0;padding:0;display:inline;">
- <h:inputText id="newName" value="#{instanceDisplayNameAction.newText}" required="true"/>
- <h:selectOneMenu id="locales" value="#{instanceDisplayNameAction.newLocale}">
- <f:selectItems value="#{instanceDisplayNameAction.locales}"/>
- </h:selectOneMenu>
- <h:commandButton id="addDisplay" value="#{instanceDisplayNameAction.newText ne null ? 'Modify' : 'Add'} Name"
- action="#{instanceDisplayNameAction.addDisplayName}"
- styleClass="portlet-form-button"/>
- </h:form>
+ <h:form id="add-display-name-form" style="background-color:transparent;width:100%;margin:0;padding:0;display:inline;">
+ <h:inputText id="newName" value="#{instanceDisplayNameAction.newText}" required="true"/>
+ <h:message for="newName" errorClass="portlet-msg-error"/>
+ <h:selectOneMenu id="locales" value="#{instanceDisplayNameAction.newLocale}">
+ <f:selectItems value="#{instanceDisplayNameAction.locales}"/>
+ </h:selectOneMenu>
+ <h:commandButton id="addDisplay" value="#{instanceDisplayNameAction.newText ne null ? 'Modify' : 'Add'} Name"
+ action="#{instanceDisplayNameAction.addDisplayName}" styleClass="portlet-form-button"/>
+ </h:form>
</div>
<br/>
<h3 class="blue">#{bundle.COMMON_CURRENT_INSTANCE_DISPLAY_NAMES}</h3>
<div class="pad5">
+ <h:form id="instance-display-form" style="display:inline;width:100%;">
+ <h:dataTable id="locale-datatable" var="value" value="#{instanceDisplayNameAction.currentLocales}"
+ styleClass="objectList datatable"
+ rowClasses="portlet-section-body,portlet-section-alternate-blue"
+ columnClasses="objectNameColumn, objectActionColumn"
+ headerClass="portlet-section-header">
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="#{bundle.COMMON_LOCALE}"/>
+ </f:facet>
+ #{value.localeDisplayName}
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="#{bundle.COMMON_DISPLAY_NAME}"/>
+ </f:facet>
+ #{value.text}
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="#{bundle.COMMON_DELETE}"/>
+ </f:facet>
- <h:form id="instance-display-form" style="display:inline;width:100%;">
- <h:dataTable id="locale-datatable" var="value" value="#{instanceDisplayNameAction.currentLocales}"
- styleClass="objectList datatable"
- rowClasses="portlet-section-body,portlet-section-alternate-blue"
- columnClasses="objectNameColumn, objectActionColumn"
- headerClass="portlet-section-header">
- <h:column>
- <f:facet name="header">
- <h:outputText value="#{bundle.COMMON_LOCALE}"/>
- </f:facet>
- #{value.localeDisplayName}
- </h:column>
- <h:column>
- <f:facet name="header">
- <h:outputText value="#{bundle.COMMON_DISPLAY_NAME}"/>
- </f:facet>
- #{value.text}
- </h:column>
- <h:column>
- <f:facet name="header">
- <h:outputText value="#{bundle.COMMON_DELETE}"/>
- </f:facet>
+ <div><h:commandLink id="delete-link" action="#{instanceDisplayNameAction.editDisplayName}">
+ <h:outputText styleClass="actionDelete" value="#{bundle.COMMON_DELETE}"/>
+ <f:param name="locale" value="#{value.locale}"/>
+ <f:param name="editAction" value="delete"/>
+ </h:commandLink></div>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="#{bundle.RENAME}"/>
+ </f:facet>
- <div><h:commandLink id="delete-link" action="#{instanceDisplayNameAction.editDisplayName}">
- <h:outputText styleClass="actionDelete" value="#{bundle.COMMON_DELETE}"/>
- <f:param name="locale" value="#{value.locale}"/>
- <f:param name="editAction" value="delete"/>
- </h:commandLink></div>
- </h:column>
- <h:column>
- <f:facet name="header">
- <h:outputText value="#{bundle.RENAME}"/>
- </f:facet>
-
- <div style="width:150px">
- <h:commandLink id="edit-link" action="#{instanceDisplayNameAction.editDisplayName}">
- <h:outputText styleClass="actionRename" value="#{bundle.RENAME}"/>
- <f:param name="locale" value="#{value.locale}"/>
- <f:param name="editAction" value="rename"/>
- </h:commandLink></div>
- </h:column>
- </h:dataTable>
- </h:form>
+ <div style="width:150px">
+ <h:commandLink id="edit-link" action="#{instanceDisplayNameAction.editDisplayName}">
+ <h:outputText styleClass="actionRename" value="#{bundle.RENAME}"/>
+ <f:param name="locale" value="#{value.locale}"/>
+ <f:param name="editAction" value="rename"/>
+ </h:commandLink></div>
+ </h:column>
+ </h:dataTable>
+ </h:form>
</div>
</div>
@@ -207,7 +206,7 @@
</c:forEach>
</dl>
</portal:box>
- <portal:box class="whiteWithLtGreyHeader meta-box">
+<portal:box class="whiteWithLtGreyHeader meta-box">
<h3>#{bundle.COMMON_CONSUMED_EVENTS}</h3>
<dl>
<c:forEach var="consumedEvent" items="#{portlet.consumedEvents}">
15 years, 2 months
JBoss Portal SVN: r12876 - branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-02-24 05:26:55 -0500 (Tue, 24 Feb 2009)
New Revision: 12876
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties
Log:
- JBPORTAL-2317: Updated localization.
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties 2009-02-24 10:26:12 UTC (rev 12875)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties 2009-02-24 10:26:55 UTC (rev 12876)
@@ -104,6 +104,7 @@
COMMON_DEFINE_NAME_WINDOW=Define a name for the window of content (optional)
COMMON_WINDOW_NAME=Window Name
COMMON_SELECT_TYPE_CONTENT=Select the type of content that will be added to the page
+COMMON_NO_SELECTED_CONTENT=You must select a content type!
COMMON_CONTENT_TYPE=Content Type
COMMON_SELECT_CONTENT=Select content that will be added to the page
COMMON_PAGE_LAYOUT=Page Layout
@@ -336,3 +337,4 @@
DISPLAY_NAME_TYPE=display name
PROPERTY_TYPE=property
PORTAL_OBJECT_TYPE=portal object
+WINDOW_TYPE=window
15 years, 2 months
JBoss Portal SVN: r12875 - in branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui: common and 1 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-02-24 05:26:12 -0500 (Tue, 24 Feb 2009)
New Revision: 12875
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/dashboard/DashboardBean.java
Log:
- JBPORTAL-2317: Fixed name validation for page layout.
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2009-02-24 08:59:12 UTC (rev 12874)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2009-02-24 10:26:12 UTC (rev 12875)
@@ -20,6 +20,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
******************************************************************************/
+
package org.jboss.portal.core.admin.ui;
import org.jboss.portal.api.content.SelectedContent;
@@ -674,7 +675,9 @@
{
if (pageManager == null)
{
+ // it'd be better if propertyAction was injected in faces-config.xml so that we can also inject the shared beanContext
pageManager = new PageManagerBean(layoutService, portletDefinitionInvoker);
+ pageManager.setBeanContext(new JSFBeanContext());
}
pageManager.page = (Page)selectedObject;
}
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java 2009-02-24 08:59:12 UTC (rev 12874)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java 2009-02-24 10:26:12 UTC (rev 12875)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -39,18 +39,18 @@
import org.jboss.portal.faces.component.portlet.PortletRenderEvent;
import org.jboss.portal.faces.el.PropertyValue;
import org.jboss.portal.faces.el.dynamic.DynamicBean;
+import org.jboss.portal.faces.gui.ManagedBean;
import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStateResponse.Event;
import org.jboss.portal.theme.LayoutService;
import org.jboss.portal.theme.PortalLayout;
import org.jboss.portal.theme.ThemeConstants;
-import javax.faces.application.FacesMessage;
+import javax.faces.component.UIInput;
import javax.faces.context.FacesContext;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.model.SelectItem;
-import javax.faces.component.UIInput;
import javax.xml.namespace.QName;
import java.util.ArrayList;
import java.util.Collection;
@@ -68,7 +68,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
-public class PageManagerBean
+public class PageManagerBean extends ManagedBean
{
private static final QName CONTENT_SELECT = new QName("urn:jboss:portal:content", "select");
@@ -84,7 +84,6 @@
/** . */
private static final int ADD_ACTION = 'a';
- private static final String VIEW_ROOT = ":_viewRoot";
public PageManagerBean(LayoutService layoutService, PortletInvoker portletInvoker)
{
@@ -113,7 +112,7 @@
public String selectedContentURI;
/** . */
- private Map<String,String> selectedContentParameters;
+ private Map<String, String> selectedContentParameters;
/** . */
public Map selectedRenderParameters;
@@ -136,7 +135,7 @@
}
public List getContentTypeItems()
- {
+ {
LinkedList<SelectItem> types = new LinkedList<SelectItem>();
for (Object o : ContentProviderRegistryService.getInstance().getContentTypes())
{
@@ -158,7 +157,7 @@
public ContentType getSelectedContentType()
{
- return selectedContentType;
+ return selectedContentType;
}
public void setSelectedContentType(ContentType selectedContentType)
@@ -275,7 +274,7 @@
{
//
String selectedContentURI = this.selectedContentURI;
- Map<String,String> selectedContentParams = this.selectedContentParameters;
+ Map<String, String> selectedContentParams = this.selectedContentParameters;
// Reset to new state
this.selectedContentURI = null;
@@ -283,23 +282,23 @@
this.selectedRenderParameters = new HashMap();
// Obtain a window name
- String windowName = (String)FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("blah");
- if (windowName.trim().length() == 0)
+ String windowName = (String)normalizeStringIfNeeded(beanContext.getParameter("blah"));
+ if (windowName == null)
{
+ // no specified name in the UI, generate one
windowName = createWindowName(selectedContentType.toString(), selectedContentURI, false);
while (page.getWindow(windowName) != null)
{
windowName = createWindowName(selectedContentType.toString(), selectedContentURI, true);
}
}
-
- // Check for duplicate window name
- if (page.getWindow(windowName) != null)
+ else
{
- FacesContext faces = FacesContext.getCurrentInstance();
- FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, "Duplicate window name found on this page!", null);
- faces.addMessage("windowName", message);
- throw new AbortProcessingException();
+ windowName = checkNameValidity(windowName, "windowForm:windowName");
+ if (windowName == null)
+ {
+ throw new AbortProcessingException("Duplicate window name!");
+ }
}
//
@@ -311,7 +310,7 @@
{
for (Object o : selectedContentParams.entrySet())
{
- Map.Entry<String,String> entry = (Map.Entry<String,String>)o;
+ Map.Entry<String, String> entry = (Map.Entry<String, String>)o;
String paramName = entry.getKey();
String paramValue = entry.getValue();
content.setParameter(paramName, paramValue);
@@ -344,10 +343,7 @@
}
else
{
- FacesContext faces = FacesContext.getCurrentInstance();
- FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, "No content was selected!", null);
- faces.addMessage("layoutForm", message);
-// throw new AbortProcessingException();
+ beanContext.createTargetedErrorMessage("layoutForm", "COMMON_NO_SELECTED_CONTENT");
}
}
else if (direction == MOVE_LEFT)
@@ -403,12 +399,12 @@
Event portletEvent = eventEvent.getEvent();
QName name = portletEvent.getName();
// only react to content selection events
- if(CONTENT_SELECT.equals(name))
+ if (CONTENT_SELECT.equals(name))
{
if (portletEvent.getPayload() instanceof String)
{
String uri = (String)portletEvent.getPayload();
- this.selectedContentURI = uri;
+ this.selectedContentURI = uri;
this.selectedContentParameters = null;
}
else if (portletEvent.getPayload() instanceof SelectedContent)
@@ -556,4 +552,14 @@
return true;
}
}
+
+ protected String getObjectTypeName()
+ {
+ return "WINDOW_TYPE";
+ }
+
+ public boolean isAlreadyExisting(String objectName)
+ {
+ return page.getWindow(objectName) != null;
+ }
}
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/dashboard/DashboardBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/dashboard/DashboardBean.java 2009-02-24 08:59:12 UTC (rev 12874)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/dashboard/DashboardBean.java 2009-02-24 10:26:12 UTC (rev 12875)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -34,6 +34,7 @@
import org.jboss.portal.core.model.portal.PortalObjectContainer;
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.portal.PortalObjectPath;
+import org.jboss.portal.faces.gui.JSFBeanContext;
import org.jboss.portal.theme.LayoutService;
import org.jboss.portal.theme.ThemeConstants;
import org.jboss.portal.theme.ThemeService;
@@ -115,7 +116,9 @@
// Create page manager if it does not exit
if (pageManager == null)
{
+ // it'd be better if propertyAction was injected in faces-config.xml so that we can also inject the shared beanContext
pageManager = new PageManagerBean(layoutService, new PortletDefinitionInvoker(instanceContainer));
+ pageManager.setBeanContext(new JSFBeanContext());
}
// Get user name
@@ -147,7 +150,7 @@
defaultPageName = PortalObject.DEFAULT_OBJECT_NAME;
}
selectePageIsDefault = selectedPageName.equals(defaultPageName);
-
+
//
Collection pages = userPortal.getChildren(PortalObject.PAGE_MASK);
pageItems = new SelectItem[pages.size()];
@@ -199,7 +202,7 @@
try
{
userPortal.destroyChild(selectedPageName);
-
+
// Fallback to default page
String defaultPageName = pageManager.page.getProperty(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME);
if (defaultPageName == null)
15 years, 2 months