From portal-commits at lists.jboss.org Fri May 29 11:06:59 2009 Content-Type: multipart/mixed; boundary="===============2826237469506980277==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r13423 - branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal. Date: Fri, 29 May 2009 10:58:56 -0400 Message-ID: --===============2826237469506980277== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: vrockai Date: 2009-05-29 10:58:56 -0400 (Fri, 29 May 2009) New Revision: 13423 Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal= /test/selenium/portal/EndtoEndPortalAdminTestCase.java Log: [JBPORTAL-2309] - test fixes, refactoring Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss= /portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/porta= l/test/selenium/portal/EndtoEndPortalAdminTestCase.java 2009-05-29 02:49:28= UTC (rev 13422) +++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/porta= l/test/selenium/portal/EndtoEndPortalAdminTestCase.java 2009-05-29 14:58:56= UTC (rev 13423) @@ -12,57 +12,40 @@ import org.testng.annotations.Test; = /** - * EndtoEndPortalAdminTestCase is responsible for end-to-end testing of po= rtal admin. Creating of new portal, adding pages to it and setting it as a = default portal - * is the main goal of this test case. + * EndtoEndPortalAdminTestCase is responsible for end-to-end testing of po= rtal + * admin. Creating of new portal, adding pages to it and setting it as a d= efault + * portal is the main goal of this test case. + * = * @author Viliam Rockai */ @Test(groups =3D { "end2end" }, enabled =3D true, description =3D "Creatin= g of new portal with content.") public class EndtoEndPortalAdminTestCase extends JBossPortalSeleniumTestCa= se { = - - private static final String SUB_POR_PROPS_UPDATE =3D "_AdminPortletWindow= :j_id108:common-manage-prop-form:update"; - - private static final String SUB_POR_PROPERTY =3D "_AdminPortletWindow:j_i= d108:common-edit-prop-form:add-property"; - - private static final String INP_POR_PROPERTY =3D "_AdminPortletWindow:j_i= d108:common-edit-prop-form:property"; - - private static final String SUB_POR_LISTENER =3D "_AdminPortletWindow:j_i= d108:edit-prop-form:update"; - - private static final String SEL_POR_LISTENER =3D "_AdminPortletWindow:j_i= d108:edit-prop-form:listener"; - - private static final String SUB_PAL =3D "_AdminPortletWindow:j_id134:comm= on-edit-page-error-form:update"; - - private static final String SEL_PAL_PR =3D "_AdminPortletWindow:j_id134:c= ommon-edit-page-error-form:page-res-select"; - - private static final String SEL_PAL_PN =3D "_AdminPortletWindow:j_id134:c= ommon-edit-page-error-form:page-not-found-select"; - - private static final String SEL_PAL_PI =3D "_AdminPortletWindow:j_id134:c= ommon-edit-page-error-form:page-internal-select"; - - private static final String SEL_PAL_PE =3D "_AdminPortletWindow:j_id134:c= ommon-edit-page-error-form:page-error-select"; - - private static final String SEL_PAL_PC =3D "_AdminPortletWindow:j_id134:c= ommon-edit-page-error-form:page-control-select"; - - private static final String SEL_PAL_PA =3D "_AdminPortletWindow:j_id134:c= ommon-edit-page-error-form:page-access-select"; - - private static final String SUB_POL =3D "_AdminPortletWindow:j_id134:comm= on-edit-portal-error-form:update"; - - private static final String SEL_POL_PR =3D "_AdminPortletWindow:j_id134:c= ommon-edit-portal-error-form:portal-res-input"; - - private static final String SEL_POL_PN =3D "_AdminPortletWindow:j_id134:c= ommon-edit-portal-error-form:portal-not-found-select"; - - private static final String SEL_POL_PI =3D "_AdminPortletWindow:j_id134:c= ommon-edit-portal-error-form:portal-internal-select"; - - private static final String SEL_POL_PE =3D "_AdminPortletWindow:j_id134:c= ommon-edit-portal-error-form:portal-error-select"; - - private static final String SEL_POL_PU =3D "_AdminPortletWindow:j_id134:c= ommon-edit-portal-error-form:portal-unavail-select"; - - private static final String SEL_POL_PA =3D "_AdminPortletWindow:j_id134:c= ommon-edit-portal-error-form:portal-access-select"; - - /** prefix for locator properties =3D portal.e2e.*/ + /** prefix for locator properties =3D portal.e2e. */ public static String casePfx =3D "portal.e2e."; + = + private final String SUB_POR_PROPS_UPDATE =3D getLoc(casePfx + "sub.por.= props.update", "//input[contains(@id,'common-manage-prop-form:update')]"); + private final String SUB_POR_PROPERTY =3D getLoc(casePfx + "sub.por.prop= erty", "//input[contains(@id,'common-edit-prop-form:add-property')]"); + private final String INP_POR_PROPERTY =3D getLoc(casePfx + "inp.por.prop= erty", "//input[contains(@id,'common-edit-prop-form:property')]"); + private final String SUB_POR_LISTENER =3D getLoc(casePfx + "sub.por.list= ener", "//input[contains(@id,'edit-prop-form:update')]"); + private final String SEL_POR_LISTENER =3D getLoc(casePfx + "sel.por.list= ener", "//select[contains(@id,'edit-prop-form:listener')]"); + private final String SUB_PAL =3D getLoc(casePfx + "sub.pal", "//input[co= ntains(@id,'common-edit-page-error-form:update')]"); + private final String INP_PAL_PR =3D getLoc(casePfx + "inp.pal.pr", "//in= put[contains(@id,'common-edit-page-error-form:page-res-select')]"); + private final String SEL_PAL_PN =3D getLoc(casePfx + "sel.pal.pn", "//se= lect[contains(@id,'common-edit-page-error-form:page-not-found-select')]"); + private final String SEL_PAL_PI =3D getLoc(casePfx + "sel.pal.pi", "//se= lect[contains(@id,'common-edit-page-error-form:page-internal-select')]"); + private final String SEL_PAL_PE =3D getLoc(casePfx + "sel.pal.pe", "//se= lect[contains(@id,'common-edit-page-error-form:page-error-select')]"); + private final String SEL_PAL_PC =3D getLoc(casePfx + "sel.pal.pc", "//se= lect[contains(@id,'common-edit-page-error-form:page-control-select')]"); + private final String SEL_PAL_PA =3D getLoc(casePfx + "sel.pal.pa", "//se= lect[contains(@id,'common-edit-page-error-form:page-access-select')]"); + private final String SUB_POL =3D getLoc(casePfx + "sub.pol", "//input[co= ntains(@id,'common-edit-portal-error-form:update')]"); + private final String INP_POL_PR =3D getLoc(casePfx + "inp.pol.pr", "//in= put[contains(@id,'common-edit-portal-error-form:portal-res-input')]"); + private final String SEL_POL_PN =3D getLoc(casePfx + "sel.pol.pn", "//se= lect[contains(@id,'common-edit-portal-error-form:portal-not-found-select')]= "); + private final String SEL_POL_PI =3D getLoc(casePfx + "sel.pol.pi", "//se= lect[contains(@id,'common-edit-portal-error-form:portal-internal-select')]"= ); + private final String SEL_POL_PE =3D getLoc(casePfx + "sel.pol.pe", "//se= lect[contains(@id,'common-edit-portal-error-form:portal-error-select')]"); + private final String SEL_POL_PU =3D getLoc(casePfx + "sel.pol.pu", "//se= lect[contains(@id,'common-edit-portal-error-form:portal-unavail-select')]"); + private final String SEL_POL_PA =3D getLoc(casePfx + "sel.pol.pa", "//se= lect[contains(@id,'common-edit-portal-error-form:portal-access-select')]"); = - private final String ADR_PORTAL =3D getLoc(casePfx + "adr.home","/portal"= ); - public final String SEL_PORTLET_TYPE =3D getLoc(casePfx + "sel.portlet.ty= pe","//select[contains(@id,'windowForm:instanceId')]"); = + private final String ADR_PORTAL =3D getLoc(casePfx + "adr.home", "/portal= "); + public final String SEL_PORTLET_TYPE =3D getLoc(casePfx + "sel.portlet.ty= pe", "//select[contains(@id,'windowForm:instanceId')]"); private final String SUB_LAYOUT_ADD_CENTER =3D getLoc(casePfx + "sub.layo= ut.add.center", "//input[contains(@id,'layoutForm:a_center')]"); private final String INP_WINDOW_NAME =3D getLoc(casePfx + "inp.window.nam= e", "//input[contains(@id,'windowForm:windowName')]"); private final String SUB_RENAME_PORTAL =3D getLoc(casePfx + "sub.rename.p= ortal", "//input[contains(@id,'renameForm:rename')]"); @@ -99,10 +82,10 @@ private final String INP_NET_SEARCH =3D getLoc(casePfx + "inp.net.search"= , "//div[contains(@id,'directory_search_div')]/form/input[@name=3D'query']"= ); private final String SUB_NET_SEARCH =3D getLoc(casePfx + "sub.net.search"= , "//div[contains(@id,'directory_search_div')]/form/input[@type=3D'submit']= "); private final String TAB_PROPERTIES =3D getLoc(casePfx + "tab.properties"= , "//table[contains(@id,'common-manage-prop-form:prop-data-table')]"); - private final String TAB_PROP_VAL =3D getLoc(casePfx + "tab.prop.val", "/= /input[contains(@id,''common-manage-prop-form:prop-data-table:{0}:prop-valu= e-input'')]"); + private final String TAB_PROP_VAL =3D getLoc(casePfx + "tab.prop.val", + "//input[contains(@id,''common-manage-prop-form:prop-data-table:{0}:pro= p-value-input'')]"); private final String TAB_PROP_DEL =3D getLoc(casePfx + "tab.prop.val", "/= /a[contains(@id,''common-manage-prop-form:prop-data-table:{0}:delete'')]"); - = - = + @BeforeMethod(groups =3D { "log" }) protected void loginBeforeTest() { logoutIfPossible(); @@ -115,80 +98,91 @@ = final String portalName =3D "UseCasePortal"; final String portalManName =3D "UseManagePortal"; - = + final String page1Name =3D "firstPage"; final String page2Name =3D "anotherPage"; final String page3Name =3D "lastPage with whitespace"; final String page4Name =3D "dseer"; final String page5Name =3D "cemese"; - = + final String page1ManName =3D "firstManPage"; - = + final String PORTLET1 =3D "Cart Portlet"; final String por1str =3D "Cart Portlet"; final String PORTLET2 =3D "Band Culinaria"; final String por2str =3D "Band Culinaria"; - final String PORTLET3 =3D "Cahuete.com"; - final String por3str =3D "Cahuete.com"; + final String PORTLET3 =3D "Web Assurance"; + final String por3str =3D "web-assurance.net"; final String PORTLET4 =3D "dir1/foo.txt"; final String por4str =3D "File Portlet"; final String PORTLET5 =3D "default/project.html"; final String por5str =3D "Our wiki knowledge base"; = /** - * Usecase for creating small portal with content. Portal named "UseCaseP= ortal" is created similar way as in {@link AdminPortalTestCase#testPortalCr= eate()}. Then few pages are added similar way - * as in {@link AdminPortalTestCase#testAddPage()}. A portlet is added to= each page similar way as in {@link AdminPortalTestCase#testCreateWindow()}= . The important information about pages and portlets are - * listed in the table below + * Usecase for creating small portal with content. Portal named + * "UseCasePortal" is created similar way as in + * {@link AdminPortalTestCase#testPortalCreate()}. Then few pages are add= ed + * similar way as in {@link AdminPortalTestCase#testAddPage()}. A portlet= is + * added to each page similar way as in + * {@link AdminPortalTestCase#testCreateWindow()}. The important informat= ion + * about pages and portlets are listed in the table below * = * - * - * + * * * * * - * = + * * * * - * = - * + * + * + * * * * - * = - * + * + * + * * * * - * = - * + * + * + * * * * - * = - * + * + * + * * * * - * = - * + * + * + * * * *
Important information about portlets in EndtoEndPortalAdminTe= stCaseImportant information about portlets in + * EndtoEndPortalAdminTestCase
page nameportlet nameasserted stringportlet typeportlet type
firstPageCart PortletCart PortletfirstPageCart PortletCart Portletportlet
anotherPageBand CulinariaBand CulinariaanotherPageBand CulinariaBand Culinariawidget/google
lastPage with whitespaceCahuete.comCahuete.comlastPage with whitespaceCahuete.comCahuete.comwidget/netvibes
dseerdir1/foo.txtFile Portletdseerdir1/foo.txtFile Portletfilesystem
cemesedefault/project.htmlOur wiki knowledge basecemesedefault/project.htmlOur wiki knowledge basecms
* = - * Final assertions are made by clicking on the pages listed above and as= serting that each page contains the string specific for the portlet used (a= gain listed in table). + * Final assertions are made by clicking on the pages listed above and + * asserting that each page contains the string specific for the portlet + * used (again listed in table). * = */ @Test(enabled =3D true, description =3D "Usecase for creating small porta= l with content.") public void testCreatePortalUsecase() { createPortal(portalName); = - addPage(portalName,page1Name); - addPage(portalName,page2Name); - addPage(portalName,page3Name); - addPage(portalName,page4Name); - addPage(portalName,page5Name); + addPage(portalName, page1Name); + addPage(portalName, page2Name); + addPage(portalName, page3Name); + addPage(portalName, page4Name); + addPage(portalName, page5Name); = addPortlet(portalName, page1Name, PORTLET1, "portlet"); addPortlet(portalName, page2Name, PORTLET2, "widget/google"); @@ -216,205 +210,185 @@ assertPageContains(page5Name, por5str); = } - = - @Test(enabled =3D false, description =3D "Usecase for managing portals - = listeners and properties.") - public void testManagePortalUsecase() { + + @Test(enabled =3D true, description =3D "Usecase for managing portals - l= isteners and properties.") + public void testManagePortalListernersUsecase() { int r =3D -1; - = - createPortal(portalManName); - addPage(portalManName,page1ManName); - //- Verify that you can add listener + + //createPortal(portalManName); + // addPage(portalManName,page1ManName); + // - Verify that you can add listener goToProperties(); = selenium.select(SEL_POR_LISTENER, "label=3Dtest_listener"); selenium.click(SUB_POR_LISTENER); selenium.waitForPageToLoad(PAGE_LOAD); - = + goToProperties(); - Assert.assertEquals(selenium.getSelectedLabel(SEL_POR_LISTENER),"test_li= stener","Previously selected label not being the current label."); - = + Assert.assertEquals(selenium.getSelectedLabel(SEL_POR_LISTENER), "test_l= istener", "Previously selected label not being the current label."); + selenium.select(SEL_POR_LISTENER, "label=3Duser_listener"); selenium.click(SUB_POR_LISTENER); selenium.waitForPageToLoad(PAGE_LOAD); - = + goToProperties(); - Assert.assertEquals(selenium.getSelectedLabel(SEL_POR_LISTENER),"user_li= stener","Previously selected label not being the current label."); - = + Assert.assertEquals(selenium.getSelectedLabel(SEL_POR_LISTENER), "user_l= istener", "Previously selected label not being the current label."); + } + + @Test(enabled =3D true, description =3D "Usecase for managing portals - l= isteners and properties.") + public void testManagePortalPropertiesUsecase() { + int r =3D -1; + goToProperties(); - //- assert no property is added - //r =3D countTableRows(TAB_PROPERTIES); - //Assert.assertTrue(r=3D=3D0,"Property table is not empty."); + // - assert no property is added + // r =3D countTableRows(TAB_PROPERTIES); + // Assert.assertTrue(r=3D=3D0,"Property table is not empty."); Assert.assertFalse(selenium.isElementPresent(TAB_PROPERTIES)); - = - //- add d&d prop + + // - add d&d prop selenium.type(INP_POR_PROPERTY, "dragadrop"); selenium.click(SUB_POR_PROPERTY); selenium.waitForPageToLoad(PAGE_LOAD); - r =3D findTableRow(TAB_PROPERTIES, "dragadrop", 0)-1; - selenium.type(MessageFormat.format(TAB_PROP_VAL, r),"dragicek"); + r =3D findTableRow(TAB_PROPERTIES, "dragadrop", 0) - 1; + selenium.type(MessageFormat.format(TAB_PROP_VAL, r), "dragicek"); selenium.click(SUB_POR_PROPS_UPDATE); selenium.waitForPageToLoad(PAGE_LOAD); - = + goToProperties(); - //- assert d&d is added - r =3D findTableRow(TAB_PROPERTIES, "dragadrop", 0)-1; - Assert.assertTrue(r>-1,"Previously added property drag&drop not found in= the property table"); - = - //- add partial refresh prop + // - assert d&d is added + //selenium.setSpeed("5000"); + r =3D findTableRow(TAB_PROPERTIES, "dragadrop", 0) - 1; + Assert.assertTrue(r > -1, "Previously added property drag&drop not found= in the property table"); + + // - add partial refresh prop selenium.type(INP_POR_PROPERTY, "partialRef"); selenium.click(SUB_POR_PROPERTY); - selenium.waitForPageToLoad("30000"); - = - r =3D findTableRow(TAB_PROPERTIES, "partialRef", 0)-1; - selenium.type(MessageFormat.format(TAB_PROP_VAL, r),"partialicek"); + selenium.waitForPageToLoad(PAGE_LOAD); + + r =3D findTableRow(TAB_PROPERTIES, "partialRef", 0) - 1; + selenium.type(MessageFormat.format(TAB_PROP_VAL, r), "partialicek"); selenium.click(SUB_POR_PROPS_UPDATE); selenium.waitForPageToLoad("30000"); - = + goToProperties(); - //- assert partial refresh is added - r =3D findTableRow(TAB_PROPERTIES, "partialRef", 0)-1; - Assert.assertTrue(r>-1,"Previously added property partial refresh not fo= und in the property table"); - = - //- delete d&d prop - r =3D findTableRow(TAB_PROPERTIES, "dragadrop", 0)-1; + // - assert partial refresh is added + r =3D findTableRow(TAB_PROPERTIES, "partialRef", 0) - 1; + Assert.assertTrue(r > -1, "Previously added property partial refresh not= found in the property table"); + + // - delete d&d prop + r =3D findTableRow(TAB_PROPERTIES, "dragadrop", 0) - 1; selenium.click(MessageFormat.format(TAB_PROP_DEL, r)); selenium.waitForPageToLoad(PAGE_LOAD); - = + goToProperties(); - //- assert d&d is not present - r =3D findTableRow(TAB_PROPERTIES, "dragadrop", 0)-1; - Assert.assertTrue(r=3D=3D-1,"Deleted property drag and drop was found in= property table."); - = - //- delete partial refresh prop - r =3D findTableRow(TAB_PROPERTIES, "partialRef", 0)-1; + // - assert d&d is not present + r =3D findTableRow(TAB_PROPERTIES, "dragadrop", 0) - 1; + Assert.assertTrue(r < 0, "Deleted property drag and drop was found in pr= operty table."); + + // - delete partial refresh prop + r =3D findTableRow(TAB_PROPERTIES, "partialRef", 0) - 1; selenium.click(MessageFormat.format(TAB_PROP_DEL, r)); selenium.waitForPageToLoad(PAGE_LOAD); goToProperties(); - //- assert partial refresh is not added - r =3D findTableRow(TAB_PROPERTIES, "partialRef", 0)-1; - Assert.assertTrue(r<0,"Deleted property partial refresh was found in pro= perty table."); - = + // - assert partial refresh is not added + Assert.assertFalse(selenium.isElementPresent(TAB_PROPERTIES)); + } - = + @Test(enabled =3D false, description =3D "Usecase for managing portals - = error handling.") public void testPortalErrorHandlingUsecase() { - = + String LAB_RED =3D "Redirect to the specified resource"; String LAB_ERR =3D "Display the default error message"; String LAB_REM =3D "Remove the resource from page"; - = + // *** // *** Portal level // *** - = + // select RED handling goToProperties(); - selenium.select(SEL_POL_PA, "label=3D"+LAB_RED); - selenium.waitForPageToLoad(PAGE_LOAD); - selenium.select(SEL_POL_PU, "label=3D"+LAB_RED); - selenium.waitForPageToLoad(PAGE_LOAD); - selenium.select(SEL_POL_PE, "label=3D"+LAB_RED); - selenium.waitForPageToLoad(PAGE_LOAD); - selenium.select(SEL_POL_PI, "label=3D"+LAB_RED); - selenium.waitForPageToLoad(PAGE_LOAD); - selenium.select(SEL_POL_PN, "label=3D"+LAB_RED); - selenium.waitForPageToLoad(PAGE_LOAD); - selenium.type(SEL_POL_PR, "/WEB-INF/jsp/error/port3al.jsp"); + selectIfNotSelected(SEL_POL_PA, LAB_RED); + selectIfNotSelected(SEL_POL_PU, LAB_RED); + selectIfNotSelected(SEL_POL_PE, LAB_RED); + selectIfNotSelected(SEL_POL_PI, LAB_RED); + selectIfNotSelected(SEL_POL_PN, LAB_RED); + selenium.type(INP_POL_PR, "/WEB-INF/jsp/error/portal.jsp"); selenium.click(SUB_POL); selenium.waitForPageToLoad(PAGE_LOAD); - = + // assert RED handling openAndAssert("/portal/auth/portal/default/Test/Exception+test/Exception= PortletWindow?op=3Derror&action=3D1", "ERROR"); openAndAssert("/portal/auth/portal/default/Test/Exception+test/Exception= PortletWindow?op=3Derror&action=3D1", "Powered by JBoss Portal"); - = + // select ERR handling goToProperties(); - selenium.select(SEL_POL_PA, "label=3D"+LAB_ERR); - selenium.waitForPageToLoad(PAGE_LOAD); - selenium.select(SEL_POL_PU, "label=3D"+LAB_ERR); - selenium.waitForPageToLoad(PAGE_LOAD); - selenium.select(SEL_POL_PE, "label=3D"+LAB_ERR); - selenium.waitForPageToLoad(PAGE_LOAD); - selenium.select(SEL_POL_PI, "label=3D"+LAB_ERR); - selenium.waitForPageToLoad(PAGE_LOAD); - selenium.select(SEL_POL_PN, "label=3D"+LAB_ERR); - selenium.waitForPageToLoad(PAGE_LOAD); - selenium.type(SEL_POL_PR, "/WEB-INF/jsp/error/port3al.jsp"); + selectIfNotSelected(SEL_POL_PA, LAB_ERR); + selectIfNotSelected(SEL_POL_PU, LAB_ERR); + selectIfNotSelected(SEL_POL_PE, LAB_ERR); + selectIfNotSelected(SEL_POL_PI, LAB_ERR); + selectIfNotSelected(SEL_POL_PN, LAB_ERR); + selenium.type(INP_POL_PR, "/WEB-INF/jsp/error/portal.jsp"); selenium.click(SUB_POL); selenium.waitForPageToLoad(PAGE_LOAD); - = + // assert ERR handling openAndAssert("/portal/auth/portal/default/Test/Exception+test/Exception= PortletWindow?op=3Derror&action=3D1", "HTTP Status 500"); - = + // *** // *** Page level // *** - = + // select RED handling goToProperties(); - selenium.select(SEL_PAL_PA, "label=3D"+LAB_RED); - selenium.waitForPageToLoad(PAGE_LOAD); - selenium.select(SEL_PAL_PC, "label=3D"+LAB_RED); - selenium.waitForPageToLoad(PAGE_LOAD); - selenium.select(SEL_PAL_PE, "label=3D"+LAB_RED); - selenium.waitForPageToLoad(PAGE_LOAD); - selenium.select(SEL_PAL_PI, "label=3D"+LAB_RED); - selenium.waitForPageToLoad(PAGE_LOAD); - selenium.select(SEL_PAL_PN, "label=3D"+LAB_RED); - selenium.waitForPageToLoad(PAGE_LOAD); - selenium.type(SEL_PAL_PR, "/WEB-INF/jsp/error/pa9ge.jsp"); + selectIfNotSelected(SEL_PAL_PA, LAB_RED); + selectIfNotSelected(SEL_PAL_PC, LAB_RED); + selectIfNotSelected(SEL_PAL_PE, LAB_RED); + selectIfNotSelected(SEL_PAL_PI, LAB_RED); + selectIfNotSelected(SEL_PAL_PN, LAB_RED); + selenium.type(INP_PAL_PR, "/WEB-INF/jsp/error/page.jsp"); selenium.click(SUB_PAL); selenium.waitForPageToLoad(PAGE_LOAD); - = + // assert RED handling openAndAssert("/portal/auth/portal/default/Test/Exception+test/Exception= PortletWindow?op=3Derror&action=3D1", "ERROR"); openAndAssert("/portal/auth/portal/default/Test/Exception+test/Exception= PortletWindow?op=3Derror&action=3D1", "Powered by JBoss Portal"); - = + // select ERR handling goToProperties(); - selenium.select(SEL_PAL_PA, "label=3D"+LAB_ERR); - selenium.waitForPageToLoad(PAGE_LOAD); - selenium.select(SEL_PAL_PC, "label=3D"+LAB_ERR); - selenium.waitForPageToLoad(PAGE_LOAD); - selenium.select(SEL_PAL_PE, "label=3D"+LAB_ERR); - selenium.waitForPageToLoad(PAGE_LOAD); - selenium.select(SEL_PAL_PI, "label=3D"+LAB_ERR); - selenium.waitForPageToLoad(PAGE_LOAD); - selenium.select(SEL_PAL_PN, "label=3D"+LAB_ERR); - selenium.waitForPageToLoad(PAGE_LOAD); - selenium.type(SEL_PAL_PR, "/WEB-INF/jsp/error/pa9ge.jsp"); + selectIfNotSelected(SEL_PAL_PA, LAB_ERR); + selectIfNotSelected(SEL_PAL_PC, LAB_ERR); + selectIfNotSelected(SEL_PAL_PE, LAB_ERR); + selectIfNotSelected(SEL_PAL_PI, LAB_ERR); + selectIfNotSelected(SEL_PAL_PN, LAB_ERR); + selenium.type(INP_PAL_PR, "/WEB-INF/jsp/error/page.jsp"); selenium.click(SUB_PAL); selenium.waitForPageToLoad(PAGE_LOAD); - = + // assert ERR handling openAndAssert("/portal/auth/portal/default/Test/Exception+test/Exception= PortletWindow?op=3Derror&action=3D1", "ERROR"); openAndAssert("/portal/auth/portal/default/Test/Exception+test/Exception= PortletWindow?op=3Derror&action=3D1", "Powered by JBoss Portal"); - = + // select REM handling goToProperties(); - selenium.select(SEL_PAL_PA, "label=3D"+LAB_REM); - selenium.waitForPageToLoad(PAGE_LOAD); - selenium.select(SEL_PAL_PC, "label=3D"+LAB_REM); - selenium.waitForPageToLoad(PAGE_LOAD); - selenium.select(SEL_PAL_PE, "label=3D"+LAB_REM); - selenium.waitForPageToLoad(PAGE_LOAD); - selenium.select(SEL_PAL_PI, "label=3D"+LAB_REM); - selenium.waitForPageToLoad(PAGE_LOAD); - selenium.select(SEL_PAL_PN, "label=3D"+LAB_REM); - selenium.waitForPageToLoad(PAGE_LOAD); - selenium.type(SEL_PAL_PR, "/WEB-INF/jsp/error/pa9ge.jsp"); + selectIfNotSelected(SEL_PAL_PA, LAB_REM); + selectIfNotSelected(SEL_PAL_PC, LAB_REM); + selectIfNotSelected(SEL_PAL_PE, LAB_REM); + selectIfNotSelected(SEL_PAL_PI, LAB_REM); + selectIfNotSelected(SEL_PAL_PN, LAB_REM); + selenium.type(INP_PAL_PR, "/WEB-INF/jsp/error/page.jsp"); selenium.click(SUB_PAL); selenium.waitForPageToLoad(PAGE_LOAD); - = + // assert REM handling openAndAssert("/portal/auth/portal/default/Test/Exception+test/Exception= PortletWindow?op=3Derror&action=3D1", "ERROR"); openAndAssert("/portal/auth/portal/default/Test/Exception+test/Exception= PortletWindow?op=3Derror&action=3D1", "Powered by JBoss Portal"); } - = - private void openAndAssert(String add, String ass){ + + private void openAndAssert(String add, String ass) { selenium.open(add); selenium.waitForPageToLoad(PAGE_LOAD); - Assert.assertTrue(selenium.isTextPresent(ass),"Text: {\"" + ass + "\"} n= ot found on the page"); + Assert.assertTrue(selenium.isTextPresent(ass), "Text: {\"" + ass + "\"} = not found on the page"); } = private void goToProperties() { @@ -427,7 +401,7 @@ clickIfVisible(TAB_PORTALOBJ_ID); clickIfVisible(LNK_PORTALS_ID); clickIfVisible(LNK_PORTAL_HOME); - = + selenium.click("link=3DProperties"); selenium.waitForPageToLoad(PAGE_LOAD); } @@ -435,12 +409,12 @@ private void assertPageContains(String pageName, String awaitStr) { selenium.open(ADR_PORTAL); selenium.waitForPageToLoad(PAGE_LOAD); - = - if(selenium.isAlertPresent()){ - selenium.getAlert(); - debugPrint("[EndtoEndPortalAdminTestCase] - alert was caught"); + + if (selenium.isAlertPresent()) { + selenium.getAlert(); + debugPrint("[EndtoEndPortalAdminTestCase] - alert was caught"); } - = + selenium.click("link=3D" + pageName); selenium.waitForPageToLoad(PAGE_LOAD); = @@ -537,21 +511,20 @@ selenium.waitForPageToLoad(PAGE_LOAD); } else if ("cms".equals(type)) { String[] links =3D portletName.split("/"); - selenium.click("link=3D"+links[0]); + selenium.click("link=3D" + links[0]); selenium.waitForPageToLoad(PAGE_LOAD); portletName =3D links[1]; } else if ("filesystem".equals(type)) { String[] links =3D portletName.split("/"); - selenium.click("link=3D"+links[0]); + selenium.click("link=3D" + links[0]); selenium.waitForPageToLoad(PAGE_LOAD); portletName =3D links[1]; } - = - selenium.click("link=3D*" + portletName+"*"); + + selenium.click("link=3D*" + portletName + "*"); selenium.waitForPageToLoad(PAGE_LOAD); selenium.click(SUB_LAYOUT_ADD_CENTER); selenium.waitForPageToLoad(PAGE_LOAD); - = = } = --===============2826237469506980277==--