Author: vrockai
Date: 2008-10-14 11:18:59 -0400 (Tue, 14 Oct 2008)
New Revision: 12061
Modified:
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/selenium-rc-server/user-extensions.js
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/DashboardsTestCase.java
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletDefinitionsTestCase.java
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletInstancesTestCase.java
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/testng.xml
Log:
portal admin tests cases added
Modified:
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/selenium-rc-server/user-extensions.js
===================================================================
---
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/selenium-rc-server/user-extensions.js 2008-10-13
16:26:13 UTC (rev 12060)
+++
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/selenium-rc-server/user-extensions.js 2008-10-14
15:18:59 UTC (rev 12061)
@@ -44,7 +44,7 @@
Selenium.prototype.assertTextOrder = function(textValues) {
var allText = this.page().bodyText();
- var expectedTextValues = textValues.parseCSV();
+ var expectedTextValues = textValues.split(";");
for (var i = 0; i < expectedTextValues.length - 1; i++) {
var index = allText.indexOf(expectedTextValues[i]);
Modified:
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java 2008-10-13
16:26:13 UTC (rev 12060)
+++
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java 2008-10-14
15:18:59 UTC (rev 12061)
@@ -14,17 +14,38 @@
@Test(groups = { "admin_portal" }, enabled = true, description = "Partal
administrating.")
public class AdminPortalTestCase extends JBossPortalSeleniumTestCase {
- private static final String SUBMIT_RENAME_PORTAL = "renameForm:rename";
- private static final String INPUT_RENAME_PORTAL = "renameForm:newName";
+ private static final String TABLE_PAGE_DISP_LANG =
"display-name-form1:locale-datatable";
+ private static final String SUB_PAGE_DISP_LANG =
"display-name-form:add-display";
+ private static final String INP_PAGE_DISP_LANG = "display-name-form:newName";
+ private static final String SEL_PAGE_DISP_LANG = "display-name-form:locales";
+ private static final String SUB_PAGE_PROP_ERR_UPDATE =
"common-edit-page-error-form:update_2";
+ private static final String SUB_PAGE_PROP_LISTENER = "edit-prop-form:update";
+ private static final String SEL_PAGE_PROP_LISTENER =
"edit-prop-form:listener";
+ private static final String SUB_PAGE_PROP_UPDATE =
"common-manage-prop-form:update_1";
+ private static final String SEL_PAGE_PROP_PREDEFINED =
"common-edit-prop-form:predefined-properties:predefinedProperty";
+ private static final String PAGE_PROP_PREDEFINED_PROP = SEL_PAGE_PROP_PREDEFINED;
+ private static final String SUB_PAGE_PROP_ADDPROP =
"common-edit-prop-form:add-property";
+ private static final String INP_PAGE_PROP_ADDPROP =
"common-edit-prop-form:property";
+ private static final String SUB_PAGE_THEME =
"common-edit-theme-form:_id41jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj";
+ private static final String SEL_PAGE_THEME_RENDERSET =
"common-edit-theme-form:renderSet";
+ private static final String SEL_PAGE_THEME_THEME =
"common-edit-theme-form:theme";
+ private static final String SEL_PAGE_THEME_LAY =
"common-edit-theme-form:layout";
+ private static final String SUB_PAGE_LAY_ADDLEFT = "layoutForm:a_left";
+ private static final String SUB_PAGE_LAY_ADDCENTER = "layoutForm:a_center";
+ private static final String INP_PAGE_LAYOUT_NAME = "windowForm:windowName";
+ private static final String SUBMIT_RENAME_PAGE = "renameForm:rename";
+ private static final String INPUT_RENAME_PAGE = "renameForm:newName";
+ private static final String SUBMIT_RENAME_PORTAL = SUBMIT_RENAME_PAGE;
+ private static final String INPUT_RENAME_PORTAL = INPUT_RENAME_PAGE;
private static final String SUBMIT_DELETE_PORTAL_CONF =
"delete-view:confirm-form:delete";
private static final String INPUT_SUBMIT_PAGECREATE =
"create-page-form:create-page";
private static final String INPUT_PAGENAME = "create-page-form:pageName";
private static final String INPUT_PORTALNAME = "create-portal-form:name";
private static final String INPUT_SUBMIT_CREATEPORTAL =
"create-portal-form:create-portal";
- private final String TAB_PORTALOBJ_ID = "//div[@id='current']/a";
+ private final String TAB_PORTALOBJ_ID = "instance-temp-form:portal-obj-link";
- private final String LINK_PORTALS_ID = "link=*Portal Objects*";
+ // private final String LINK_PORTALS_ID = "link=*Portal Objects*";
private final String LINK_PORTAL_HOME = "obj-temp-form:object-link-0";
private final String TABLE_PORTAL_ADMIN = "obj-nav-form:portal-datatable";
@@ -57,24 +78,243 @@
logout();
}
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate" })
+ public void testPortalMakeDef() {
+ // create portal
+ openAndWait("/portal");
+ Assert.assertTrue(selenium.isTextPresent("Greetings !"));
+
+ final String portalName = "TestDefPortal";
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+
+ Assert.assertFalse(selenium.isTextPresent(portalName), "Not created page already
exist.");
+
+ selenium.type(INPUT_PORTALNAME, portalName);
+ selenium.click(INPUT_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(POR_TL_MAKEDEF, r));
+
+ openAndWait("/portal/");
+ Assert.assertFalse(selenium.isTextPresent("Greetings !"));
+ }
+
@Test(enabled = true)
+ public void testPortalSecure() {
+ // create portal
+ final String portalName = "template";
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(POR_TL_SECURITY, r));
+ // setting permissions to forbiden
+ selenium.click("//input[@name='common-edit-security-form:cars_2' and
@value='viewrecursive']");
+ selenium.click("common-edit-security-form:update");
+ selenium.waitForPageToLoad("30000");
+
+ openAndWait("/portal/auth/portal/" + portalName);
+ Assert.assertTrue(selenium.isTextPresent("Access to the specified resource () has
been forbidden."), "Secured page is not forbidden.");
+
+ // setting permissions to seen for admin, but not for user
+ openAndWait(ADDR_PORTAL);
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+
+ r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(POR_TL_SECURITY, r));
+
+ selenium.click("//input[@name='common-edit-security-form:cars_0' and
@value='viewrecursive']");
+ selenium.click("//input[@name='common-edit-security-form:cars_1' and
@value='viewrecursive']");
+ selenium.click("common-edit-security-form:update");
+ selenium.waitForPageToLoad("30000");
+
+ openAndWait("/portal/auth/portal/" + portalName);
+ Assert.assertFalse(selenium.isTextPresent("Access to the specified resource () has
been forbidden."), "Secured page is not forbidden.");
+
+ // click on everything
+ openAndWait(ADDR_PORTAL);
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+
+ r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(POR_TL_SECURITY, r));
+
+ selenium.click("//input[@name='common-edit-security-form:cars_0']");
+ selenium.click("//input[@name='common-edit-security-form:cars_1']");
+ selenium.click("//input[@name='common-edit-security-form:cars_2']");
+ selenium.click("//input[@name='common-edit-security-form:cars_2' and
@value='viewrecursive']");
+ selenium.click("//input[@name='common-edit-security-form:cars_2' and
@value='personalize']");
+ selenium.click("//input[@name='common-edit-security-form:cars_1' and
@value='personalize']");
+ selenium.click("//input[@name='common-edit-security-form:cars_0' and
@value='personalize']");
+ selenium.click("//input[@name='common-edit-security-form:cars_0' and
@value='personalizerecursive']");
+ selenium.click("//input[@name='common-edit-security-form:cars_1' and
@value='personalizerecursive']");
+ selenium.click("//input[@name='common-edit-security-form:cars_2' and
@value='personalizerecursive']");
+ selenium.click("common-edit-security-form:update");
+ selenium.waitForPageToLoad("30000");
+
+ openAndWait("/portal/auth/portal/" + portalName);
+ Assert.assertFalse(selenium.isTextPresent("Access to the specified resource () has
been forbidden."), "Secured page is not forbidden.");
+
+ }
+
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate" })
+ public void testPortalProperties() {
+ // create portal
+ final String portalName = "TestPropPortal";
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+
+ Assert.assertFalse(selenium.isTextPresent(portalName), "Not created page already
exist.");
+
+ selenium.type(INPUT_PORTALNAME, portalName);
+ selenium.click(INPUT_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(POR_TL_PROPERTIES, r));
+
+ // properties handling
+ selenium.type("common-edit-prop-form:property", "testProp");
+ clickAndWait("common-edit-prop-form:add-property");
+ selenium.type("common-manage-prop-form:prop-data-table:1:prop-value-input",
"12");
+ clickAndWait("common-manage-prop-form:update_1");
+ clickAndWait("//a[@id='common-manage-prop-form:prop-data-table:1:delete']/span");
+ clickAndWait("common-edit-page-error-form:page-access-check");
+ clickAndWait("common-manage-prop-form:update_1");
+
+ // portal error handling
+ selenium.click("common-edit-portal-error-form:portal-access-check");
+ selenium.waitForPageToLoad("30000");
+ selenium.select("common-edit-portal-error-form:portal-access-select",
"label=Redirect to the specified resource");
+ selenium.waitForPageToLoad("30000");
+ selenium.click("common-edit-portal-error-form:portal-unavail-check");
+ selenium.waitForPageToLoad("30000");
+ selenium.select("common-edit-portal-error-form:portal-unavail-select",
"label=Redirect to the specified resource");
+ selenium.waitForPageToLoad("30000");
+ selenium.click("common-edit-portal-error-form:portal-error-check");
+ selenium.waitForPageToLoad("30000");
+ selenium.select("common-edit-portal-error-form:portal-error-select",
"label=Display the default error message");
+ selenium.waitForPageToLoad("30000");
+ selenium.click("common-edit-portal-error-form:portal-internal-check");
+ selenium.waitForPageToLoad("30000");
+ selenium.select("common-edit-portal-error-form:portal-internal-select",
"label=Display the default error message");
+ selenium.waitForPageToLoad("30000");
+ selenium.click("common-edit-portal-error-form:portal-not-found-check");
+ selenium.waitForPageToLoad("30000");
+ selenium.select("common-edit-portal-error-form:portal-not-found-select",
"label=Redirect to the specified resource");
+ selenium.waitForPageToLoad("30000");
+ selenium.click("common-edit-portal-error-form:portal-res-check");
+ selenium.waitForPageToLoad("30000");
+ selenium.type("common-edit-portal-error-form:portal-res-input",
"/WEB-INF/jsp/error/portalZ.jsp");
+ selenium.click("common-edit-portal-error-form:update_2");
+ selenium.waitForPageToLoad("30000");
+
+ // page error handling
+ selenium.select("common-edit-page-error-form:page-access-select",
"label=Display the default error message");
+ selenium.waitForPageToLoad("30000");
+ clickAndWait("common-edit-page-error-form:page-control-check");
+ selenium.select("common-edit-page-error-form:page-control-select",
"label=Display the default error message");
+ selenium.waitForPageToLoad("30000");
+ clickAndWait("common-edit-page-error-form:page-error-check");
+ selenium.select("common-edit-page-error-form:page-error-select",
"label=Display the default error message");
+ selenium.waitForPageToLoad("30000");
+ clickAndWait("common-edit-page-error-form:page-internal-check");
+ selenium.select("common-edit-page-error-form:page-internal-select",
"label=Display the default error message");
+ selenium.waitForPageToLoad("30000");
+ clickAndWait("common-edit-page-error-form:page-not-found-check");
+ selenium.select("common-edit-page-error-form:page-not-found-select",
"label=Display the default error message");
+ selenium.waitForPageToLoad("30000");
+ clickAndWait("common-edit-page-error-form:page-res-check");
+ clickAndWait("common-edit-page-error-form:update_3");
+
+ // listener
+
+ selenium.select(SEL_PAGE_PROP_LISTENER, "label=test_listener");
+ clickAndWait(SUB_PAGE_PROP_LISTENER);
+ }
+
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate" })
+ public void testPortalTheme() {
+ // create portal
+ final String portalName = "TestThemePortal";
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+
+ Assert.assertFalse(selenium.isTextPresent(portalName), "Not created page already
exist.");
+
+ selenium.type(INPUT_PORTALNAME, portalName);
+ selenium.click(INPUT_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(POR_TL_THEME, r));
+
+ // changing theme
+
+ selenium.select("common-edit-theme-form:layout", "label=1column");
+ selenium.select("common-edit-theme-form:theme",
"label=mission-critical");
+ selenium.select("common-edit-theme-form:renderSet",
"label=emptyRenderer");
+ selenium.click("common-edit-theme-form:_id34jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj");
+ selenium.waitForPageToLoad("30000");
+
+ clickAndWait("admin-portal-form:edit-theme-link");
+
+ selenium.select("common-edit-theme-form:layout", "label=1column");
+ selenium.select("common-edit-theme-form:theme",
"label=mission-critical");
+ selenium.select("common-edit-theme-form:renderSet",
"label=emptyRenderer");
+ selenium.click("common-edit-theme-form:_id33jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj");
+ selenium.waitForPageToLoad("30000");
+ }
+
+ @Test(enabled = true)
public void testPortalCreate() {
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
-
clickIfVisible(TAB_PORTALOBJ_ID);
- clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
- Assert.assertFalse(selenium.isTextPresent("TestPortal"), "Not created
page already exist.");
+ final String portalName = "TestPortal";
+ Assert.assertFalse(selenium.isTextPresent(portalName), "Not created page already
exist.");
- selenium.type(INPUT_PORTALNAME, "TestPortal");
+ selenium.type(INPUT_PORTALNAME, portalName);
selenium.click(INPUT_SUBMIT_CREATEPORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("TestPortal"));
+ Assert.assertTrue(selenium.isTextPresent(portalName));
- int r = findTableRow(TABLE_PORTAL_ADMIN, "TestPortal", 0) - 1;
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(POR_TL_MAIN, r)));
Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(POR_TL_SECURITY,
r)));
@@ -82,30 +322,54 @@
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)));
+
}
@Test(enabled = true, dependsOnMethods = { "testPortalCreate" })
public void testPortalRename() {
+
+ final String portalName = "TestRenameMePortal";
+ final String portalNameNew = "TestRenamedPortal";
+
+ // creating portal to rename
+
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
clickIfVisible(TAB_PORTALOBJ_ID);
- clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
- Assert.assertTrue(selenium.isTextPresent("TestPortal"));
- Assert.assertFalse(selenium.isTextPresent("AestPortal"), "Not created
page already exist.");
+ selenium.type(INPUT_PORTALNAME, portalName);
+ selenium.click(INPUT_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
- int r = findTableRow(TABLE_PORTAL_ADMIN, "TestPortal", 0) - 1;
+ Assert.assertTrue(selenium.isTextPresent(portalName));
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+ // renaming portal
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+
+ Assert.assertTrue(selenium.isTextPresent(portalName));
+ Assert.assertFalse(selenium.isTextPresent(portalNameNew), "Not created page
already exist.");
+
+ r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
selenium.click(MessageFormat.format(POR_TL_RENAME, r));
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(INPUT_RENAME_PORTAL, "AestPortal");
+ selenium.type(INPUT_RENAME_PORTAL, portalNameNew);
selenium.click(SUBMIT_RENAME_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertFalse(selenium.isTextPresent("TestPortal"));
- Assert.assertTrue(selenium.isTextPresent("AestPortal"));
+ Assert.assertFalse(selenium.isTextPresent(portalName));
+ Assert.assertTrue(selenium.isTextPresent(portalNameNew));
+
}
@Test(enabled = true, dependsOnMethods = { "testPortalCreate" })
@@ -114,7 +378,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
clickIfVisible(TAB_PORTALOBJ_ID);
- clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
selenium.type(INPUT_PORTALNAME, "TestDelete");
selenium.click(INPUT_SUBMIT_CREATEPORTAL);
@@ -146,7 +410,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
clickIfVisible(TAB_PORTALOBJ_ID);
- clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
final String portalName = "TestAddPortal";
final String portalPage = "tPage";
@@ -159,7 +423,7 @@
selenium.click(MessageFormat.format(POR_TL_MAIN, r));
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
Assert.assertFalse(selenium.isTextPresent(portalPage), "Portal page already
present");
Assert.assertTrue(selenium.isTextPresent("Create a page named:"));
@@ -179,7 +443,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
clickIfVisible(TAB_PORTALOBJ_ID);
- clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
@@ -207,15 +471,15 @@
createPortal(portalName);
createPage(portalName, pageName);
- selenium.open("/portal/");
+ selenium.open(ADDR_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(LINK_PORTAL_HOME);
int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
selenium.click(MessageFormat.format(POR_TL_MAIN, r));
@@ -227,65 +491,293 @@
selenium.click(MessageFormat.format(PAG_TL_LAYOUT, r));
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type("windowForm:windowName", windowName);
+ selenium.type(INP_PAGE_LAYOUT_NAME, windowName);
selenium.click("link=Who's online portlet");
selenium.waitForPageToLoad("30000");
- selenium.click("layoutForm:a_center");
+ selenium.click(SUB_PAGE_LAY_ADDCENTER);
selenium.waitForPageToLoad("30000");
Assert.assertTrue(selenium.isTextPresent(windowName));
- selenium.open("/portal/auth/portal/mimikry");
+ selenium.open("/portal/auth/portal/" + portalName + "/" +
pageName);
+ selenium.waitForPageToLoad("30000");
Assert.assertTrue(selenium.isTextPresent("Current users"));
}
-
- @Test(enabled = true, dependsOnMethods={"testPortalCreate"})
- public void testPageRename(){
+
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate" })
+ public void testPageRename() {
String portalName = "TestPortal";
String pageName = "PageToRename";
-
- createPage("TestPortal", "PageToRename");
-
+
+ createPage(portalName, pageName);
+
openAndWait("/portal");
clickAndWait("link=Admin");
-
+ clickAndWait("link=Admin");
clickIfVisible(TAB_PORTALOBJ_ID);
- clickIfVisible(LINK_PORTALS_ID, "Create a portal named:");
+ clickIfVisible(LINK_PORTAL_HOME);
- int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+ Assert.assertTrue(selenium.isTextPresent("Create a portal named:"));
- clickAndWait(MessageFormat.format(POR_TL_MAIN, r));
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0);
- r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
+ clickAndWait(MessageFormat.format(POR_TL_MAIN, r - 1));
- clickAndWait(MessageFormat.format(PAG_TL_RENAME, r));
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0);
+ clickAndWait(MessageFormat.format(PAG_TL_RENAME, r - 1));
+
+ selenium.type(INPUT_RENAME_PAGE, "PageAlreadyRenamed");
+ selenium.click(SUBMIT_RENAME_PAGE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(findTableRow(TABLE_PORTALPAGE_ADMIN, "PageAlreadyRenamed",
0) >= 0, "Renamed page ont found.");
}
@Test(enabled = false)
- public void testPageSecurity(){
-
+ public void testPageSecurity() {
+ String portalName = "TestPortal";
+ String pageName = "PageToSecure";
+
+ createPage(portalName, pageName);
+
+ openAndWait("/portal");
+ clickAndWait("link=Admin");
+ clickAndWait("link=Admin");
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+
+ Assert.assertTrue(selenium.isTextPresent("Create a portal named:"));
+
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0);
+
+ clickAndWait(MessageFormat.format(POR_TL_MAIN, r - 1));
+
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0);
+
+ clickAndWait(MessageFormat.format(PAG_TL_SECURITY, r - 1));
+
+ selenium.click("//input[@name='common-edit-security-form:cars_2' and
@value='viewrecursive']");
+ selenium.click("common-edit-security-form:update");
+ selenium.waitForPageToLoad("30000");
+
+ selenium.open("/portal/auth/portal/" + portalName + "/" +
pageName);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isTextPresent("Access to the specified resource () has
been forbidden."), "Secured page is not forbidden.");
+
}
-
- @Test(enabled = false)
- public void testPageTheme(){
-
+
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate" })
+ public void testPageProperties() {
+ String portalName = "TestPortal";
+ String pageName = "PageToProp";
+
+ createPage(portalName, pageName);
+
+ openAndWait("/portal");
+ clickAndWait("link=Admin");
+ clickAndWait("link=Admin");
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+
+ Assert.assertTrue(selenium.isTextPresent("Create a portal named:"));
+
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0);
+
+ clickAndWait(MessageFormat.format(POR_TL_MAIN, r - 1));
+
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0);
+
+ clickAndWait(MessageFormat.format(PAG_TL_PROPERTIES, r - 1));
+
+ // properties table
+ selenium.type(INP_PAGE_PROP_ADDPROP, "testProp");
+ clickAndWait(SUB_PAGE_PROP_ADDPROP);
+ selenium.select(PAGE_PROP_PREDEFINED_PROP, "label=Tab order");
+ selenium.type(INP_PAGE_PROP_ADDPROP, "testTabProp");
+ clickAndWait(SUB_PAGE_PROP_ADDPROP);
+ selenium.type("common-manage-prop-form:prop-data-table:2:prop-value-input",
"11");
+ selenium.type("common-manage-prop-form:prop-data-table:1:prop-value-input",
"12");
+ clickAndWait(SUB_PAGE_PROP_UPDATE);
+ clickAndWait("//a[@id='common-manage-prop-form:prop-data-table:2:delete']/span");
+ clickAndWait("common-edit-page-error-form:page-access-check");
+
+ // error handling
+ selenium.select("common-edit-page-error-form:page-access-select",
"label=Display the default error message");
+ selenium.waitForPageToLoad("30000");
+ clickAndWait("common-edit-page-error-form:page-control-check");
+ selenium.select("common-edit-page-error-form:page-control-select",
"label=Display the default error message");
+ selenium.waitForPageToLoad("30000");
+ clickAndWait("common-edit-page-error-form:page-error-check");
+ selenium.select("common-edit-page-error-form:page-error-select",
"label=Display the default error message");
+ selenium.waitForPageToLoad("30000");
+ clickAndWait("common-edit-page-error-form:page-internal-check");
+ selenium.select("common-edit-page-error-form:page-internal-select",
"label=Display the default error message");
+ selenium.waitForPageToLoad("30000");
+ clickAndWait("common-edit-page-error-form:page-not-found-check");
+ selenium.select("common-edit-page-error-form:page-not-found-select",
"label=Display the default error message");
+ selenium.waitForPageToLoad("30000");
+ clickAndWait("common-edit-page-error-form:page-res-check");
+ clickAndWait(SUB_PAGE_PROP_UPDATE);
+ clickAndWait(SUB_PAGE_PROP_ERR_UPDATE);
+
+ // listener
+
+ selenium.select(SEL_PAGE_PROP_LISTENER, "label=test_listener");
+ clickAndWait(SUB_PAGE_PROP_LISTENER);
}
-
- @Test(enabled = false)
- public void testPageLayout(){
-
+
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate" })
+ public void testPageMakeDef() {
+ String portalName = "TestPortal";
+ String pageName = "PageToMakeDef";
+
+ selenium.open("/portal/auth/portal/" + portalName);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isElementPresent("//li[@id='current']/a[@href='/portal/auth/portal/TestPortal/default']"));
+
+ createPage(portalName, pageName);
+
+ openAndWait("/portal/");
+ clickAndWait("link=Admin");
+ clickAndWait("link=Admin");
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+
+ Assert.assertTrue(selenium.isTextPresent("Create a portal named:"));
+
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0);
+
+ clickAndWait(MessageFormat.format(POR_TL_MAIN, r - 1));
+
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0);
+
+ clickAndWait(MessageFormat.format(PAG_TL_MAKEDEF, r - 1));
+
+ selenium.open("/portal/auth/portal/" + portalName);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isElementPresent("//li[@id='current']/a[@href='/portal/auth/portal/TestPortal/PageToMakeDef']"));
}
-
+
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate" })
+ public void testPageDisplay() {
+ String portalName = "TestPortal";
+ String pageName = "PageToDisplay";
+
+ createPage(portalName, pageName);
+
+ openAndWait("/portal");
+ clickAndWait("link=Admin");
+ clickAndWait("link=Admin");
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+
+ Assert.assertTrue(selenium.isTextPresent("Create a portal named:"));
+
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0);
+
+ clickAndWait(MessageFormat.format(POR_TL_MAIN, r - 1));
+
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0);
+
+ clickAndWait(MessageFormat.format(PAG_TL_DISPLAY, r - 1));
+
+ final String searchName = "Zobrazenie";
+ Assert.assertFalse(findTableRow(TABLE_PAGE_DISP_LANG, searchName, 1) >= 0);
+
+ selenium.select(SEL_PAGE_DISP_LANG, "label=Slovak");
+ selenium.type(INP_PAGE_DISP_LANG, searchName);
+ clickAndWait(SUB_PAGE_DISP_LANG);
+
+ Assert.assertTrue(findTableRow(TABLE_PAGE_DISP_LANG, searchName, 1) >= 0);
+
+ clickAndWait("//a[@id='display-name-form1:locale-datatable:0:rename']/span");
+ final String searchName2 = "PreYobrazenie";
+ selenium.type(INP_PAGE_DISP_LANG, searchName2);
+ clickAndWait(SUB_PAGE_DISP_LANG);
+
+ Assert.assertFalse(findTableRow(TABLE_PAGE_DISP_LANG, searchName, 1) >= 0);
+ Assert.assertTrue(findTableRow(TABLE_PAGE_DISP_LANG, searchName2, 1) >= 0);
+
+ clickAndWait("//a[@id='display-name-form1:locale-datatable:0:delete']/span");
+
+ Assert.assertFalse(findTableRow(TABLE_PAGE_DISP_LANG, searchName, 1) >= 0);
+ Assert.assertFalse(findTableRow(TABLE_PAGE_DISP_LANG, searchName2, 1) >= 0);
+ }
+
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate" })
+ public void testPageTheme() {
+ String portalName = "TestPortal";
+ String pageName = "PageToTheme";
+
+ createPage(portalName, pageName);
+
+ openAndWait("/portal");
+ clickAndWait("link=Admin");
+ clickAndWait("link=Admin");
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+
+ clickAndWait("link=" + portalName);
+
+ int r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0);
+
+ clickAndWait(MessageFormat.format(PAG_TL_THEME, r - 1));
+
+ selenium.select(SEL_PAGE_THEME_LAY, "label=1column");
+ selenium.select(SEL_PAGE_THEME_THEME, "label=maple");
+ selenium.select(SEL_PAGE_THEME_RENDERSET, "label=emptyRenderer");
+ selenium.click(SUB_PAGE_THEME);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ }
+
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate" })
+ public void testPageLayout() {
+ String portalName = "TestPortal";
+ String pageName = "PageToLayout";
+
+ createPage(portalName, pageName);
+
+ openAndWait("/portal");
+ clickAndWait("link=Admin");
+ clickAndWait("link=Admin");
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+
+ clickAndWait("link=" + portalName);
+
+ int r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0);
+
+ clickAndWait(MessageFormat.format(PAG_TL_LAYOUT, r - 1));
+
+ selenium.type(INP_PAGE_LAYOUT_NAME, "ViliamLay");
+ clickAndWait("portlet-instance-link_0");
+ clickAndWait(SUB_PAGE_LAY_ADDCENTER);
+ clickAndWait("portlet-instance-link_7");
+ clickAndWait(SUB_PAGE_LAY_ADDLEFT);
+ clickAndWait("obj-temp-form:object-link-2");
+
+ Assert.assertTrue(selenium.isElementPresent("obj-nav-form:windows-datatable:0:window-name-link"));
+ Assert.assertTrue(selenium.isElementPresent("obj-nav-form:windows-datatable:1:window-name-link"));
+
+ selenium.open("/portal/auth/portal/TestPortal/PageToLayout");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent("Current users"));
+ Assert.assertTrue(selenium.isTextPresent("Management Portlet"));
+ }
+
private void createPortal(String name) {
- selenium.open("/portal/");
+ selenium.open(ADDR_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);
selenium.type(INPUT_PORTALNAME, name);
selenium.click(INPUT_SUBMIT_CREATEPORTAL);
@@ -293,13 +785,13 @@
}
private void createPage(String portalName, String pageName) {
- selenium.open("/portal/");
+ selenium.open(ADDR_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);
int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
Modified:
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/DashboardsTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/DashboardsTestCase.java 2008-10-13
16:26:13 UTC (rev 12060)
+++
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/DashboardsTestCase.java 2008-10-14
15:18:59 UTC (rev 12061)
@@ -72,14 +72,13 @@
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent(propName));
- int r = findTableRow(TABLE_PROPS, propName, 0);
- System.out.println(propName+":"+r);
+ int r = findTableRow(TABLE_PROPS, propName, 1);
selenium.type(MessageFormat.format(T_PROPS_INPUT_VALUE, r-1),value);
selenium.click(SUBMIT_UPDATE_VALUE);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent(value));
+ Assert.assertEquals(selenium.getValue(MessageFormat.format(T_PROPS_INPUT_VALUE,
r-1)),value,"Updated value not found.");
}
@@ -94,7 +93,6 @@
Assert.assertTrue(selenium.isTextPresent(propName));
int r = findTableRow(TABLE_PROPS, propName, 0);
- System.out.println(propName+":"+r);
selenium.click(MessageFormat.format(T_PROPS_LINK_DEL, r-1));
selenium.waitForPageToLoad(PAGE_LOAD);
Modified:
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletDefinitionsTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletDefinitionsTestCase.java 2008-10-13
16:26:13 UTC (rev 12060)
+++
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletDefinitionsTestCase.java 2008-10-14
15:18:59 UTC (rev 12061)
@@ -78,13 +78,13 @@
selenium.click(SUBMIT_PROVIDER_VIEW);
selenium.waitForPageToLoad(PAGE_LOAD);
int n = countTableRows(TABLE_PORTLET);
- Assert.assertEquals(n, 16,"Wrong number of self portlets.");
+ Assert.assertTrue(findTableRow(TABLE_PORTLET, "Administration Portlet",
0)<0);
selenium.select(SELECT_PROVIDER, "label=local");
selenium.click(SUBMIT_PROVIDER_VIEW);
selenium.waitForPageToLoad(PAGE_LOAD);
n = countTableRows(TABLE_PORTLET);
- Assert.assertEquals(n, 21, "Wrong number of local portlets.");
+ Assert.assertTrue(findTableRow(TABLE_PORTLET, "Administration Portlet",
0)>=0);
}
private void goToPD(){
Modified:
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletInstancesTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletInstancesTestCase.java 2008-10-13
16:26:13 UTC (rev 12060)
+++
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletInstancesTestCase.java 2008-10-14
15:18:59 UTC (rev 12061)
@@ -8,15 +8,15 @@
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
-public class PortletInstancesTestCase extends JBossPortalSeleniumTestCase{
+public class PortletInstancesTestCase extends JBossPortalSeleniumTestCase {
private static final String SUBMIT_SECURITY_UPDATE =
"common-edit-security-form:update";
private static final String SUBMIT_SECURITY_CANCEL =
"common-edit-security-form:cancel";
-
+
private static final String LINK_PREF_WELCOMEPORT =
"instances-form:security-JSPPortletInstance";
private static final String TABLE_PREF_KEY =
"//form[@id='common-edit-pref-form']/table";
-
+
private static final String SUBMIT_PREF_DELETE =
"common-edit-exisiting-form:row_0";
private static final String LINK_PREF_GUESTNUM =
"common-edit-pref-form:pref-link-0";
private static final String INPUT_PREF_NEWVAL =
"common-append-form:new_value";
@@ -50,9 +50,9 @@
public void logoutAfterTest() {
logout();
}
-
+
@Test(enabled = true)
- public void testAddName(){
+ public void testAddName() {
selenium.click(LINK_COUNTPORT);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.select(SELECT_LANGUAGE, "label=Czech");
@@ -60,12 +60,12 @@
selenium.type(INPUT_NAME, name);
selenium.click(SUBMIT_MODIFY_NAME);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(findTableRow(TABLE_DISPNAMES, name, 1)>=0);
+ Assert.assertTrue(findTableRow(TABLE_DISPNAMES, name, 1) >= 0);
}
-
+
@Test(enabled = true)
- public void testDeleteName(){
- // adding the name
+ public void testDeleteName() {
+ // adding the name
selenium.click(LINK_COUNTPORT);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.select(SELECT_LANGUAGE, "label=Japanese");
@@ -73,20 +73,20 @@
selenium.type(INPUT_NAME, name);
selenium.click(SUBMIT_MODIFY_NAME);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
// deleting name
-
+
int r = findTableRow(TABLE_DISPNAMES, name, 1);
-
- selenium.click(MessageFormat.format(T_LINK_DELETENAME, r-1));
+
+ selenium.click(MessageFormat.format(T_LINK_DELETENAME, r - 1));
selenium.waitForPageToLoad(PAGE_LOAD);
-
- Assert.assertFalse(findTableRow(TABLE_DISPNAMES, name, r)>=0);
+
+ Assert.assertFalse(findTableRow(TABLE_DISPNAMES, name, r) >= 0);
}
-
+
@Test(enabled = true)
- public void testModifyName(){
- // adding the name
+ public void testModifyName() {
+ // adding the name
selenium.click(LINK_COUNTPORT);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.select(SELECT_LANGUAGE, "label=Japanese");
@@ -96,23 +96,23 @@
selenium.type(INPUT_NAME, name);
selenium.click(SUBMIT_MODIFY_NAME);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
// midifying name
-
+
int r = findTableRow(TABLE_DISPNAMES, name, 1);
-
- selenium.click(MessageFormat.format(T_LINK_MODIFYNAME, r-1));
+
+ selenium.click(MessageFormat.format(T_LINK_MODIFYNAME, r - 1));
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.type(INPUT_NAME, nameNew);
selenium.click(SUBMIT_MODIFY_NAME);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- Assert.assertTrue(findTableRow(TABLE_DISPNAMES, nameNew, 1)>=0);
+
+ Assert.assertTrue(findTableRow(TABLE_DISPNAMES, nameNew, 1) >= 0);
}
-
+
@Test(enabled = true)
- public void testSecure(){
+ public void testSecure() {
// "common-edit-security-form:cancel"
selenium.click(LINK_PREF_WELCOMEPORT);
selenium.waitForPageToLoad("30000");
@@ -124,10 +124,11 @@
selenium.click("//input[@name='common-edit-security-form:cars_2' and
@value='admin']");
selenium.click(SUBMIT_SECURITY_UPDATE);
selenium.waitForPageToLoad("30000");
- selenium.click("link=Portal");
+
+ selenium.open("/portal/auth/portal/default/");
selenium.waitForPageToLoad("30000");
Assert.assertTrue(selenium.isTextPresent("Greetings !"));
-
+
// then cancel
selenium.click("link=Admin");
selenium.waitForPageToLoad("30000");
@@ -140,10 +141,10 @@
selenium.click("//input[@name='common-edit-security-form:cars_1']");
selenium.click(SUBMIT_SECURITY_CANCEL);
selenium.waitForPageToLoad("30000");
- selenium.click("link=Portal");
+ selenium.open("/portal/auth/portal/default/");
selenium.waitForPageToLoad("30000");
Assert.assertTrue(selenium.isTextPresent("Greetings !"));
-
+
// then really stop the greetings portlet
selenium.click("link=Admin");
selenium.waitForPageToLoad("30000");
@@ -156,16 +157,16 @@
selenium.click("//input[@name='common-edit-security-form:cars_1']");
selenium.click(SUBMIT_SECURITY_UPDATE);
selenium.waitForPageToLoad("30000");
-
- selenium.click("link=Portal");
+
+ selenium.open("/portal/auth/portal/default/");
selenium.waitForPageToLoad("30000");
Assert.assertFalse(selenium.isTextPresent("Greetings !"));
}
-
+
@Test(enabled = true)
- public void testDeleteInstance(){
+ public void testDeleteInstance() {
// cancel first
- Assert.assertTrue(selenium.isElementPresent(LINK_DEL_EXCEPTPORT),"Exception
portlet not found.");
+ Assert.assertTrue(selenium.isElementPresent(LINK_DEL_EXCEPTPORT), "Exception
portlet not found.");
selenium.click(LINK_DEL_EXCEPTPORT);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("WARNING!"));
@@ -174,18 +175,18 @@
selenium.waitForPageToLoad(PAGE_LOAD);
// delete
goToPI();
- Assert.assertTrue(selenium.isElementPresent(LINK_DEL_EXCEPTPORT),"Exception
portlet not found.");
+ Assert.assertTrue(selenium.isElementPresent(LINK_DEL_EXCEPTPORT), "Exception
portlet not found.");
selenium.click(LINK_DEL_EXCEPTPORT);
selenium.waitForPageToLoad(PAGE_LOAD);
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);
- Assert.assertFalse(selenium.isElementPresent(LINK_DEL_EXCEPTPORT),"Exception
portlet found after deletition.");
+ Assert.assertFalse(selenium.isElementPresent(LINK_DEL_EXCEPTPORT), "Exception
portlet found after deletition.");
}
-
+
@Test(enabled = true)
- public void testPreferences(){
+ public void testPreferences() {
int r;
selenium.click(LINK_CURUSER_PREFERENCES);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -196,36 +197,36 @@
Assert.assertTrue(findTableRow(TABLE_PREF_KEY, "guestNumber", 0) >= 0);
selenium.click(LINK_PREF_GUESTNUM);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- r=findTableRow(TABLE_PREF_KEY, "guestNumber", 0);
- Assert.assertEquals(selenium.getText(TABLE_PREF_KEY+"/tbody/tr["+r+"]/td[4]"),"[true]");
+
+ r = findTableRow(TABLE_PREF_KEY, "guestNumber", 0);
+ Assert.assertEquals(selenium.getText(TABLE_PREF_KEY + "/tbody/tr[" + r +
"]/td[4]"), "[true]");
selenium.type(INPUT_PREF_APPEND, "true1");
selenium.click(INPUT_PREF_UPDATE);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- r=findTableRow(TABLE_PREF_KEY, "guestNumber", 0);
- Assert.assertEquals(selenium.getText(TABLE_PREF_KEY+"/tbody/tr["+r+"]/td[4]"),"[true1]");
+
+ r = findTableRow(TABLE_PREF_KEY, "guestNumber", 0);
+ Assert.assertEquals(selenium.getText(TABLE_PREF_KEY + "/tbody/tr[" + r +
"]/td[4]"), "[true1]");
selenium.click(SUBMIT_PREF_DELETE);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- r=findTableRow(TABLE_PREF_KEY, "guestNumber", 0);
- Assert.assertEquals(selenium.getText(TABLE_PREF_KEY+"/tbody/tr["+r+"]/td[4]"),"[]");
+
+ r = findTableRow(TABLE_PREF_KEY, "guestNumber", 0);
+ Assert.assertEquals(selenium.getText(TABLE_PREF_KEY + "/tbody/tr[" + r +
"]/td[4]"), "[]");
selenium.type(INPUT_PREF_NEWVAL, "viliam");
selenium.click(SUBMIT_PREF_UPDATE);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- r=findTableRow(TABLE_PREF_KEY, "guestNumber", 0);
- Assert.assertEquals(selenium.getText(TABLE_PREF_KEY+"/tbody/tr["+r+"]/td[4]"),"[viliam]");
+
+ r = findTableRow(TABLE_PREF_KEY, "guestNumber", 0);
+ Assert.assertEquals(selenium.getText(TABLE_PREF_KEY + "/tbody/tr[" + r +
"]/td[4]"), "[viliam]");
selenium.click(SUBMIT_PREF_SAVE);
selenium.waitForPageToLoad(PAGE_LOAD);
}
-
- private void goToPI(){
- selenium.open("/portal/");
+
+ private void goToPI() {
+ selenium.open(ADDR_PORTAL);
clickIfVisible(LINK_ADMIN);
clickIfVisible(LINK_ADMIN);
clickIfVisible(LINK_TAB_PI);
clickIfVisible(LINK_PI_MAIN);
}
-
+
}
Modified: branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/testng.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/testng.xml 2008-10-13 16:26:13 UTC
(rev 12060)
+++ branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/testng.xml 2008-10-14 15:18:59 UTC
(rev 12061)
@@ -102,5 +102,5 @@
<classes>
<class
name="org.jboss.portal.test.selenium.portal.DashboardsTestCase"></class></classes>
</test>
-
+<!-- -->
</suite>