Author: vrockai
Date: 2009-05-07 11:25:45 -0400 (Thu, 07 May 2009)
New Revision: 13320
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/EndToEndBeaPortlet.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java
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/EndtoEndPortalAdminTestCase.java
Log:
[selenium] - several TODOs that were found during the javadoc annotation
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/EndToEndBeaPortlet.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/EndToEndBeaPortlet.java 2009-05-07
14:00:43 UTC (rev 13319)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/EndToEndBeaPortlet.java 2009-05-07
15:25:45 UTC (rev 13320)
@@ -15,7 +15,6 @@
*
* @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
*/
-// TODO some refactoring of class fields needed
@Test(groups = { "end2end" }, enabled = true, description = "Creating of
new portal with content.")
public class EndToEndBeaPortlet extends JBossPortalSeleniumTestCase {
@@ -27,12 +26,9 @@
private final String LNK_BEA_NEXT = getLoc(casePfx + "lnk.bea.prev",
"link=Click here to goto next page");
private final String SUB_VIEW_PORTLETS =
"//input[contains(@id,'definition-form:view-portlets')]";
private final String SEL_CONS_TYPE =
"//select[contains(@id,'definition-form:menu')]";
-
private final String ADR_HOME = getLoc(casePfx + "adr.home",
"portal/auth/portal/default");
-
private final String SUBMIT_CONS_REGVAL = getLoc(casePfx +
"submit.cons.regval",
"//input[contains(@id,'edit-cons-form:refresh-cons-link')]");
private final String SUBMIT_REFRESHFINAL = getLoc(casePfx +
"submit.refreshfinal",
"//input[contains(@id,'edit-cons-form:refresh-cons-link')]");
-
private final String INPUT_CONS_REGVALUE = getLoc(casePfx +
"input.cons.regvalue",
"//input[contains(@id,'edit-cons-form:existingProps:0:prop-value-input')]");
private final String SUBMIT_REFRESHSAVE = getLoc(casePfx +
"submit.refreshsave",
"//input[contains(@id,'edit-cons-form:refresh-cons-link')]");
@@ -41,7 +37,6 @@
private final String SUBMIT_CREATECONS = getLoc(casePfx + "submit.createcons",
"//input[contains(@id,'createConsumer:createConsumerButton')]");
private final String INPUT_CREATECONS = getLoc(casePfx + "input.createcons",
"//input[contains(@id,'createConsumer:consumerName')]");
private final String ID_LINK_CONSCONF = getLoc(casePfx + "id.link.consconf",
"//a[contains(@id,'producer-temp-form:consumersTab')]");
-
private final String SEL_PORTLET_TYPE = getLoc(casePfx + "sel.portlet.type",
"//select[contains(@id,'windowForm:instanceId')]");
private final String SUB_LAYOUT_ADD_CENTER = getLoc(casePfx +
"sub.layout.add.center",
"//input[contains(@id,'layoutForm:a_center')]");
private final String TAB_PORTALOBJ_ID = getLoc(casePfx + "tab.portalobj.id",
"Link=Admin");
@@ -51,15 +46,14 @@
private final String POR_TL_MAIN = getLoc(casePfx + "por.tl.main",
"//a[contains(@id,''obj-nav-form:portal-datatable:{0}:object-iid-link'')]");
private final String TBL_PORTALPAGE_ADMIN = getLoc(casePfx +
"tbl.portalpage.admin",
"//table[contains(@id,'obj-nav-form:pages-datatable')]");
private final String PAG_TL_LAYOUT = getLoc(casePfx + "pag.tl.layout",
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:edit-page-layout'')]");
+ private final String SUB_CREATE_INS = getLoc(casePfx + "sub.create.ins",
"//input[contains(@name,'add_instance_form:j_id19')]");
+ private final String INP_INS_NAME = getLoc(casePfx + "inp.ins.name",
"//input[contains(@id,'add_instance_form:instanceId')]");
+ private final String T_LNK_CREATE = getLoc(casePfx + "t.lnk.create",
"//a[contains(@id,''def-list:create-instance-{0}'')]");
+ private final String TAB_PORTLET = getLoc(casePfx + "tab.portlet",
"//form[contains(@id,'def-list')]/table");
+ private final String LNK_ADMIN = getLoc(casePfx + "lnk.admin",
"link=Admin");
+ private final String LNK_TAB_PD = getLoc(casePfx + "lnk.tab.pd",
"//a[contains(@id,'admin-subtab-form:portlet-def-link')]");
+ private final String LNK_PD_MAIN = getLoc(casePfx + "lnk.pd.main",
"//a[contains(@id,'man-form:def-link')]");
- private final String SUBMIT_CREATE_INST =
"//input[contains(@name,'add_instance_form:j_id19')]";
- private final String INPUT_INSTANCE_NAME =
"//input[contains(@id,'add_instance_form:instanceId')]";
- private final String T_LINK_CREATE =
"//a[contains(@id,''def-list:create-instance-{0}'')]";
- private final String TABLE_PORTLET =
"//form[contains(@id,'def-list')]/table";
- private final String LINK_ADMIN = "link=Admin";
- private final String LINK_TAB_PD =
"//a[contains(@id,'admin-subtab-form:portlet-def-link')]";
- private final String LINK_PD_MAIN =
"//a[contains(@id,'man-form:def-link')]";
-
@BeforeMethod(groups = { "log" })
protected void loginBeforeTest() {
logoutIfPossible();
@@ -68,11 +62,8 @@
@AfterMethod(groups = { "log" })
protected void logoutAfterTest() {
- // logout();
}
- private String PORTLET = "";
-
/**
* Testing the end-to-end adding of bea portlet. Simple WSRP consumer with
* name "BeaE2E" is created similar way as in
@@ -88,7 +79,6 @@
* "Welcome back!" is asserted. At the end the link "Goto previous
page." is
* clicked and the previous text is asserted.
*/
- // TODO - click on a link in BEA applet and assert
@Test(enabled = true, description = "Creating a standard BEA portlet.")
public void testEnd2EndBeaPortlet() {
@@ -150,22 +140,22 @@
selenium.open(ADR_HOME);
selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(LINK_ADMIN);
- clickIfVisible(LINK_ADMIN);
- clickIfVisible(LINK_TAB_PD);
- clickIfVisible(LINK_PD_MAIN);
+ clickIfVisible(LNK_ADMIN);
+ clickIfVisible(LNK_ADMIN);
+ clickIfVisible(LNK_TAB_PD);
+ clickIfVisible(LNK_PD_MAIN);
selenium.select(SEL_CONS_TYPE, "label=" + type);
selenium.click(SUB_VIEW_PORTLETS);
selenium.waitForPageToLoad(PAGE_LOAD);
- int r = findTableRow(TABLE_PORTLET, defName, 0);
+ int r = findTableRow(TAB_PORTLET, defName, 0);
- selenium.click(MessageFormat.format(T_LINK_CREATE, r - 1));
+ selenium.click(MessageFormat.format(T_LNK_CREATE, r - 1));
selenium.waitForPageToLoad(PAGE_LOAD);
- // selenium.setSpeed("5555");
- selenium.type(INPUT_INSTANCE_NAME, insName);
- selenium.click(SUBMIT_CREATE_INST);
+
+ selenium.type(INP_INS_NAME, insName);
+ selenium.click(SUB_CREATE_INS);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent(insName + " portlet details"));
}
@@ -189,27 +179,14 @@
// click on the page layout
selenium.click(MessageFormat.format(PAG_TL_LAYOUT, r));
+ waitFor(AJAX_LOAD);
- 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();
- }
+ waitFor(AJAX_LOAD);
selenium.select(SEL_PORTLET_TYPE, "label=" + type);
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
+ waitFor(AJAX_LOAD);
selenium.click("link=*" + portletName + "*");
selenium.waitForPageToLoad(PAGE_LOAD);
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java 2009-05-07
14:00:43 UTC (rev 13319)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java 2009-05-07
15:25:45 UTC (rev 13320)
@@ -599,7 +599,8 @@
clickIfVisible(LNK_USERTAB);
clickIfVisible(LNK_USERMAIN);
selenium.click(LNK_CREATE_USER);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ waitFor(AJAX_LOAD);
+ //selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Username *"), "Label for
username input is wrong or missing.");
selenium.type(INP_USERNAME, userName);
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-05-07
14:00:43 UTC (rev 13319)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java 2009-05-07
15:25:45 UTC (rev 13320)
@@ -9,53 +9,81 @@
import org.testng.annotations.Test;
/**
- * AdminPortalTestCase is responsible for testing fundamental portal admin features of
JBoss Portal.
+ * AdminPortalTestCase is responsible for testing fundamental portal admin
+ * features of JBoss Portal.
+ *
* @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
- *
+ *
*/
-//TODO - adding of simple portlet - more portlet types
+// TODO - adding of simple portlet - more portlet types
@Test(groups = { "admin_portal" }, enabled = true, description = "Partal
administrating.")
public class AdminPortalTestCase extends JBossPortalSeleniumTestCase {
- /** prefix for locator properties = portal.admin.*/
+ /** prefix for locator properties = portal.admin. */
public final String casePfx = "portal.admin.";
- private final String LNK_PP_PROP_DELETE =
getLoc(casePfx+"lnk.pp.prop.delete","//a[contains(@id,''common-manage-prop-form:prop-data-table:{0}:delete'')]");
- private final String SUB_PP_PROPVAL_UPDATE =
getLoc(casePfx+"sub.pp.propval.update","//input[contains(@id,'common-manage-prop-form:update')]");
- private final String INP_PP_PROP_VAL =
getLoc(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 =
getLoc(casePfx+"sub.ppa.form.update","//input[contains(@id,'common-edit-page-error-form:update')]");
- private final String INP_PPA_RES_SELECT =
getLoc(casePfx+"inp.ppa.res.select","//input[contains(@id,'common-edit-page-error-form:page-res-select')]");
- private final String SEL_PPA_NF_SELECT =
getLoc(casePfx+"sel.ppa.nf.select","//select[contains(@id,'common-edit-page-error-form:page-not-found-select')]");
- private final String SEL_PPA_INTERNAL_SELECT =
getLoc(casePfx+"sel.ppa.internal.select","//select[contains(@id,'common-edit-page-error-form:page-internal-select')]");
- private final String SEL_PPA_ERROR_SELECT =
getLoc(casePfx+"sel.ppa.error.select","//select[contains(@id,'common-edit-page-error-form:page-error-select')]");
- private final String SEL_PPA_CONTROL_SELECT =
getLoc(casePfx+"sel.ppa.control.select","//select[contains(@id,'common-edit-page-error-form:page-control-select')]");
- private final String SEL_PPA_ACCESS_SELECT =
getLoc(casePfx+"sel.ppa.access.select","//select[contains(@id,'common-edit-page-error-form:page-access-select')]");
- private final String CHK_PPA_RES_CHECK =
getLoc(casePfx+"chk.ppa.res.check","//input[contains(@id,'common-edit-page-error-form:page-res-check')]");
- private final String CHK_PPA_NF_CHECK =
getLoc(casePfx+"chk.ppa.nf.check","//input[contains(@id,'common-edit-page-error-form:page-not-found-check')]");
- private final String CHK_PPA_INTERNAL_CHECK =
getLoc(casePfx+"chk.ppa.internal.check","//input[contains(@id,'common-edit-page-error-form:page-internal-check')]");
- private final String CHK_PPA_ERROR_CHECK =
getLoc(casePfx+"chk.ppa.error.check","//input[contains(@id,'common-edit-page-error-form:page-error-check')]");
- private final String CHK_PPA_CONTROL_CHECK =
getLoc(casePfx+"chk.ppa.control.check","//input[contains(@id,'common-edit-page-error-form:page-control-check')]");
- private final String CHK_PPA_ACCESS_CHECK =
getLoc(casePfx+"chk.ppa.access.check","//input[contains(@id,'common-edit-page-error-form:page-access-check')]");
- private final String SUB_PP_ERROR_FORM_UPDATE =
getLoc(casePfx+"sub.pp.error.form.update","//input[contains(@id,'common-edit-portal-error-form:update')]");
- private final String INP_PP_RES_INPUT =
getLoc(casePfx+"inp.pp.res.input","//input[contains(@id,'common-edit-portal-error-form:portal-res-input')]");
- private final String SEL_PP_NF_SELECT =
getLoc(casePfx+"sel.pp.nf.select","//select[contains(@id,'common-edit-portal-error-form:portal-not-found-select')]");
- private final String SEL_PP_INTERNAL_SELECT =
getLoc(casePfx+"sel.pp.internal.select","//select[contains(@id,'common-edit-portal-error-form:portal-internal-select')]");
- private final String SEL_PP_ERROR_SELECT =
getLoc(casePfx+"sel.pp.error.select","//select[contains(@id,'common-edit-portal-error-form:portal-error-select')]");
- private final String SEL_PP_UNAVAIL_SELECT =
getLoc(casePfx+"sel.pp.unavail.select","//select[contains(@id,'common-edit-portal-error-form:portal-unavail-select')]");
- private final String SEL_PP_ACCESS_SELECT =
getLoc(casePfx+"sel.pp.access.select","//select[contains(@id,'common-edit-portal-error-form:portal-access-select')]");
- private final String CHK_PP_RES_CHECK =
getLoc(casePfx+"chk.pp.res.check","//input[contains(@id,'common-edit-portal-error-form:portal-res-check')]");
- private final String CHK_PP_NF_CHECK =
getLoc(casePfx+"chk.pp.nf.check","//input[contains(@id,'common-edit-portal-error-form:portal-not-found-check')]");
- private final String CHK_PP_INTERNAL_CHECK =
getLoc(casePfx+"chk.pp.internal.check","//input[contains(@id,'common-edit-portal-error-form:portal-internal-check')]");
- private final String CHK_PP_ERROR_CHECK =
getLoc(casePfx+"chk.pp.error.check","//input[contains(@id,'common-edit-portal-error-form:portal-error-check')]");
- private final String CHK_PP_ACCESS_CHECK =
getLoc(casePfx+"chk.pp.access.check","//input[contains(@id,'common-edit-portal-error-form:portal-access-check')]");
- private final String CHK_PP_UNAVAIL_CHECK =
getLoc(casePfx+"chk.pp.unavail.check","//input[contains(@id,'common-edit-portal-error-form:portal-unavail-check')]");
- private final String SUB_PP_PROPADD =
getLoc(casePfx+"sub.pp.propadd","//input[contains(@id,'common-edit-prop-form:add-property')]");
- private final String INP_PP_PROPNAME =
getLoc(casePfx+"inp.pp.propname","//input[contains(@id,'common-edit-prop-form:property')]");
- private final String SUB_PP_LISTENER =
getLoc(casePfx+"sub.pp.listener","//input[contains(@id,'edit-prop-form:update')]");
- private final String SEL_PP_LISTENER =
getLoc(casePfx+"sel.pp.listener","//select[contains(@id,'edit-prop-form:listener')]");
- private final String TBL_PP_PROPS =
getLoc(casePfx+"tbl.pp.props","//table[contains(@id,'common-manage-prop-form:prop-data-table')]");
+ private final String MES_P1 = getMess(casePfx + "p1", "Who's online
portlet");
+ private final String MES_P2 = getMess(casePfx + "p1",
"CharsetPortletInstance");
+ private final String MES_P3 = getMess(casePfx + "p1", "Coordination Map
Portlet");
+ private final String MES_P4 = getMess(casePfx + "p1", "Catalog
Portlet");
+ private final String LNK_PP_PROP_DELETE = getLoc(casePfx +
"lnk.pp.prop.delete",
+ "//a[contains(@id,''common-manage-prop-form:prop-data-table:{0}:delete'')]");
+ private final String SUB_PP_PROPVAL_UPDATE = getLoc(casePfx +
"sub.pp.propval.update",
"//input[contains(@id,'common-manage-prop-form:update')]");
+ private final String INP_PP_PROP_VAL = getLoc(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 = getLoc(casePfx +
"sub.ppa.form.update",
"//input[contains(@id,'common-edit-page-error-form:update')]");
+ private final String INP_PPA_RES_SELECT = getLoc(casePfx +
"inp.ppa.res.select",
"//input[contains(@id,'common-edit-page-error-form:page-res-select')]");
+ private final String SEL_PPA_NF_SELECT = getLoc(casePfx +
"sel.ppa.nf.select",
+ "//select[contains(@id,'common-edit-page-error-form:page-not-found-select')]");
+ private final String SEL_PPA_INTERNAL_SELECT = getLoc(casePfx +
"sel.ppa.internal.select",
+ "//select[contains(@id,'common-edit-page-error-form:page-internal-select')]");
+ private final String SEL_PPA_ERROR_SELECT = getLoc(casePfx +
"sel.ppa.error.select",
+ "//select[contains(@id,'common-edit-page-error-form:page-error-select')]");
+ private final String SEL_PPA_CONTROL_SELECT = getLoc(casePfx +
"sel.ppa.control.select",
+ "//select[contains(@id,'common-edit-page-error-form:page-control-select')]");
+ private final String SEL_PPA_ACCESS_SELECT = getLoc(casePfx +
"sel.ppa.access.select",
+ "//select[contains(@id,'common-edit-page-error-form:page-access-select')]");
+ private final String CHK_PPA_RES_CHECK = getLoc(casePfx + "chk.ppa.res.check",
"//input[contains(@id,'common-edit-page-error-form:page-res-check')]");
+ private final String CHK_PPA_NF_CHECK = getLoc(casePfx + "chk.ppa.nf.check",
"//input[contains(@id,'common-edit-page-error-form:page-not-found-check')]");
+ private final String CHK_PPA_INTERNAL_CHECK = getLoc(casePfx +
"chk.ppa.internal.check",
+ "//input[contains(@id,'common-edit-page-error-form:page-internal-check')]");
+ private final String CHK_PPA_ERROR_CHECK = getLoc(casePfx +
"chk.ppa.error.check",
"//input[contains(@id,'common-edit-page-error-form:page-error-check')]");
+ private final String CHK_PPA_CONTROL_CHECK = getLoc(casePfx +
"chk.ppa.control.check",
+ "//input[contains(@id,'common-edit-page-error-form:page-control-check')]");
+ private final String CHK_PPA_ACCESS_CHECK = getLoc(casePfx +
"chk.ppa.access.check",
+ "//input[contains(@id,'common-edit-page-error-form:page-access-check')]");
+ private final String SUB_PP_ERROR_FORM_UPDATE = getLoc(casePfx +
"sub.pp.error.form.update",
+ "//input[contains(@id,'common-edit-portal-error-form:update')]");
+ private final String INP_PP_RES_INPUT = getLoc(casePfx + "inp.pp.res.input",
"//input[contains(@id,'common-edit-portal-error-form:portal-res-input')]");
+ private final String SEL_PP_NF_SELECT = getLoc(casePfx + "sel.pp.nf.select",
+ "//select[contains(@id,'common-edit-portal-error-form:portal-not-found-select')]");
+ private final String SEL_PP_INTERNAL_SELECT = getLoc(casePfx +
"sel.pp.internal.select",
+ "//select[contains(@id,'common-edit-portal-error-form:portal-internal-select')]");
+ private final String SEL_PP_ERROR_SELECT = getLoc(casePfx +
"sel.pp.error.select",
+ "//select[contains(@id,'common-edit-portal-error-form:portal-error-select')]");
+ private final String SEL_PP_UNAVAIL_SELECT = getLoc(casePfx +
"sel.pp.unavail.select",
+ "//select[contains(@id,'common-edit-portal-error-form:portal-unavail-select')]");
+ private final String SEL_PP_ACCESS_SELECT = getLoc(casePfx +
"sel.pp.access.select",
+ "//select[contains(@id,'common-edit-portal-error-form:portal-access-select')]");
+ private final String CHK_PP_RES_CHECK = getLoc(casePfx + "chk.pp.res.check",
"//input[contains(@id,'common-edit-portal-error-form:portal-res-check')]");
+ private final String CHK_PP_NF_CHECK = getLoc(casePfx + "chk.pp.nf.check",
"//input[contains(@id,'common-edit-portal-error-form:portal-not-found-check')]");
+ private final String CHK_PP_INTERNAL_CHECK = getLoc(casePfx +
"chk.pp.internal.check",
+ "//input[contains(@id,'common-edit-portal-error-form:portal-internal-check')]");
+ private final String CHK_PP_ERROR_CHECK = getLoc(casePfx +
"chk.pp.error.check",
+ "//input[contains(@id,'common-edit-portal-error-form:portal-error-check')]");
+ private final String CHK_PP_ACCESS_CHECK = getLoc(casePfx +
"chk.pp.access.check",
+ "//input[contains(@id,'common-edit-portal-error-form:portal-access-check')]");
+ private final String CHK_PP_UNAVAIL_CHECK = getLoc(casePfx +
"chk.pp.unavail.check",
+ "//input[contains(@id,'common-edit-portal-error-form:portal-unavail-check')]");
+ private final String SUB_PP_PROPADD = getLoc(casePfx + "sub.pp.propadd",
"//input[contains(@id,'common-edit-prop-form:add-property')]");
+ private final String INP_PP_PROPNAME = getLoc(casePfx + "inp.pp.propname",
"//input[contains(@id,'common-edit-prop-form:property')]");
+ private final String SUB_PP_LISTENER = getLoc(casePfx + "sub.pp.listener",
"//input[contains(@id,'edit-prop-form:update')]");
+ private final String SEL_PP_LISTENER = getLoc(casePfx + "sel.pp.listener",
"//select[contains(@id,'edit-prop-form:listener')]");
+ private final String TBL_PP_PROPS = getLoc(casePfx + "tbl.pp.props",
"//table[contains(@id,'common-manage-prop-form:prop-data-table')]");
+
private final String SUB_LAYOUT_ADD_CENTER = getLoc(casePfx +
"sub.layout.add.center",
"//input[contains(@id,'layoutForm:a_center')]");
+ private final String SUB_LAYOUT_ADD_LEFT = getLoc(casePfx +
"sub.layout.add.left",
"//input[contains(@id,'layoutForm:a_left')]");
private final String INP_WINDOW_NAME = getLoc(casePfx + "inp.window.name",
"//input[contains(@id,'windowForm:windowName')]");
private final String SUBMIT_RENAME_PORTAL = getLoc(casePfx +
"submit.rename.portal",
"//input[contains(@id,'renameForm:rename')]");
private final String INPUT_RENAME_PORTAL = getLoc(casePfx +
"input.rename.portal",
"//input[contains(@id,'renameForm:newName')]");
@@ -86,6 +114,27 @@
private final String PAG_TL_DELETE = getLoc(casePfx + "pag.tl.delete",
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:delete-link'')]");
private final String PAG_TL_MAKEDEF = getLoc(casePfx + "pag.tl.makedef",
"//a[contains(@id,''obj-nav-form:pages-datatable:{0}:default-link'')]");
+ private final String PAG_THE_LAY = getLoc(casePfx + "pag.the.lay",
"//select[contains(@id,'common-edit-theme-form:layout')]");
+ private final String PAG_THE_THE = getLoc(casePfx + "pag.the.the",
"//select[contains(@id,'common-edit-theme-form:theme')]");
+ private final String PAG_THE_REN = getLoc(casePfx + "pag.the.ren",
"//select[contains(@id,'common-edit-theme-form:renderSet')]");
+
+ private final String PAG_THE_CAN = getLoc(casePfx + "pag.the.can",
"//html/body/div[2]/div/div/div[2]/table/tbody/tr/td/div/div/div/div/div/form/input[3]");
+ private final String PAG_THE_SUB = getLoc(casePfx + "pag.the.sub",
"//html/body/div[2]/div/div/div[2]/table/tbody/tr/td/div/div/div/div/div/form/input[2]");
+
+ private final String PAG_REN_INP = getLoc(casePfx + "pag.ren.inp",
"//input[contains(@id,'renameForm:newName')]");
+ private final String PAG_REN_SUB = getLoc(casePfx + "pag.ren.sub",
"//input[contains(@id,'renameForm:rename')]");
+ private final String PAG_REN_CAN = getLoc(casePfx + "pag.ren.sub",
"//input[contains(@id,'renameForm:cancel')]");
+
+ private final String PAG_LAY_C_SEL = getLoc(casePfx + "pag.lay.c.sel",
"//select[contains(@id,'selectMany_center')]");
+ private final String PAG_LAY_L_SEL = getLoc(casePfx + "pag.lay.l.sel",
"//select[contains(@id,'selectMany_left')]");
+
+ private final String PAG_LAY_C_UP = getLoc(casePfx + "pag.lay.c.up",
"//input[contains(@id,'layoutForm:u_center')]");
+ private final String PAG_LAY_C_DOWN = getLoc(casePfx + "pag.lay.c.down",
"//input[contains(@id,'layoutForm:d_center')]");
+ private final String PAG_LAY_C_DEL = getLoc(casePfx + "pag.lay.c.del",
"//input[contains(@id,'layoutForm:l_center')]");
+ private final String PAG_LAY_L_UP = getLoc(casePfx + "pag.lay.l.up",
"//input[contains(@id,'layoutForm:u_left')]");
+ private final String PAG_LAY_L_DOWN = getLoc(casePfx + "pag.lay.l.down",
"//input[contains(@id,'layoutForm:d_left')]");
+ private final String PAG_LAY_L_DEL = getLoc(casePfx + "pag.lay.l.del",
"//input[contains(@id,'layoutForm:l_left')]");
+
@BeforeMethod(groups = { "log" })
protected void loginBeforeTest() {
logoutIfPossible();
@@ -99,12 +148,13 @@
/**
* Creates a new portal.
*
- * Uses portal admin interface to create a new portal.
- * TODO: the existence of new portal should be tested in a more stronger way. The test
only asserts the existence of portal name in the portals table
- * and it asserts the existence of it's tool links, too.
+ * Uses portal admin interface to create a new portal. TODO: the existence
+ * of new portal should be tested in a more stronger way. The test only
+ * asserts the existence of portal name in the portals table and it asserts
+ * the existence of it's tool links, too.
*/
- //TODO: the existence of new portal should be tested in a more stronger way
- @Test(enabled = true, description="Creates a new portal")
+ // TODO: the existence of new portal should be tested in a more stronger way
+ @Test(enabled = true, description = "Creates a new portal")
public void testPortalCreate() {
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -134,12 +184,14 @@
}
/**
- * Renames a portal. Firstly a portal name "TestRenPortal" is created the same
way as in {@link AdminPortalTestCase#testPortalCreate()}.
- * In portal admin interface, rename link is used to rename the portal to
"AestPortal".
- * At the end it checks that the former name of portal is not on the screen and the new
name is appearing when listing portals.
+ * Renames a portal. Firstly a portal name "TestRenPortal" is created the
+ * same way as in {@link AdminPortalTestCase#testPortalCreate()}. In portal
+ * admin interface, rename link is used to rename the portal to
+ * "AestPortal". At the end it checks that the former name of portal is not
+ * on the screen and the new name is appearing when listing portals.
*/
- //TODO findintable should be used for final assertions
- @Test(enabled = true, dependsOnMethods = { "testPortalCreate" },
description="Renames a portal")
+ // TODO findintable should be used for final assertions
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate" }, description =
"Renames a portal")
public void testPortalRename() {
// first create a portal
@@ -183,12 +235,13 @@
}
/**
- * Deletes a portal. Firstly a portal name "TestDelete" is created the same
way as in {@link AdminPortalTestCase#testPortalCreate()}.
- * In portal admin interface, delete link is used to delete the portal.
- * At the end it checks that the former name of portal is not on the screen.
+ * Deletes a portal. Firstly a portal name "TestDelete" is created the same
+ * way as in {@link AdminPortalTestCase#testPortalCreate()}. In portal admin
+ * interface, delete link is used to delete the portal. At the end it checks
+ * that the former name of portal is not on the screen.
*/
- //TODO findintable should be used for final assertions
- @Test(enabled = true, dependsOnMethods = { "testPortalCreate" },
description="Deletes a portal")
+ // TODO findintable should be used for final assertions
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate" }, description =
"Deletes a portal")
public void testPortalDelete() {
// first create a portal
@@ -239,15 +292,20 @@
}
/**
- * Testing properties of portal. Firstly a portal name "TestProperties" is
created the same way as in {@link AdminPortalTestCase#testPortalCreate()}.
- * In portal admin interface, properties link is used to delete the portal. Following
actions are then proceeded and their final states are asserted after logout/login:
+ * Testing properties of portal. Firstly a portal name "TestProperties" is
+ * created the same way as in {@link AdminPortalTestCase#testPortalCreate()}
+ * . In portal admin interface, properties link is used to delete the
+ * portal. Following actions are then proceeded and their final states are
+ * asserted after logout/login:
* <ul>
- * <li>change listener at first to release_sessions_listener_self and then to
user_listener.</li>
- * <li>add two properties: viliamProp/hier! and danielProp/ohne! and then delete
viliamProp.</li>
+ * <li>change listener at first to release_sessions_listener_self and then
+ * to user_listener.</li>
+ * <li>add two properties: viliamProp/hier! and danielProp/ohne! and then
+ * delete viliamProp.</li>
* <li>change everything in Portal & Page Error Handling tables.</li>
* </ul>
*/
- @Test(enabled = true, dependsOnMethods = { "testPortalCreate" },
description="Testing properties of portal")
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate" }, description =
"Testing properties of portal")
public void testPortalProperties() {
// first create a portal
@@ -298,30 +356,30 @@
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(PAGE_LOAD);
-
+
r = findTableRow(TBL_PP_PROPS, propName1, 0) - 1;
-
- selenium.type(MessageFormat.format(INP_PP_PROP_VAL,r), propVal1);
+
+ selenium.type(MessageFormat.format(INP_PP_PROP_VAL, r), propVal1);
selenium.click(SUB_PP_PROPVAL_UPDATE);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.type(INP_PP_PROPNAME, propName2);
selenium.click(SUB_PP_PROPADD);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
r = findTableRow(TBL_PP_PROPS, propName2, 0) - 1;
-
- selenium.type(MessageFormat.format(INP_PP_PROP_VAL,r), propVal2);
+
+ selenium.type(MessageFormat.format(INP_PP_PROP_VAL, r), propVal2);
selenium.click(SUB_PP_PROPVAL_UPDATE);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
r = findTableRow(TBL_PP_PROPS, propName1, 0) - 1;
-
- selenium.click(MessageFormat.format(LNK_PP_PROP_DELETE,r));
+
+ selenium.click(MessageFormat.format(LNK_PP_PROP_DELETE, r));
selenium.waitForPageToLoad(PAGE_LOAD);
// Portal & Page Error Handling
@@ -379,10 +437,10 @@
selenium.waitForPageToLoad(PAGE_LOAD);
// logout login and property again
-
+
logout();
- login("admin","admin");
-
+ login("admin", "admin");
+
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -399,51 +457,54 @@
selenium.click(MessageFormat.format(POR_TL_PROPERTIES, r));
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
// assert time!
-
- Assert.assertEquals(selenium.getSelectedLabel(SEL_PP_LISTENER),"user_listener");
-
+
+ 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");
+ 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.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.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");
-
+ 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");
+
}
/**
- * Adds a page to a portal. Firstly a portal name "TestAddPagePortal" is
created the same way as in {@link AdminPortalTestCase#testPortalCreate()}.
- * In portal admin interface, main link (title of portal) is used to navigate to its own
tools. Form for creation of new page is then used
- * to create page named "tToAddPage". At the end it checks that the name of pa
is is appearing in "TestAddPagePortal" portal pages list.
+ * Adds a page to a portal. Firstly a portal name "TestAddPagePortal" is
+ * created the same way as in {@link AdminPortalTestCase#testPortalCreate()}
+ * . In portal admin interface, main link (title of portal) is used to
+ * navigate to its own tools. Form for creation of new page is then used to
+ * create page named "tToAddPage". At the end it checks that the name of pa
+ * is is appearing in "TestAddPagePortal" portal pages list.
*/
- //TODO findintable should be used for final assertions
- @Test(enabled = true, dependsOnMethods = { "testPortalCreate" },
description="Adds a page to a portal")
+ // TODO findintable should be used for final assertions
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate" }, description =
"Adds a page to a portal")
public void testAddPage() {
final String portalName = "TestAddPagePortal";
@@ -474,13 +535,18 @@
}
/**
- * Removes a page from a portal. Firstly a portal name "TestRemovePagePortal"
is created the same way as in {@link AdminPortalTestCase#testPortalCreate()}.
- * In portal admin interface, main link (title of portal) is used to navigate to its own
tools. Form for creation of new page is then used
- * to create page named "tRemPage" the same way as in {@link
AdminPortalTestCase#testAddPage()}. The page is removed with the remove button
afterwards.
- * At the end it checks that the name of page is not appearing in
"TestRemovePagePortal" portal pages list.
+ * Removes a page from a portal. Firstly a portal name
+ * "TestRemovePagePortal" is created the same way as in
+ * {@link AdminPortalTestCase#testPortalCreate()}. In portal admin
+ * interface, main link (title of portal) is used to navigate to its own
+ * tools. Form for creation of new page is then used to create page named
+ * "tRemPage" the same way as in {@link AdminPortalTestCase#testAddPage()}.
+ * The page is removed with the remove button afterwards. At the end it
+ * checks that the name of page is not appearing in "TestRemovePagePortal"
+ * portal pages list.
*/
- //TODO findintable should be used for final assertions
- @Test(enabled = true, dependsOnMethods = { "testPortalCreate",
"testAddPage" }, description="Removes a page from a portal")
+ // TODO findintable should be used for final assertions
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate",
"testAddPage" }, description = "Removes a page from a portal")
public void testRemovePage() {
final String portalName = "TestRemovePagePortal";
@@ -513,13 +579,19 @@
}
/**
- * Creates a "window" on a page. Firstly a portal name
"toAddWindowPortal" is created the same way as in {@link
AdminPortalTestCase#testPortalCreate()}.
- * In portal admin interface, main link (title of portal) is used to navigate to its own
tools. Form for creation of new page is then used
- * to create page named "windowContainer" the same way as in {@link
AdminPortalTestCase#testAddPage()}. The link "page layout" of
"testAddPage"
- * page is then clicked to add a window to this page. "Who's online
portlet" is then added to windows called "myFancyWindow" on this page.
- * Existence of text containing the name of window is asserted. At the page is loaded
and the existence of the added portlet is asserted.
+ * Creates a "window" on a page. Firstly a portal name
"toAddWindowPortal"
+ * is created the same way as in
+ * {@link AdminPortalTestCase#testPortalCreate()}. In portal admin
+ * interface, main link (title of portal) is used to navigate to its own
+ * tools. Form for creation of new page is then used to create page named
+ * "windowContainer" the same way as in
+ * {@link AdminPortalTestCase#testAddPage()}. The link "page layout" of
+ * "testAddPage" page is then clicked to add a window to this page.
+ * "Who's online portlet" is then added to windows called
"myFancyWindow" on
+ * this page. Existence of text containing the name of window is asserted.
+ * At the page is loaded and the existence of the added portlet is asserted.
*/
- @Test(enabled = true, dependsOnMethods = { "testPortalCreate",
"testAddPage" }, description="Creates a \"window\" on a
page")
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate",
"testAddPage" }, description = "Creates a \"window\" on a
page")
public void testCreateWindow() {
final String portalName = "toAddWindowPortal";
@@ -548,12 +620,7 @@
// click on the page layout
selenium.click(MessageFormat.format(PAG_TL_LAYOUT, r));
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ waitFor(AJAX_LOAD);
selenium.click("link=Who's online portlet");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -570,17 +637,23 @@
}
/**
- * Renames a page of a portal. Firstly a portal name "TestPortal" is created
the same way as in {@link AdminPortalTestCase#testPortalCreate()}.
- * In portal admin interface, main link (title of portal) is used to navigate to its own
tools. Form for creation of new page is then used
- * to create page named "PageToRename" the same way as in {@link
AdminPortalTestCase#testAddPage()}.
+ * Renames a page of a portal. Firstly a portal name "TestPortal" is created
+ * the same way as in {@link AdminPortalTestCase#testPortalCreate()}. In
+ * portal admin interface, main link (title of portal) is used to navigate
+ * to its own tools. Form for creation of new page is then used to create
+ * page named "PageToRename" the same way as in
+ * {@link AdminPortalTestCase#testAddPage()}.
*
- * The rename link on the page is then clicked. Most of the <b>TEST CODE IS
MISSING!</b>
+ * The rename link on the page is then clicked. The page is renamed to
+ * "PageWasRenamed". At first attempt the renaming is canceled, at the
+ * second attempt the new name is submitted. It is asserted that the new
+ * name is present in the page table and the previous name is not present.
*/
- //TODO MUST FINISH!
- @Test(enabled = true, dependsOnMethods = { "testPortalCreate",
"testAddPage" }, description="Renames a page of a portal")
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate",
"testAddPage" }, description = "Renames a page of a portal")
public void testPageRename() {
String portalName = "TestPortal";
String pageName = "PageToRename";
+ String pageNewName = "PageWasRenamed";
createPage("TestPortal", "PageToRename");
@@ -589,7 +662,6 @@
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;
@@ -600,30 +672,251 @@
clickAndWait(MessageFormat.format(PAG_TL_RENAME, r));
+ selenium.type(PAG_REN_INP, pageNewName);
+ clickAndWait(PAG_REN_CAN);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+ r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+ clickAndWait(MessageFormat.format(POR_TL_MAIN, r));
+
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageNewName, 0) - 1;
+ Assert.assertTrue(r < 0, "Not Renamed page was found in the table.");
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+ 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));
+
+ selenium.type(PAG_REN_INP, pageNewName);
+ clickAndWait(PAG_REN_SUB);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+ r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+ clickAndWait(MessageFormat.format(POR_TL_MAIN, r));
+
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageNewName, 0) - 1;
+ Assert.assertTrue(r > -1, "Renamed page was not found in the table.");
+
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
+ Assert.assertTrue(r < 0, "Renamed page was found with the old name.");
+
}
- //TODO TEST CODE IS MISSING!
+ // TODO TEST CODE IS MISSING!
/**
* TEST CODE IS MISSING!
*/
- @Test(enabled = false, description="")
+ @Test(enabled = false, description = "")
public void testPageSecurity() {
}
-
+
/**
- * TEST CODE IS MISSING!
+ * Changing the values of selectors in page theme properties. New page name
+ * "PageToTheme" is created in "TestPortal". The three values in the
theme
+ * page are changed, but cancel is clicked. The theme page is reloaded and
+ * asserted, that default values are present. At the second attempt, the
+ * values are submited and after the reloading of theme page it is asserted,
+ * that they have formerly selected values and not the default ones.
*/
- //TODO TEST CODE IS MISSING!
- @Test(enabled = false, description="")
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate",
"testAddPage" }, description = "Changing selectors in theme details of a
page.")
public void testPageTheme() {
+
+ String portalName = "TestPortal";
+ String pageName = "PageToTheme";
+
+ createPage(portalName, pageName);
+
+ openAndWait("/portal");
+ clickAndWait("link=Admin");
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ 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_THEME, r));
+
+ Assert.assertEquals("default", selenium.getSelectedLabel(PAG_THE_LAY));
+ Assert.assertEquals("default", selenium.getSelectedLabel(PAG_THE_THE));
+ Assert.assertEquals("default", selenium.getSelectedLabel(PAG_THE_REN));
+
+ selenium.select(PAG_THE_LAY, "label=3columns");
+ selenium.select(PAG_THE_THE, "label=maple");
+ selenium.select(PAG_THE_REN, "label=emptyRenderer");
+ selenium.click(PAG_THE_CAN);
+ selenium.waitForPageToLoad("30000");
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+ 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_THEME, r));
+
+ Assert.assertEquals("default", selenium.getSelectedLabel(PAG_THE_LAY));
+ Assert.assertEquals("default", selenium.getSelectedLabel(PAG_THE_THE));
+ Assert.assertEquals("default", selenium.getSelectedLabel(PAG_THE_REN));
+ selenium.select(PAG_THE_LAY, "label=3columns");
+ selenium.select(PAG_THE_THE, "label=maple");
+ selenium.select(PAG_THE_REN, "label=emptyRenderer");
+ selenium.click(PAG_THE_SUB);
+ selenium.waitForPageToLoad("30000");
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+ 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_THEME, r));
+
+ Assert.assertEquals("3columns", selenium.getSelectedLabel(PAG_THE_LAY));
+ Assert.assertEquals("maple", selenium.getSelectedLabel(PAG_THE_THE));
+ Assert.assertEquals("emptyRenderer",
selenium.getSelectedLabel(PAG_THE_REN));
}
/**
- * TEST CODE IS MISSING!
+ * Page layout testing. Page named "pageToLayout" is created in
+ * "TestPortal". Four portlets are added to the page. Two to the center and
+ * two to the left column. Their order on the page is asserted. One portlet
+ * is selected in each columns and they are moved down, their order is
+ * asserted again. The same portlets are then moved up and again, their
+ * order is asserted. The portlets are then deleted and it is asserted they
+ * don't appear on screen.
*/
- //TODO TEST CODE IS MISSING!
- @Test(enabled = false, description="")
+ // TODO assert messages should be in property files
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate",
"testAddPage" }, description = "Page layout testing.")
public void testPageLayout() {
+
+ final String portalName = "TestPortal";
+ final String pageName = "pageToLayout";
+ createPortal(portalName);
+ createPage(portalName, pageName);
+
+ selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // add
+
+ 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;
+ selenium.click(MessageFormat.format(POR_TL_MAIN, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
+ selenium.click(MessageFormat.format(PAG_TL_LAYOUT, r));
+ waitFor(AJAX_LOAD);
+
+ selenium.click("link=" + MES_P1);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(SUB_LAYOUT_ADD_CENTER);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=" + MES_P2);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(SUB_LAYOUT_ADD_CENTER);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=" + MES_P3);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(SUB_LAYOUT_ADD_LEFT);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=" + MES_P4);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(SUB_LAYOUT_ADD_LEFT);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.open("/portal/auth/portal/" + portalName + "/" +
pageName);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertTextOrder("Coordination Map Portlet;Catalog Portlet;Current users;Test
charset");
+
+ // down
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+ r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+ selenium.click(MessageFormat.format(POR_TL_MAIN, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
+ selenium.click(MessageFormat.format(PAG_TL_LAYOUT, r));
+ waitFor(AJAX_LOAD);
+
+ selenium.addSelection(PAG_LAY_C_SEL, "label=CurrentUsersPortletWindow");
+ selenium.click(PAG_LAY_C_DOWN);
+ waitFor(AJAX_LOAD);
+ selenium.addSelection(PAG_LAY_L_SEL, "label=CoordinationMapPortletWindow");
+ selenium.click(PAG_LAY_L_DOWN);
+ waitFor(AJAX_LOAD);
+ selenium.open("/portal/auth/portal/" + portalName + "/" +
pageName);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertTextOrder("Catalog Portlet;Coordination Map Portlet;Test charset;Current
users");
+
+ // up
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+ r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+ selenium.click(MessageFormat.format(POR_TL_MAIN, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
+ selenium.click(MessageFormat.format(PAG_TL_LAYOUT, r));
+ waitFor(AJAX_LOAD);
+
+ selenium.addSelection(PAG_LAY_C_SEL, "label=CurrentUsersPortletWindow");
+ selenium.click(PAG_LAY_C_UP);
+ waitFor(AJAX_LOAD);
+ selenium.addSelection(PAG_LAY_L_SEL, "label=CoordinationMapPortletWindow");
+ selenium.click(PAG_LAY_L_UP);
+ waitFor(AJAX_LOAD);
+ selenium.open("/portal/auth/portal/" + portalName + "/" +
pageName);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertTextOrder("Coordination Map Portlet;Catalog Portlet;Current users;Test
charset");
+
+ // delete
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+ r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+ selenium.click(MessageFormat.format(POR_TL_MAIN, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
+ selenium.click(MessageFormat.format(PAG_TL_LAYOUT, r));
+ waitFor(AJAX_LOAD);
+
+ selenium.addSelection(PAG_LAY_C_SEL, "label=CurrentUsersPortletWindow");
+ selenium.click(PAG_LAY_C_DEL);
+ waitFor(AJAX_LOAD);
+ selenium.addSelection(PAG_LAY_L_SEL, "label=CoordinationMapPortletWindow");
+ selenium.click(PAG_LAY_L_DEL);
+ waitFor(AJAX_LOAD);
+ selenium.open("/portal/auth/portal/" + portalName + "/" +
pageName);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ assertTextOrder("Catalog Portlet;Test charset");
+ Assert.assertFalse(selenium.isTextPresent("Coordination Map Portlet"),
"Deleted portlet present.");
+ Assert.assertFalse(selenium.isTextPresent("Current users"), "Deleted
portlet present.");
+
}
private void createPortal(String name) {
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-05-07
14:00:43 UTC (rev 13319)
+++
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java 2009-05-07
15:25:45 UTC (rev 13320)
@@ -253,26 +253,14 @@
// click on the page layout
selenium.click(MessageFormat.format(PAG_TL_LAYOUT, r));
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
+ waitFor(AJAX_LOAD);
// hack
selenium.select(SEL_PORTLET_TYPE, "label=" + "cms");
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
+ waitFor(AJAX_LOAD);
selenium.select(SEL_PORTLET_TYPE, "label=" + type);
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
+ waitFor(AJAX_LOAD);
if ("portlet".equals(type)) {