Author: lfryc(a)redhat.com
Date: 2011-02-07 09:21:04 -0500 (Mon, 07 Feb 2011)
New Revision: 21509
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/AbstractPanelMenuTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuDOMEvents.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuMode.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuSelection.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuSimple.java
Modified:
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichPanelMenuBean.properties
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenu/simple.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/GuardRequest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/PanelMenu.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/PanelMenuAttributes.java
Log:
rich:panelMenu - automated (RFPL-950)
Modified:
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichPanelMenuBean.properties
===================================================================
---
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichPanelMenuBean.properties 2011-02-07
14:19:37 UTC (rev 21508)
+++
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichPanelMenuBean.properties 2011-02-07
14:21:04 UTC (rev 21509)
@@ -6,78 +6,78 @@
attr.itemMode.ajax=ajax
attr.itemMode.server=server
attr.itemMode.null=
-attr.groupLeftIconCollapsed.grid=grid
-attr.groupLeftIconCollapsed.disc=disc
-attr.groupLeftIconCollapsed.chevronUp=chevronUp
-attr.groupLeftIconCollapsed.chevronDown=chevronDown
-attr.groupLeftIconCollapsed.triangle=triangle
-attr.groupLeftIconCollapsed.triangleUp=triangleUp
-attr.groupLeftIconCollapsed.triangleDown=triangleDown
-attr.groupLeftIconCollapsed.customURL=/resources/images/loading.gif
-attr.groupLeftIconCollapsed.null=
-attr.groupRightIconCollapsed.grid=grid
-attr.groupRightIconCollapsed.disc=disc
-attr.groupRightIconCollapsed.chevronUp=chevronUp
-attr.groupRightIconCollapsed.chevronDown=chevronDown
-attr.groupRightIconCollapsed.triangle=triangle
-attr.groupRightIconCollapsed.triangleUp=triangleUp
-attr.groupRightIconCollapsed.triangleDown=triangleDown
-attr.groupRightIconCollapsed.customURL=/resources/images/loading.gif
-attr.groupRightIconCollapsed.null=
-attr.groupLeftIconDisabled.grid=grid
-attr.groupLeftIconDisabled.disc=disc
-attr.groupLeftIconDisabled.chevronUp=chevronUp
-attr.groupLeftIconDisabled.chevronDown=chevronDown
-attr.groupLeftIconDisabled.triangle=triangle
-attr.groupLeftIconDisabled.triangleUp=triangleUp
-attr.groupLeftIconDisabled.triangleDown=triangleDown
-attr.groupLeftIconDisabled.customURL=/resources/images/loading.gif
-attr.groupLeftIconDisabled.null=
-attr.groupRightIconDisabled.grid=grid
-attr.groupRightIconDisabled.disc=disc
-attr.groupRightIconDisabled.chevronUp=chevronUp
-attr.groupRightIconDisabled.chevronDown=chevronDown
-attr.groupRightIconDisabled.triangle=triangle
-attr.groupRightIconDisabled.triangleUp=triangleUp
-attr.groupRightIconDisabled.triangleDown=triangleDown
-attr.groupRightIconDisabled.customURL=/resources/images/loading.gif
-attr.groupRightIconDisabled.null=
-attr.groupLeftIconExpanded.grid=grid
-attr.groupLeftIconExpanded.disc=disc
-attr.groupLeftIconExpanded.chevronUp=chevronUp
-attr.groupLeftIconExpanded.chevronDown=chevronDown
-attr.groupLeftIconExpanded.triangle=triangle
-attr.groupLeftIconExpanded.triangleUp=triangleUp
-attr.groupLeftIconExpanded.triangleDown=triangleDown
-attr.groupLeftIconExpanded.customURL=/resources/images/loading.gif
-attr.groupLeftIconExpanded.null=
-attr.groupRightIconExpanded.grid=grid
-attr.groupRightIconExpanded.disc=disc
-attr.groupRightIconExpanded.chevronUp=chevronUp
-attr.groupRightIconExpanded.chevronDown=chevronDown
-attr.groupRightIconExpanded.triangle=triangle
-attr.groupRightIconExpanded.triangleUp=triangleUp
-attr.groupRightIconExpanded.triangleDown=triangleDown
-attr.groupRightIconExpanded.customURL=/resources/images/loading.gif
-attr.groupRightIconExpanded.null=
-attr.itemLeftIconDisabled.grid=grid
-attr.itemLeftIconDisabled.disc=disc
-attr.itemLeftIconDisabled.chevronUp=chevronUp
-attr.itemLeftIconDisabled.chevronDown=chevronDown
-attr.itemLeftIconDisabled.triangle=triangle
-attr.itemLeftIconDisabled.triangleUp=triangleUp
-attr.itemLeftIconDisabled.triangleDown=triangleDown
-attr.itemLeftIconDisabled.customURL=/resources/images/loading.gif
-attr.itemLeftIconDisabled.null=
-attr.itemRightIconDisabled.grid=grid
-attr.itemRightIconDisabled.disc=disc
-attr.itemRightIconDisabled.chevronUp=chevronUp
-attr.itemRightIconDisabled.chevronDown=chevronDown
-attr.itemRightIconDisabled.triangle=triangle
-attr.itemRightIconDisabled.triangleUp=triangleUp
-attr.itemRightIconDisabled.triangleDown=triangleDown
-attr.itemRightIconDisabled.customURL=/resources/images/loading.gif
-attr.itemRightIconDisabled.null=
+attr.groupCollapsedLeftIcon.grid=grid
+attr.groupCollapsedLeftIcon.disc=disc
+attr.groupCollapsedLeftIcon.chevronUp=chevronUp
+attr.groupCollapsedLeftIcon.chevronDown=chevronDown
+attr.groupCollapsedLeftIcon.triangle=triangle
+attr.groupCollapsedLeftIcon.triangleUp=triangleUp
+attr.groupCollapsedLeftIcon.triangleDown=triangleDown
+attr.groupCollapsedLeftIcon.customURL=/resources/images/loading.gif
+attr.groupCollapsedLeftIcon.null=
+attr.groupCollapsedRightIcon.grid=grid
+attr.groupCollapsedRightIcon.disc=disc
+attr.groupCollapsedRightIcon.chevronUp=chevronUp
+attr.groupCollapsedRightIcon.chevronDown=chevronDown
+attr.groupCollapsedRightIcon.triangle=triangle
+attr.groupCollapsedRightIcon.triangleUp=triangleUp
+attr.groupCollapsedRightIcon.triangleDown=triangleDown
+attr.groupCollapsedRightIcon.customURL=/resources/images/loading.gif
+attr.groupCollapsedRightIcon.null=
+attr.groupDisabledLeftIcon.grid=grid
+attr.groupDisabledLeftIcon.disc=disc
+attr.groupDisabledLeftIcon.chevronUp=chevronUp
+attr.groupDisabledLeftIcon.chevronDown=chevronDown
+attr.groupDisabledLeftIcon.triangle=triangle
+attr.groupDisabledLeftIcon.triangleUp=triangleUp
+attr.groupDisabledLeftIcon.triangleDown=triangleDown
+attr.groupDisabledLeftIcon.customURL=/resources/images/loading.gif
+attr.groupDisabledLeftIcon.null=
+attr.groupDisabledRightIcon.grid=grid
+attr.groupDisabledRightIcon.disc=disc
+attr.groupDisabledRightIcon.chevronUp=chevronUp
+attr.groupDisabledRightIcon.chevronDown=chevronDown
+attr.groupDisabledRightIcon.triangle=triangle
+attr.groupDisabledRightIcon.triangleUp=triangleUp
+attr.groupDisabledRightIcon.triangleDown=triangleDown
+attr.groupDisabledRightIcon.customURL=/resources/images/loading.gif
+attr.groupDisabledRightIcon.null=
+attr.groupExpandedLeftIcon.grid=grid
+attr.groupExpandedLeftIcon.disc=disc
+attr.groupExpandedLeftIcon.chevronUp=chevronUp
+attr.groupExpandedLeftIcon.chevronDown=chevronDown
+attr.groupExpandedLeftIcon.triangle=triangle
+attr.groupExpandedLeftIcon.triangleUp=triangleUp
+attr.groupExpandedLeftIcon.triangleDown=triangleDown
+attr.groupExpandedLeftIcon.customURL=/resources/images/loading.gif
+attr.groupExpandedLeftIcon.null=
+attr.groupExpandedRightIcon.grid=grid
+attr.groupExpandedRightIcon.disc=disc
+attr.groupExpandedRightIcon.chevronUp=chevronUp
+attr.groupExpandedRightIcon.chevronDown=chevronDown
+attr.groupExpandedRightIcon.triangle=triangle
+attr.groupExpandedRightIcon.triangleUp=triangleUp
+attr.groupExpandedRightIcon.triangleDown=triangleDown
+attr.groupExpandedRightIcon.customURL=/resources/images/loading.gif
+attr.groupExpandedRightIcon.null=
+attr.itemDisabledLeftIcon.grid=grid
+attr.itemDisabledLeftIcon.disc=disc
+attr.itemDisabledLeftIcon.chevronUp=chevronUp
+attr.itemDisabledLeftIcon.chevronDown=chevronDown
+attr.itemDisabledLeftIcon.triangle=triangle
+attr.itemDisabledLeftIcon.triangleUp=triangleUp
+attr.itemDisabledLeftIcon.triangleDown=triangleDown
+attr.itemDisabledLeftIcon.customURL=/resources/images/loading.gif
+attr.itemDisabledLeftIcon.null=
+attr.itemDisabledRightIcon.grid=grid
+attr.itemDisabledRightIcon.disc=disc
+attr.itemDisabledRightIcon.chevronUp=chevronUp
+attr.itemDisabledRightIcon.chevronDown=chevronDown
+attr.itemDisabledRightIcon.triangle=triangle
+attr.itemDisabledRightIcon.triangleUp=triangleUp
+attr.itemDisabledRightIcon.triangleDown=triangleDown
+attr.itemDisabledRightIcon.customURL=/resources/images/loading.gif
+attr.itemDisabledRightIcon.null=
attr.itemLeftIcon.grid=grid
attr.itemLeftIcon.disc=disc
attr.itemLeftIcon.chevronUp=chevronUp
@@ -96,78 +96,78 @@
attr.itemRightIcon.triangleDown=triangleDown
attr.itemRightIcon.customURL=/resources/images/loading.gif
attr.itemRightIcon.null=
-attr.topGroupLeftIconCollapsed.grid=grid
-attr.topGroupLeftIconCollapsed.disc=disc
-attr.topGroupLeftIconCollapsed.chevronUp=chevronUp
-attr.topGroupLeftIconCollapsed.chevronDown=chevronDown
-attr.topGroupLeftIconCollapsed.triangle=triangle
-attr.topGroupLeftIconCollapsed.triangleUp=triangleUp
-attr.topGroupLeftIconCollapsed.triangleDown=triangleDown
-attr.topGroupLeftIconCollapsed.customURL=/resources/images/loading.gif
-attr.topGroupLeftIconCollapsed.null=
-attr.topGroupRightIconCollapsed.grid=grid
-attr.topGroupRightIconCollapsed.disc=disc
-attr.topGroupRightIconCollapsed.chevronUp=chevronUp
-attr.topGroupRightIconCollapsed.chevronDown=chevronDown
-attr.topGroupRightIconCollapsed.triangle=triangle
-attr.topGroupRightIconCollapsed.triangleUp=triangleUp
-attr.topGroupRightIconCollapsed.triangleDown=triangleDown
-attr.topGroupRightIconCollapsed.customURL=/resources/images/loading.gif
-attr.topGroupRightIconCollapsed.null=
-attr.topGroupLeftIconDisabled.grid=grid
-attr.topGroupLeftIconDisabled.disc=disc
-attr.topGroupLeftIconDisabled.chevronUp=chevronUp
-attr.topGroupLeftIconDisabled.chevronDown=chevronDown
-attr.topGroupLeftIconDisabled.triangle=triangle
-attr.topGroupLeftIconDisabled.triangleUp=triangleUp
-attr.topGroupLeftIconDisabled.triangleDown=triangleDown
-attr.topGroupLeftIconDisabled.customURL=/resources/images/loading.gif
-attr.topGroupLeftIconDisabled.null=
-attr.topGroupRightIconDisabled.grid=grid
-attr.topGroupRightIconDisabled.disc=disc
-attr.topGroupRightIconDisabled.chevronUp=chevronUp
-attr.topGroupRightIconDisabled.chevronDown=chevronDown
-attr.topGroupRightIconDisabled.triangle=triangle
-attr.topGroupRightIconDisabled.triangleUp=triangleUp
-attr.topGroupRightIconDisabled.triangleDown=triangleDown
-attr.topGroupRightIconDisabled.customURL=/resources/images/loading.gif
-attr.topGroupRightIconDisabled.null=
-attr.topGroupLeftIconExpanded.grid=grid
-attr.topGroupLeftIconExpanded.disc=disc
-attr.topGroupLeftIconExpanded.chevronUp=chevronUp
-attr.topGroupLeftIconExpanded.chevronDown=chevronDown
-attr.topGroupLeftIconExpanded.triangle=triangle
-attr.topGroupLeftIconExpanded.triangleUp=triangleUp
-attr.topGroupLeftIconExpanded.triangleDown=triangleDown
-attr.topGroupLeftIconExpanded.customURL=/resources/images/loading.gif
-attr.topGroupLeftIconExpanded.null=
-attr.topGroupRightIconExpanded.grid=grid
-attr.topGroupRightIconExpanded.disc=disc
-attr.topGroupRightIconExpanded.chevronUp=chevronUp
-attr.topGroupRightIconExpanded.chevronDown=chevronDown
-attr.topGroupRightIconExpanded.triangle=triangle
-attr.topGroupRightIconExpanded.triangleUp=triangleUp
-attr.topGroupRightIconExpanded.triangleDown=triangleDown
-attr.topGroupRightIconExpanded.customURL=/resources/images/loading.gif
-attr.topGroupRightIconExpanded.null=
-attr.topItemLeftIconDisabled.grid=grid
-attr.topItemLeftIconDisabled.disc=disc
-attr.topItemLeftIconDisabled.chevronUp=chevronUp
-attr.topItemLeftIconDisabled.chevronDown=chevronDown
-attr.topItemLeftIconDisabled.triangle=triangle
-attr.topItemLeftIconDisabled.triangleUp=triangleUp
-attr.topItemLeftIconDisabled.triangleDown=triangleDown
-attr.topItemLeftIconDisabled.customURL=/resources/images/loading.gif
-attr.topItemLeftIconDisabled.null=
-attr.topItemRightIconDisabled.grid=grid
-attr.topItemRightIconDisabled.disc=disc
-attr.topItemRightIconDisabled.chevronUp=chevronUp
-attr.topItemRightIconDisabled.chevronDown=chevronDown
-attr.topItemRightIconDisabled.triangle=triangle
-attr.topItemRightIconDisabled.triangleUp=triangleUp
-attr.topItemRightIconDisabled.triangleDown=triangleDown
-attr.topItemRightIconDisabled.customURL=/resources/images/loading.gif
-attr.topItemRightIconDisabled.null=
+attr.topGroupCollapsedLeftIcon.grid=grid
+attr.topGroupCollapsedLeftIcon.disc=disc
+attr.topGroupCollapsedLeftIcon.chevronUp=chevronUp
+attr.topGroupCollapsedLeftIcon.chevronDown=chevronDown
+attr.topGroupCollapsedLeftIcon.triangle=triangle
+attr.topGroupCollapsedLeftIcon.triangleUp=triangleUp
+attr.topGroupCollapsedLeftIcon.triangleDown=triangleDown
+attr.topGroupCollapsedLeftIcon.customURL=/resources/images/loading.gif
+attr.topGroupCollapsedLeftIcon.null=
+attr.topGroupCollapsedRightIcon.grid=grid
+attr.topGroupCollapsedRightIcon.disc=disc
+attr.topGroupCollapsedRightIcon.chevronUp=chevronUp
+attr.topGroupCollapsedRightIcon.chevronDown=chevronDown
+attr.topGroupCollapsedRightIcon.triangle=triangle
+attr.topGroupCollapsedRightIcon.triangleUp=triangleUp
+attr.topGroupCollapsedRightIcon.triangleDown=triangleDown
+attr.topGroupCollapsedRightIcon.customURL=/resources/images/loading.gif
+attr.topGroupCollapsedRightIcon.null=
+attr.topGroupDisabledLeftIcon.grid=grid
+attr.topGroupDisabledLeftIcon.disc=disc
+attr.topGroupDisabledLeftIcon.chevronUp=chevronUp
+attr.topGroupDisabledLeftIcon.chevronDown=chevronDown
+attr.topGroupDisabledLeftIcon.triangle=triangle
+attr.topGroupDisabledLeftIcon.triangleUp=triangleUp
+attr.topGroupDisabledLeftIcon.triangleDown=triangleDown
+attr.topGroupDisabledLeftIcon.customURL=/resources/images/loading.gif
+attr.topGroupDisabledLeftIcon.null=
+attr.topGroupDisabledRightIcon.grid=grid
+attr.topGroupDisabledRightIcon.disc=disc
+attr.topGroupDisabledRightIcon.chevronUp=chevronUp
+attr.topGroupDisabledRightIcon.chevronDown=chevronDown
+attr.topGroupDisabledRightIcon.triangle=triangle
+attr.topGroupDisabledRightIcon.triangleUp=triangleUp
+attr.topGroupDisabledRightIcon.triangleDown=triangleDown
+attr.topGroupDisabledRightIcon.customURL=/resources/images/loading.gif
+attr.topGroupDisabledRightIcon.null=
+attr.topGroupExpandedLeftIcon.grid=grid
+attr.topGroupExpandedLeftIcon.disc=disc
+attr.topGroupExpandedLeftIcon.chevronUp=chevronUp
+attr.topGroupExpandedLeftIcon.chevronDown=chevronDown
+attr.topGroupExpandedLeftIcon.triangle=triangle
+attr.topGroupExpandedLeftIcon.triangleUp=triangleUp
+attr.topGroupExpandedLeftIcon.triangleDown=triangleDown
+attr.topGroupExpandedLeftIcon.customURL=/resources/images/loading.gif
+attr.topGroupExpandedLeftIcon.null=
+attr.topGroupExpandedRightIcon.grid=grid
+attr.topGroupExpandedRightIcon.disc=disc
+attr.topGroupExpandedRightIcon.chevronUp=chevronUp
+attr.topGroupExpandedRightIcon.chevronDown=chevronDown
+attr.topGroupExpandedRightIcon.triangle=triangle
+attr.topGroupExpandedRightIcon.triangleUp=triangleUp
+attr.topGroupExpandedRightIcon.triangleDown=triangleDown
+attr.topGroupExpandedRightIcon.customURL=/resources/images/loading.gif
+attr.topGroupExpandedRightIcon.null=
+attr.topItemDisabledLeftIcon.grid=grid
+attr.topItemDisabledLeftIcon.disc=disc
+attr.topItemDisabledLeftIcon.chevronUp=chevronUp
+attr.topItemDisabledLeftIcon.chevronDown=chevronDown
+attr.topItemDisabledLeftIcon.triangle=triangle
+attr.topItemDisabledLeftIcon.triangleUp=triangleUp
+attr.topItemDisabledLeftIcon.triangleDown=triangleDown
+attr.topItemDisabledLeftIcon.customURL=/resources/images/loading.gif
+attr.topItemDisabledLeftIcon.null=
+attr.topItemDisabledRightIcon.grid=grid
+attr.topItemDisabledRightIcon.disc=disc
+attr.topItemDisabledRightIcon.chevronUp=chevronUp
+attr.topItemDisabledRightIcon.chevronDown=chevronDown
+attr.topItemDisabledRightIcon.triangle=triangle
+attr.topItemDisabledRightIcon.triangleUp=triangleUp
+attr.topItemDisabledRightIcon.triangleDown=triangleDown
+attr.topItemDisabledRightIcon.customURL=/resources/images/loading.gif
+attr.topItemDisabledRightIcon.null=
attr.topItemLeftIcon.grid=grid
attr.topItemLeftIcon.disc=disc
attr.topItemLeftIcon.chevronUp=chevronUp
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenu/simple.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenu/simple.xhtml 2011-02-07
14:19:37 UTC (rev 21508)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenu/simple.xhtml 2011-02-07
14:21:04 UTC (rev 21509)
@@ -55,19 +55,19 @@
expandEvent="#{richPanelMenuBean.attributes['expandEvent'].value}"
expandSingle="#{richPanelMenuBean.attributes['expandSingle'].value}"
groupClass="#{richPanelMenuBean.attributes['groupClass'].value}"
-
groupLeftIconCollapsed="#{richPanelMenuBean.attributes['groupLeftIconCollapsed'].value}"
-
groupRightIconCollapsed="#{richPanelMenuBean.attributes['groupRightIconCollapsed'].value}"
-
groupDisableClass="#{richPanelMenuBean.attributes['groupDisableClass'].value}"
-
groupLeftIconDisabled="#{richPanelMenuBean.attributes['groupLeftIconDisabled'].value}"
-
groupRightIconDisabled="#{richPanelMenuBean.attributes['groupRightIconDisabled'].value}"
-
groupLeftIconExpanded="#{richPanelMenuBean.attributes['groupLeftIconExpanded'].value}"
-
groupRightIconExpanded="#{richPanelMenuBean.attributes['groupRightIconExpanded'].value}"
+
groupCollapsedLeftIcon="#{richPanelMenuBean.attributes['groupCollapsedLeftIcon'].value}"
+
groupCollapsedRightIcon="#{richPanelMenuBean.attributes['groupCollapsedRightIcon'].value}"
+
groupDisabledClass="#{richPanelMenuBean.attributes['groupDisabledClass'].value}"
+
groupDisabledLeftIcon="#{richPanelMenuBean.attributes['groupDisabledRightIcon'].value}"
+
groupDisabledRightIcon="#{richPanelMenuBean.attributes['groupRightIconDisabled'].value}"
+
groupExpandedLeftIcon="#{richPanelMenuBean.attributes['groupExpandedLeftIcon'].value}"
+
groupExpandedRightIcon="#{richPanelMenuBean.attributes['groupExpandedRightIcon'].value}"
groupMode="#{richPanelMenuBean.attributes['groupMode'].value}"
immediate="#{richPanelMenuBean.attributes['immediate'].value}"
itemClass="#{richPanelMenuBean.attributes['topItemClass'].value}"
-
itemDisableClass="#{richPanelMenuBean.attributes['topItemClassDisabled'].value}"
-
itemLeftIconDisabled="#{richPanelMenuBean.attributes['topItemLeftIconDisabled'].value}"
-
itemRightIconDisabled="#{richPanelMenuBean.attributes['topItemRightIconDisabled'].value}"
+
itemDisabledClass="#{richPanelMenuBean.attributes['itemDisabledClass'].value}"
+
itemDisabledLeftIcon="#{richPanelMenuBean.attributes['itemDisabledLeftIcon'].value}"
+
itemDisabledRightIcon="#{richPanelMenuBean.attributes['itemDisabledRightIcon'].value}"
itemLeftIcon="#{richPanelMenuBean.attributes['topItemLeftIconDisabled'].value}"
itemRightIcon="#{richPanelMenuBean.attributes['topItemRightIconDisabled'].value}"
itemMode="#{richPanelMenuBean.attributes['itemMode'].value}"
@@ -85,17 +85,17 @@
style="#{richPanelMenuBean.attributes['style'].value}"
styleClass="#{richPanelMenuBean.attributes['styleClass'].value}"
topGroupClass="#{richPanelMenuBean.attributes['topGroupClass'].value}"
-
topGroupLeftIconCollapsed="#{richPanelMenuBean.attributes['topGroupLeftIconCollapsed'].value}"
-
topGroupRightIconCollapsed="#{richPanelMenuBean.attributes['topGroupRightIconCollapsed'].value}"
-
topGroupClassDisabled="#{richPanelMenuBean.attributes['topGroupClassDisabled'].value}"
-
topGroupLeftIconDisabled="#{richPanelMenuBean.attributes['topGroupLeftIconDisabled'].value}"
-
topGroupRightIconDisabled="#{richPanelMenuBean.attributes['topGroupRightIconDisabled'].value}"
-
topGroupLeftIconExpanded="#{richPanelMenuBean.attributes['topGroupLeftIconExpanded'].value}"
-
topGroupRightIconExpanded="#{richPanelMenuBean.attributes['topGroupRightIconExpanded'].value}"
+
topGroupCollapsedLeftIcon="#{richPanelMenuBean.attributes['topGroupCollapsedLeftIcon'].value}"
+
topGroupCollapsedRightIcon="#{richPanelMenuBean.attributes['topGroupCollapsedRightIcon'].value}"
+
topGroupDisabledClass="#{richPanelMenuBean.attributes['topGroupDisabledClass'].value}"
+
topGroupDisabledLeftIcon="#{richPanelMenuBean.attributes['topGroupDisabledLeftIcon'].value}"
+
topGroupDisabledRightIcon="#{richPanelMenuBean.attributes['topGroupDisabledRightIcon'].value}"
+
topGroupExpandedLeftIcon="#{richPanelMenuBean.attributes['topGroupExpandedLeftIcon'].value}"
+
topGroupExpandedRightIcon="#{richPanelMenuBean.attributes['topGroupExpandedRightIcon'].value}"
topItemClass="#{richPanelMenuBean.attributes['topItemClass'].value}"
-
topItemClassDisabled="#{richPanelMenuBean.attributes['topItemClassDisabled'].value}"
-
topItemLeftIconDisabled="#{richPanelMenuBean.attributes['topItemLeftIconDisabled'].value}"
-
topItemRightIconDisabled="#{richPanelMenuBean.attributes['topItemRightIconDisabled'].value}"
+
topItemDisabledClass="#{richPanelMenuBean.attributes['topItemDisabledClass'].value}"
+
topItemDisabledLeftIcon="#{richPanelMenuBean.attributes['topItemDisabledLeftIcon'].value}"
+
topItemDisabledRightIcon="#{richPanelMenuBean.attributes['topItemDisabledRightIcon'].value}"
topItemLeftIcon="#{richPanelMenuBean.attributes['topItemLeftIconDisabled'].value}"
topItemRightIcon="#{richPanelMenuBean.attributes['topItemRightIconDisabled'].value}"
width="#{richPanelMenuBean.attributes['width'].value}"
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/GuardRequest.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/GuardRequest.java 2011-02-07
14:19:37 UTC (rev 21508)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/GuardRequest.java 2011-02-07
14:21:04 UTC (rev 21509)
@@ -33,7 +33,7 @@
private RequestTypeGuard guard;
public GuardRequest(RequestType requestExpected) {
- guard = new RequestTypeGuard(requestExpected, false);
+ this.guard = new RequestTypeGuard(requestExpected, false);
}
public void waitRequest() {
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2011-02-07
14:19:37 UTC (rev 21508)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2011-02-07
14:21:04 UTC (rev 21509)
@@ -21,7 +21,9 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest;
+import static org.jboss.test.selenium.dom.Event.*;
import static org.jboss.test.selenium.encapsulated.JavaScript.js;
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guard;
import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardHttp;
import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
import static org.jboss.test.selenium.locator.LocatorFactory.id;
@@ -70,7 +72,7 @@
* @version $Revision$
*/
public abstract class AbstractMetamerTest extends AbstractTestCase {
-
+
protected JQueryLocator time = jq("span[id$=requestTime]");
protected JQueryLocator renderChecker = jq("span[id$=renderChecker]");
protected JQueryLocator statusChecker =
jq("span[id$=statusCheckerOutput]");
@@ -79,17 +81,17 @@
protected TextRetriever retrieveRenderChecker =
retrieveText.locator(jq("#renderChecker"));
protected TextRetriever retrieveStatusChecker =
retrieveText.locator(jq("#statusCheckerOutput"));
protected PhaseInfo phaseInfo = new PhaseInfo();
-
-
- protected LocatorReference<JQueryLocator> attributesRoot = new
LocatorReference<JQueryLocator>(pjq("span[id$=:attributes:panel]"));
+ protected LocatorReference<JQueryLocator> attributesRoot = new
LocatorReference<JQueryLocator>(
+ pjq("span[id$=:attributes:panel]"));
+
/**
* timeout in miliseconds
*/
public static final long TIMEOUT = 5000;
@Inject
- @Templates({"plain", "richDataTable1,redDiv",
"richDataTable2,redDiv", "a4jRepeat1", "a4jRepeat2",
"hDataTable1",
- "hDataTable2", "uiRepeat1", "uiRepeat2"})
+ @Templates({ "plain", "richDataTable1,redDiv",
"richDataTable2,redDiv", "a4jRepeat1", "a4jRepeat2",
"hDataTable1",
+ "hDataTable2", "uiRepeat1", "uiRepeat2" })
private TemplatesList template;
/**
@@ -181,7 +183,7 @@
/**
* A helper method for testing javascripts events. It sets
alert('testedevent') to the input field for given event
* and fires the event. Then it checks the message in the alert dialog.
- *
+ *
* @param event
* JavaScript event to be tested
* @param element
@@ -199,11 +201,12 @@
selenium.fireEvent(element, event);
waitGui.failWith("Attribute on" + attributeName + " does not work
correctly").until(
- new EventFiredCondition(event));
+ new EventFiredCondition(event));
}
/**
* Returns the locale of the tested page
+ *
* @return the locale of the tested page
*/
public Locale getLocale() {
@@ -214,7 +217,7 @@
/**
* A helper method for testing attribute "style". It sets
"background-color: yellow; font-size: 1.5em;" to the input
* field and checks that it was changed on the page.
- *
+ *
* @param element
* locator of tested element
* @param attribute
@@ -274,14 +277,14 @@
/**
* A helper method for testing attribute "dir". It tries null, ltr and
rtl.
- *
+ *
* @param element
* locator of tested element
*/
protected void testDir(ElementLocator<?> element) {
ElementLocator<?> ltrInput = ref(attributesRoot,
"input[type=radio][name$=dirInput][value=ltr]");
ElementLocator<?> rtlInput = ref(attributesRoot,
"input[type=radio][name$=dirInput][value=rtl]");
-
+
AttributeLocator<?> dirAttribute = element.getAttribute(new
Attribute("dir"));
// dir = null
@@ -304,7 +307,7 @@
/**
* A helper method for testing attribute "lang".
- *
+ *
* @param element
* locator of tested element
*/
@@ -329,7 +332,7 @@
/**
* A helper method for testing attribute "title".
- *
+ *
* @param element
* locator of tested element
*/
@@ -350,7 +353,9 @@
}
/**
- * A helper method for testing standard HTML attributes (RichFaces attributes that
are directly put into markup), e.g. hreflang.
+ * A helper method for testing standard HTML attributes (RichFaces attributes that
are directly put into markup),
+ * e.g. hreflang.
+ *
* @param element
* locator of tested element
* @param attribute
@@ -360,11 +365,12 @@
*/
protected void testHtmlAttribute(ElementLocator<?> element, String attribute,
String value) {
AttributeLocator<?> attr = element.getAttribute(new Attribute(attribute));
-
+
selenium.type(pjq("input[id$=" + attribute + "Input]"),
value);
selenium.waitForPageToLoad();
- assertTrue(selenium.getAttribute(attr).contains(value), "Attribute " +
attribute + " should contain \"" + value + "\".");
+ assertTrue(selenium.getAttribute(attr).contains(value), "Attribute " +
attribute + " should contain \"" + value
+ + "\".");
}
/**
@@ -383,10 +389,32 @@
/**
* Verifies that only given phases were executed. It uses the list of phases in the
header of the page.
- * @param phases phases that are expected to have been executed
+ *
+ * @param phases
+ * phases that are expected to have been executed
*/
@Deprecated
protected void assertPhases(PhaseId... phases) {
phaseInfo.assertPhases(phases);
}
+
+ protected void fireEventNatively(ElementLocator<?> target, Event event) {
+ if (event == CLICK) {
+ selenium.click(target);
+ } else if (event == DBLCLICK) {
+ selenium.doubleClick(target);
+ } else if (event == MOUSEMOVE) {
+ selenium.mouseMove(target);
+ } else if (event == MOUSEDOWN) {
+ selenium.mouseDown(target);
+ } else if (event == MOUSEUP) {
+ selenium.mouseUp(target);
+ } else if (event == MOUSEOVER) {
+ selenium.mouseOver(target);
+ } else if (event == MOUSEOUT) {
+ selenium.mouseOut(target);
+ } else {
+ selenium.fireEvent(target, event);
+ }
+ }
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/PanelMenu.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/PanelMenu.java 2011-02-07
14:19:37 UTC (rev 21508)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/PanelMenu.java 2011-02-07
14:21:04 UTC (rev 21509)
@@ -4,8 +4,8 @@
import static org.jboss.test.selenium.locator.Attribute.SRC;
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
import static org.jboss.test.selenium.locator.reference.ReferencedLocator.ref;
-import static org.jboss.test.selenium.utils.text.SimplifiedFormat.format;
+import org.jboss.test.selenium.GuardRequest;
import org.jboss.test.selenium.JQuerySelectors;
import org.jboss.test.selenium.RequestTypeModelGuard.Model;
import org.jboss.test.selenium.framework.AjaxSelenium;
@@ -14,7 +14,9 @@
import org.jboss.test.selenium.locator.ElementLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.locator.reference.ReferencedLocator;
+import org.jboss.test.selenium.request.RequestType;
import org.jboss.test.selenium.utils.text.SimplifiedFormat;
+import org.richfaces.PanelMenuMode;
public class PanelMenu extends AbstractModel<JQueryLocator> implements Model {
@@ -22,11 +24,26 @@
private ReferencedLocator<JQueryLocator> topItems = ref(root, ">
.rf-pm-top-itm");
private ReferencedLocator<JQueryLocator> topGroups = ref(root, ">
.rf-pm-top-gr");
+ private ReferencedLocator<JQueryLocator> anySelectedItem = ref(root,
".rf-pm-itm-sel");
+ private ReferencedLocator<JQueryLocator> anySelectedGroup = ref(root,
".rf-pm-gr-sel");
+ private ReferencedLocator<JQueryLocator> anyDisabledItem = ref(root,
"div[class*=rf-pm-][class*=-itm-dis]");
+ private ReferencedLocator<JQueryLocator> anyDisabledGroup = ref(root,
"div[class*=rf-pm-][class*=-gr-dis]");
+ PanelMenuMode groupMode = PanelMenuMode.client;
+ PanelMenuMode itemMode = PanelMenuMode.ajax;
+
public PanelMenu(JQueryLocator root) {
super(root);
}
+ public void setGroupMode(PanelMenuMode groupMode) {
+ this.groupMode = groupMode;
+ }
+
+ public void setItemMode(PanelMenuMode itemMode) {
+ this.itemMode = itemMode;
+ }
+
public int getItemCount() {
return selenium.getCount(topItems);
}
@@ -46,7 +63,7 @@
public Item getItem(int index) {
return new Item(topItems.getNthOccurence(index));
}
-
+
public Item getItemContains(String string) {
return new Item(JQuerySelectors.append(topItems,
SimplifiedFormat.format(":contains('{0}')", string)));
}
@@ -54,7 +71,7 @@
public Group getGroup(int index) {
return new Group(topGroups.getNthOccurence(index));
}
-
+
public Group getGroupContains(String string) {
return new Group(JQuerySelectors.append(topGroups,
SimplifiedFormat.format(":contains('{0}')", string)));
}
@@ -66,6 +83,26 @@
public Group getAnyTopGroup() {
return new Group(topGroups.getReferenced());
}
+
+ public Group getAnySelectedItem() {
+ return new Group(anySelectedItem.getReferenced());
+ }
+
+ public Group getAnySelectedGroup() {
+ return new Group(anySelectedGroup.getReferenced());
+ }
+
+ public Group getAnyDisabledItem() {
+ return new Group(anyDisabledItem.getReferenced());
+ }
+
+ public Group getAnyDisabledGroup() {
+ return new Group(anyDisabledGroup.getReferenced());
+ }
+
+ public Group getAnyExpandedGroup() {
+ return new Group(JQuerySelectors.append(topGroups,
":has(.rf-pm-hdr-exp)"));
+ }
public class Group extends AbstractModel<JQueryLocator> implements Model {
ReferencedLocator<JQueryLocator> header = ref(root, ">
div[class*=rf-pm-][class*=-gr-hdr]");
@@ -110,7 +147,7 @@
public Group getGroup(int index) {
return new Group(groups.getNthOccurence(index));
}
-
+
public Group getGroupContains(String string) {
return new Group(JQuerySelectors.append(groups,
SimplifiedFormat.format(":contains('{0}')", string)));
}
@@ -126,6 +163,14 @@
public boolean isSelected() {
return
selenium.getAttribute(header.getAttribute(CLASS)).contains("-sel");
}
+
+ public boolean isExpanded() {
+ return
selenium.getAttribute(header.getAttribute(CLASS)).contains("-exp");
+ }
+
+ public boolean isCollapsed() {
+ return
selenium.getAttribute(header.getAttribute(CLASS)).contains("-colps");
+ }
public boolean isHovered() {
return
selenium.getAttribute(this.getAttribute(CLASS)).contains("-hov");
@@ -152,7 +197,11 @@
}
public void toggle() {
- selenium.click(label);
+ new GuardRequest(getRequestTypeForMode(groupMode)) {
+ public void command() {
+ selenium.click(label);
+ }
+ }.waitRequest();
}
public class Icon extends PanelMenu.Icon {
@@ -207,7 +256,11 @@
}
public void select() {
- selenium.click(label);
+ new GuardRequest(getRequestTypeForMode(itemMode)) {
+ public void command() {
+ selenium.click(label);
+ }
+ }.waitRequest();
}
public void hover() {
@@ -263,4 +316,15 @@
}
+ public static RequestType getRequestTypeForMode(PanelMenuMode mode) {
+ switch (mode) {
+ case ajax:
+ return RequestType.XHR;
+ case server:
+ return RequestType.HTTP;
+ default:
+ return RequestType.NONE;
+ }
+ }
+
}
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/AbstractPanelMenuTest.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/AbstractPanelMenuTest.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/AbstractPanelMenuTest.java 2011-02-07
14:21:04 UTC (rev 21509)
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richPanelMenu;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.richfaces.PanelMenuMode.ajax;
+
+import java.net.URL;
+
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.model.PanelMenu;
+import org.testng.annotations.BeforeMethod;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class AbstractPanelMenuTest extends AbstractMetamerTest {
+
+ PanelMenuAttributes attributes = new PanelMenuAttributes();
+ PanelMenu menu = new PanelMenu(pjq("div.rf-pm[id$=panelMenu]"));
+ PanelMenu.Item item3 = menu.getItemContains("Item 3");
+ PanelMenu.Item item4 = menu.getItemContains("Item 4");
+ PanelMenu.Group group1 = menu.getGroupContains("Group 1");
+ PanelMenu.Group group2 = menu.getGroupContains("Group 2");
+ PanelMenu.Item item22 = group2.getItemContains("Item 2.2");
+ PanelMenu.Item item25 = group2.getItemContains("Item 2.5");
+ PanelMenu.Group group24 = group2.getGroupContains("Group 2.4");
+ PanelMenu.Group group26 = group2.getGroupContains("Group 2.6");
+ PanelMenu.Item item242 = group24.getItemContains("Item 2.4.2");
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath,
"faces/components/richPanelMenu/simple.xhtml");
+ }
+
+ @BeforeMethod
+ public void setupModes() {
+ attributes.setItemMode(ajax);
+ attributes.setGroupMode(ajax);
+ menu.setItemMode(ajax);
+ menu.setGroupMode(ajax);
+ }
+}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/PanelMenuAttributes.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/PanelMenuAttributes.java 2011-02-07
14:19:37 UTC (rev 21508)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/PanelMenuAttributes.java 2011-02-07
14:21:04 UTC (rev 21509)
@@ -45,7 +45,7 @@
setProperty("expandEvent", expandEvent);
}
- public void setExpandSingle(String expandSingle) {
+ public void setExpandSingle(Boolean expandSingle) {
setProperty("expandSingle", expandSingle);
}
@@ -181,7 +181,7 @@
setProperty("topItemRightIcon", topItemRightIcon);
}
- public void setWidth(Integer width) {
+ public void setWidth(String width) {
setProperty("width", width);
}
}
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuDOMEvents.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuDOMEvents.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuDOMEvents.java 2011-02-07
14:21:04 UTC (rev 21509)
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richPanelMenu;
+
+import static org.jboss.test.selenium.dom.Event.CLICK;
+import static org.jboss.test.selenium.dom.Event.DBLCLICK;
+import static org.jboss.test.selenium.dom.Event.MOUSEDOWN;
+import static org.jboss.test.selenium.dom.Event.MOUSEMOVE;
+import static org.jboss.test.selenium.dom.Event.MOUSEOUT;
+import static org.jboss.test.selenium.dom.Event.MOUSEOVER;
+import static org.jboss.test.selenium.dom.Event.MOUSEUP;
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.testng.Assert.assertTrue;
+
+import java.net.URL;
+
+import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.waiting.selenium.SeleniumCondition;
+import org.jboss.test.selenium.waiting.selenium.SeleniumWaiting;
+import org.richfaces.PanelMenuMode;
+import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestPanelMenuDOMEvents extends AbstractPanelMenuTest {
+
+ @Inject
+ PanelMenuMode mode = PanelMenuMode.client;
+
+ @Inject
+ @Use("events")
+ Event event = DBLCLICK;
+ Event[] events = new Event[] { CLICK, DBLCLICK, MOUSEDOWN, MOUSEMOVE, MOUSEOUT,
MOUSEOVER, MOUSEUP };
+
+ SeleniumWaiting waitToggle;
+
+ SeleniumCondition isGroup2Expanded = new SeleniumCondition() {
+ public boolean isTrue() {
+ return group2.isExpanded();
+ }
+ };
+
+ SeleniumCondition isGroup2Collapsed = new SeleniumCondition() {
+ public boolean isTrue() {
+ return group2.isCollapsed();
+ }
+ };
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath,
"faces/components/richPanelMenu/simple.xhtml");
+ }
+
+ @BeforeMethod
+ public void setup() {
+ attributes.setGroupMode(mode);
+ menu.setGroupMode(mode);
+ waitToggle = waitModel.timeout(5000).interval(500);
+ }
+
+ @Test
+ @Use(field = "mode", enumeration = true)
+ public void testExpandEvent() {
+ attributes.setExpandEvent(event.getEventName());
+ assertTrue(group2.isCollapsed());
+
+ fireEventNatively(group2.getLabel(), event);
+ waitToggle.until(isGroup2Expanded);
+ }
+
+ @Test
+ @Use(field = "mode", enumeration = true)
+ public void testCollapseEvent() {
+ attributes.setCollapseEvent(event.getEventName());
+
+ group2.toggle();
+ assertTrue(group2.isExpanded());
+
+ fireEventNatively(group2.getLabel(), event);
+ waitToggle.until(isGroup2Collapsed);
+ }
+
+ @Test
+ @Use(field = "mode", empty = true)
+ public void testDOMEvent() {
+ super.testFireEvent(event, menu);
+ }
+}
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuMode.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuMode.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuMode.java 2011-02-07
14:21:04 UTC (rev 21509)
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richPanelMenu;
+
+import static javax.faces.event.PhaseId.APPLY_REQUEST_VALUES;
+import static javax.faces.event.PhaseId.INVOKE_APPLICATION;
+import static javax.faces.event.PhaseId.PROCESS_VALIDATIONS;
+import static javax.faces.event.PhaseId.RENDER_RESPONSE;
+import static javax.faces.event.PhaseId.RESTORE_VIEW;
+import static javax.faces.event.PhaseId.UPDATE_MODEL_VALUES;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+
+import javax.faces.event.PhaseId;
+
+import org.richfaces.PanelMenuMode;
+import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestPanelMenuMode extends AbstractPanelMenuTest {
+
+ @Inject
+ @Use(enumeration = true)
+ PanelMenuMode mode;
+
+ PhaseId[] expectedPhases = new PhaseId[] { RESTORE_VIEW, APPLY_REQUEST_VALUES,
PROCESS_VALIDATIONS,
+ UPDATE_MODEL_VALUES, INVOKE_APPLICATION, RENDER_RESPONSE };
+
+ @Test
+ public void testGroupMode() {
+ attributes.setGroupMode(mode);
+ menu.setGroupMode(mode);
+
+ assertTrue(group1.isCollapsed());
+ group1.toggle();
+ assertTrue(group1.isExpanded());
+
+ if (mode != PanelMenuMode.client) {
+ phaseInfo.assertPhases(expectedPhases);
+ }
+
+ group1.toggle();
+
+ assertTrue(group1.isCollapsed());
+
+ if (mode != PanelMenuMode.client) {
+ phaseInfo.assertPhases(expectedPhases);
+ }
+ }
+
+ @Test
+ public void testItemMode() {
+ attributes.setItemMode(mode);
+ menu.setItemMode(mode);
+
+ assertFalse(item3.isSelected());
+ item3.select();
+ assertTrue(item3.isSelected());
+
+ if (mode != PanelMenuMode.client) {
+ phaseInfo.assertPhases(expectedPhases);
+ phaseInfo.assertListener(INVOKE_APPLICATION, "item changed");
+ }
+ }
+}
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuSelection.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuSelection.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuSelection.java 2011-02-07
14:21:04 UTC (rev 21509)
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richPanelMenu;
+
+import static org.testng.Assert.assertEquals;
+
+import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestPanelMenuSelection extends AbstractPanelMenuTest {
+
+ @Inject
+ @Use(booleans = { true, false })
+ Boolean bubbleSelection;
+
+ @Test
+ public void testBubbleSelection() {
+ attributes.setBubbleSelection(bubbleSelection);
+
+ assertEquals(getSelectedItems(), 0);
+ assertEquals(getSelectedGroups(), 0);
+ group2.toggle();
+ assertEquals(getSelectedItems(), 0);
+ assertEquals(getSelectedGroups(), 0);
+ item22.select();
+ assertEquals(getSelectedItems(), 1);
+ assertEquals(getSelectedGroups(), bubbledGroups(1));
+ group24.toggle();
+ assertEquals(getSelectedItems(), 1);
+ assertEquals(getSelectedGroups(), bubbledGroups(1));
+ item242.select();
+ assertEquals(getSelectedItems(), 1);
+ assertEquals(getSelectedGroups(), bubbledGroups(2));
+ }
+
+ private int bubbledGroups(int bubbledGroups) {
+ return bubbleSelection ? bubbledGroups : 0;
+ }
+
+ private int getSelectedItems() {
+ return selenium.getCount(menu.getAnySelectedItem());
+ }
+
+ private int getSelectedGroups() {
+ return selenium.getCount(menu.getAnySelectedGroup());
+ }
+}
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuSimple.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuSimple.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/TestPanelMenuSimple.java 2011-02-07
14:21:04 UTC (rev 21509)
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richPanelMenu;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+
+import org.jboss.test.selenium.css.CssProperty;
+import org.richfaces.PanelMenuMode;
+import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestPanelMenuSimple extends AbstractPanelMenuTest {
+
+ @Inject
+ @Use(empty = true)
+ Boolean expandSingle;
+
+ @Test
+ public void testDisabled() {
+ attributes.setGroupMode(PanelMenuMode.client);
+ attributes.setDisabled(false);
+
+ assertEquals(selenium.getCount(menu.getAnyDisabledGroup()), 2);
+ assertEquals(selenium.getCount(menu.getAnyDisabledItem()), 3);
+
+ attributes.setDisabled(true);
+
+ assertEquals(selenium.getCount(menu.getAnyDisabledGroup()), 5);
+ assertEquals(selenium.getCount(menu.getAnyDisabledItem()), 18);
+ }
+
+ @Test
+ @Use(field = "expandSingle", booleans = { true, false })
+ public void testExpandSingle() {
+ attributes.setExpandSingle(expandSingle);
+
+ group2.toggle();
+ assertEquals(getExpandedGroupsCount(), expanded(1));
+
+ group1.toggle();
+ assertEquals(getExpandedGroupsCount(), expanded(2));
+ }
+
+ @Test
+ public void testGroupClass() {
+ attributes.setGroupMode(PanelMenuMode.client);
+ super.testStyleClass(group24, "groupClass");
+ }
+
+ @Test
+ public void testGroupDisabledClass() {
+ attributes.setGroupMode(PanelMenuMode.client);
+ super.testStyleClass(group26, "groupDisabledClass");
+ }
+
+ @Test
+ public void testItemClass() {
+ attributes.setGroupMode(PanelMenuMode.client);
+ super.testStyleClass(item22, "itemClass");
+ }
+
+ @Test
+ public void testItemDisabledClass() {
+ attributes.setGroupMode(PanelMenuMode.client);
+ super.testStyleClass(item25, "itemDisabledClass");
+ }
+
+ @Test
+ public void testRendered() {
+ attributes.setRendered(false);
+ assertFalse(selenium.isElementPresent(menu));
+ attributes.setRendered(true);
+ assertTrue(selenium.isElementPresent(menu));
+ }
+
+ @Test
+ public void testStyle() {
+ super.testStyle(menu, "style");
+ }
+
+ @Test
+ public void testStyleClass() {
+ super.testStyleClass(menu, "styleClass");
+ }
+
+ @Test
+ public void testTopGroupClass() {
+ super.testStyleClass(group1, "topGroupClass");
+ }
+
+ @Test
+ public void testTopItemClass() {
+ super.testStyleClass(item3, "topItemClass");
+ }
+
+ @Test
+ public void testWidth() {
+ attributes.setWidth("300px");
+ assertEquals(selenium.getStyle(menu, CssProperty.WIDTH), "300px");
+ }
+
+ private int getExpandedGroupsCount() {
+ return selenium.getCount(menu.getAnyExpandedGroup());
+ }
+
+ private int expanded(int expanded) {
+ return (expandSingle && expanded >= 1) ? 1 : expanded;
+ }
+}