JBoss Rich Faces SVN: r21513 - branches/enterprise/3.3.X/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/css.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2011-02-07 09:34:58 -0500 (Mon, 07 Feb 2011)
New Revision: 21513
Modified:
branches/enterprise/3.3.X/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/css/inplaceselect.xcss
Log:
http://jira.jboss.org/browse/RF-10427
Modified: branches/enterprise/3.3.X/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/css/inplaceselect.xcss
===================================================================
--- branches/enterprise/3.3.X/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/css/inplaceselect.xcss 2011-02-07 14:27:15 UTC (rev 21512)
+++ branches/enterprise/3.3.X/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/css/inplaceselect.xcss 2011-02-07 14:34:58 UTC (rev 21513)
@@ -204,6 +204,12 @@
<u:style name="background-color" skin="editBackgroundColor"/>
<u:style name="border-color" skin="panelBorderColor"/>
</u:selector>
+
+ <u:selector name=".rich-inplace-select-font">
+ <u:style name="color" skin="generalTextColor"/>
+ <u:style name="font-size" skin="generalSizeFont"/>
+ <u:style name="font-family" skin="generalFamilyFont"/>
+ </u:selector>
<u:selector name=".rich-inplace-select-control">
<u:style name="background-image">
@@ -246,4 +252,4 @@
-</f:template>
\ No newline at end of file
+</f:template>
15 years, 2 months
JBoss Rich Faces SVN: r21512 - trunk/ui/input/ui/src/test/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2011-02-07 09:27:15 -0500 (Mon, 07 Feb 2011)
New Revision: 21512
Modified:
trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/AutocompleteRendererTest.java
Log:
RF-10164: test is fixed
Modified: trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/AutocompleteRendererTest.java
===================================================================
--- trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/AutocompleteRendererTest.java 2011-02-07 14:25:08 UTC (rev 21511)
+++ trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/AutocompleteRendererTest.java 2011-02-07 14:27:15 UTC (rev 21512)
@@ -77,10 +77,10 @@
Assert.assertNotNull(input);
input.type("be");
- //try 5 times to wait .5 second each for filling the page.
+ //try 5 times to wait 5 second each for filling the page.
for (int i = 0; i < 5; i++) {
synchronized (page) {
- page.wait(500);
+ page.wait(5000);
}
}
15 years, 2 months
JBoss Rich Faces SVN: r21511 - branches/4.0.0.M6/ui/input/ui/src/test/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2011-02-07 09:25:08 -0500 (Mon, 07 Feb 2011)
New Revision: 21511
Modified:
branches/4.0.0.M6/ui/input/ui/src/test/java/org/richfaces/renderkit/AutocompleteRendererTest.java
Log:
RF-10164: test is fixed
Modified: branches/4.0.0.M6/ui/input/ui/src/test/java/org/richfaces/renderkit/AutocompleteRendererTest.java
===================================================================
--- branches/4.0.0.M6/ui/input/ui/src/test/java/org/richfaces/renderkit/AutocompleteRendererTest.java 2011-02-07 14:21:43 UTC (rev 21510)
+++ branches/4.0.0.M6/ui/input/ui/src/test/java/org/richfaces/renderkit/AutocompleteRendererTest.java 2011-02-07 14:25:08 UTC (rev 21511)
@@ -1,13 +1,8 @@
package org.richfaces.renderkit;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.StringReader;
-import java.net.URISyntaxException;
-import java.util.List;
-
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlInput;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
import org.custommonkey.xmlunit.Diff;
import org.custommonkey.xmlunit.Difference;
import org.custommonkey.xmlunit.DifferenceListener;
@@ -18,9 +13,9 @@
import org.richfaces.renderkit.html.RendererTestBase;
import org.xml.sax.SAXException;
-import com.gargoylesoftware.htmlunit.html.HtmlElement;
-import com.gargoylesoftware.htmlunit.html.HtmlInput;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import java.io.*;
+import java.net.URISyntaxException;
+import java.util.List;
public class AutocompleteRendererTest extends RendererTestBase {
@@ -55,10 +50,10 @@
Assert.assertNotNull(input);
input.type("al");
- //try 7 times to wait .5 second each for filling the page.
+ //try 7 times to wait 5 second each for filling the page.
for (int i = 0; i < 7; i++) {
synchronized (page) {
- page.wait(500);
+ page.wait(5000);
}
}
@@ -82,10 +77,10 @@
Assert.assertNotNull(input);
input.type("be");
- //try 5 times to wait .5 second each for filling the page.
+ //try 5 times to wait 5 second each for filling the page.
for (int i = 0; i < 5; i++) {
synchronized (page) {
- page.wait(500);
+ page.wait(5000);
}
}
15 years, 2 months
JBoss Rich Faces SVN: r21510 - branches/4.0.0.M6/dist.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2011-02-07 09:21:43 -0500 (Mon, 07 Feb 2011)
New Revision: 21510
Modified:
branches/4.0.0.M6/dist/readme-ui.txt
Log:
Updated readme for M6 release
Modified: branches/4.0.0.M6/dist/readme-ui.txt
===================================================================
--- branches/4.0.0.M6/dist/readme-ui.txt 2011-02-07 14:21:04 UTC (rev 21509)
+++ branches/4.0.0.M6/dist/readme-ui.txt 2011-02-07 14:21:43 UTC (rev 21510)
@@ -1,6 +1,6 @@
RichFaces - Ajax enabled JSF 2.0 component library
=========================================================
-Version 4.0.0.M5
+Version 4.0.0.M6
This software is distributed under the terms of the FSF Lesser Gnu Public License (see lgpl.txt).
@@ -13,7 +13,7 @@
1.3) richfaces-components-api.jar
1.4) richfaces-components-ui.jar
1.5) sac-1.3, cssparser-0.9.5 - required for components CSS work
- 1.6) google-guava-r06 - core runtime dependency.
+ 1.6) google-guava-r08 - core runtime dependency.
1.7) annotations.jar from org.richfaces.cdk
- It's optional and only needs to be added if RichFaces components will be
created/accessed dynamically in your apps actions/listeners.
@@ -29,7 +29,7 @@
Use xmlns:a4j="http://richfaces.org/a4j" namespace for core components
Use xmlns:rich="http://richfaces.org/rich" namespace for rich components
-4) Add one of the available RichFaces 4.0.M5 components to your page and try it!
+4) Add one of the available RichFaces 4.0.M6 components to your page and try it!
4.1) Take a look at the RichFaces examples for assistance with usage.
Available Components/Behaviors/Tags/Functions
@@ -100,6 +100,7 @@
rich:progressBar
rich:tooltip
rich:message
+rich:messages
---------------------------------
Menus:
15 years, 2 months
JBoss Rich Faces SVN: r21509 - in modules/tests/metamer/trunk: application/src/main/webapp/components/richPanelMenu and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
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;
+ }
+}
15 years, 2 months
JBoss Rich Faces SVN: r21508 - in modules/tests/metamer/trunk: application/src/main/resources/org/richfaces/tests/metamer/bean and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-07 09:19:37 -0500 (Mon, 07 Feb 2011)
New Revision: 21508
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/AbstractPanelMenuGroupTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupDOMEventHandlers.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupMode.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupSimple.java
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.java
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.properties
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuGroup/simple.xhtml
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/richPanelMenuGroup/PanelMenuGroupAttributes.java
Log:
rich:panelMenuGroup - automated (RFPL-950)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.java 2011-02-07 14:18:06 UTC (rev 21507)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.java 2011-02-07 14:19:37 UTC (rev 21508)
@@ -22,6 +22,8 @@
package org.richfaces.tests.metamer.bean;
import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
@@ -45,6 +47,7 @@
private static final long serialVersionUID = -1L;
private static Logger logger;
private Attributes attributes;
+ private Map<String, Boolean> expanded = new HashMap<String, Boolean>();
/**
* Initializes the managed bean.
@@ -66,6 +69,11 @@
attributes.remove("changeExpandListener");
attributes.remove("action");
attributes.remove("actionListener");
+
+ // expanded needs to be set separately
+ attributes.remove("expanded");
+ expanded.put("group2", true);
+ expanded.put("group23", true);
}
public Attributes getAttributes() {
@@ -75,6 +83,10 @@
public void setAttributes(Attributes attributes) {
this.attributes = attributes;
}
+
+ public Map<String, Boolean> getExpanded() {
+ return expanded;
+ }
public void changeExpandListener(Object event) {
RichBean.logToPage("* group expanded");
Modified: modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.properties
===================================================================
--- modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.properties 2011-02-07 14:18:06 UTC (rev 21507)
+++ modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.properties 2011-02-07 14:19:37 UTC (rev 21508)
@@ -2,57 +2,57 @@
attr.mode.ajax=ajax
attr.mode.server=server
attr.mode.null=
-attr.leftIconCollapsed.grid=grid
-attr.leftIconCollapsed.disc=disc
-attr.leftIconCollapsed.chevronUp=chevronUp
-attr.leftIconCollapsed.chevronDown=chevronDown
-attr.leftIconCollapsed.triangle=triangle
-attr.leftIconCollapsed.triangleUp=triangleUp
-attr.leftIconCollapsed.triangleDown=triangleDown
-attr.leftIconCollapsed.customURL=/resources/images/loading.gif
-attr.leftIconCollapsed.null=
-attr.leftIconExpanded.grid=grid
-attr.leftIconExpanded.disc=disc
-attr.leftIconExpanded.chevronUp=chevronUp
-attr.leftIconExpanded.chevronDown=chevronDown
-attr.leftIconExpanded.triangle=triangle
-attr.leftIconExpanded.triangleUp=triangleUp
-attr.leftIconExpanded.triangleDown=triangleDown
-attr.leftIconExpanded.customURL=/resources/images/loading.gif
-attr.leftIconExpanded.null=
-attr.leftIconDisabled.grid=grid
-attr.leftIconDisabled.disc=disc
-attr.leftIconDisabled.chevronUp=chevronUp
-attr.leftIconDisabled.chevronDown=chevronDown
-attr.leftIconDisabled.triangle=triangle
-attr.leftIconDisabled.triangleUp=triangleUp
-attr.leftIconDisabled.triangleDown=triangleDown
-attr.leftIconDisabled.customURL=/resources/images/loading.gif
-attr.leftIconDisabled.null=
-attr.rightIconCollapsed.grid=grid
-attr.rightIconCollapsed.disc=disc
-attr.rightIconCollapsed.chevronUp=chevronUp
-attr.rightIconCollapsed.chevronDown=chevronDown
-attr.rightIconCollapsed.triangle=triangle
-attr.rightIconCollapsed.triangleUp=triangleUp
-attr.rightIconCollapsed.triangleDown=triangleDown
-attr.rightIconCollapsed.customURL=/resources/images/loading.gif
-attr.rightIconCollapsed.null=
-attr.rightIconExpanded.grid=grid
-attr.rightIconExpanded.disc=disc
-attr.rightIconExpanded.chevronUp=chevronUp
-attr.rightIconExpanded.chevronDown=chevronDown
-attr.rightIconExpanded.triangle=triangle
-attr.rightIconExpanded.triangleUp=triangleUp
-attr.rightIconExpanded.triangleDown=triangleDown
-attr.rightIconExpanded.customURL=/resources/images/loading.gif
-attr.rightIconExpanded.null=
-attr.rightIconDisabled.grid=grid
-attr.rightIconDisabled.disc=disc
-attr.rightIconDisabled.chevronUp=chevronUp
-attr.rightIconDisabled.chevronDown=chevronDown
-attr.rightIconDisabled.triangle=triangle
-attr.rightIconDisabled.triangleUp=triangleUp
-attr.rightIconDisabled.triangleDown=triangleDown
-attr.rightIconDisabled.customURL=/resources/images/loading.gif
-attr.rightIconDisabled.null=
\ No newline at end of file
+attr.leftCollapsedIcon.grid=grid
+attr.leftCollapsedIcon.disc=disc
+attr.leftCollapsedIcon.chevronUp=chevronUp
+attr.leftCollapsedIcon.chevronDown=chevronDown
+attr.leftCollapsedIcon.triangle=triangle
+attr.leftCollapsedIcon.triangleUp=triangleUp
+attr.leftCollapsedIcon.triangleDown=triangleDown
+attr.leftCollapsedIcon.customURL=/resources/images/loading.gif
+attr.leftCollapsedIcon.null=
+attr.leftExpandedIcon.grid=grid
+attr.leftExpandedIcon.disc=disc
+attr.leftExpandedIcon.chevronUp=chevronUp
+attr.leftExpandedIcon.chevronDown=chevronDown
+attr.leftExpandedIcon.triangle=triangle
+attr.leftExpandedIcon.triangleUp=triangleUp
+attr.leftExpandedIcon.triangleDown=triangleDown
+attr.leftExpandedIcon.customURL=/resources/images/loading.gif
+attr.leftExpandedIcon.null=
+attr.leftDisabledIcon.grid=grid
+attr.leftDisabledIcon.disc=disc
+attr.leftDisabledIcon.chevronUp=chevronUp
+attr.leftDisabledIcon.chevronDown=chevronDown
+attr.leftDisabledIcon.triangle=triangle
+attr.leftDisabledIcon.triangleUp=triangleUp
+attr.leftDisabledIcon.triangleDown=triangleDown
+attr.leftDisabledIcon.customURL=/resources/images/loading.gif
+attr.leftDisabledIcon.null=
+attr.rightCollapsedIcon.grid=grid
+attr.rightCollapsedIcon.disc=disc
+attr.rightCollapsedIcon.chevronUp=chevronUp
+attr.rightCollapsedIcon.chevronDown=chevronDown
+attr.rightCollapsedIcon.triangle=triangle
+attr.rightCollapsedIcon.triangleUp=triangleUp
+attr.rightCollapsedIcon.triangleDown=triangleDown
+attr.rightCollapsedIcon.customURL=/resources/images/loading.gif
+attr.rightCollapsedIcon.null=
+attr.rightExpandedIcon.grid=grid
+attr.rightExpandedIcon.disc=disc
+attr.rightExpandedIcon.chevronUp=chevronUp
+attr.rightExpandedIcon.chevronDown=chevronDown
+attr.rightExpandedIcon.triangle=triangle
+attr.rightExpandedIcon.triangleUp=triangleUp
+attr.rightExpandedIcon.triangleDown=triangleDown
+attr.rightExpandedIcon.customURL=/resources/images/loading.gif
+attr.rightExpandedIcon.null=
+attr.rightDisabledIcon.grid=grid
+attr.rightDisabledIcon.disc=disc
+attr.rightDisabledIcon.chevronUp=chevronUp
+attr.rightDisabledIcon.chevronDown=chevronDown
+attr.rightDisabledIcon.triangle=triangle
+attr.rightDisabledIcon.triangleUp=triangleUp
+attr.rightDisabledIcon.triangleDown=triangleDown
+attr.rightDisabledIcon.customURL=/resources/images/loading.gif
+attr.rightDisabledIcon.null=
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuGroup/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuGroup/simple.xhtml 2011-02-07 14:18:06 UTC (rev 21507)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuGroup/simple.xhtml 2011-02-07 14:19:37 UTC (rev 21508)
@@ -40,7 +40,7 @@
<ui:define name="component">
- <rich:panelMenu id="panelMenu" style="width: 250px;"
+ <rich:panelMenu id="panelMenu" style="width: 300px;"
itemChangeListener="#{richPanelMenuBean.itemChangeListener}">
<rich:panelMenuGroup id="group1" name="group1" label="Group 1">
@@ -53,6 +53,7 @@
action="#{richBean.dummyAction}"
actionListener="#{richBean.dummyActionListener}"
changeExpandListener="#{richPanelMenuGroupBean.changeExpandListener}"
+ expanded="#{richPanelMenuGroupBean.expanded['group2']}"
bubbleSelection="#{richPanelMenuGroupBean.attributes['bubbleSelection'].value}"
bypassUpdates="#{richPanelMenuGroupBean.attributes['bypassUpdates'].value}"
@@ -63,17 +64,14 @@
execute="#{richPanelMenuGroupBean.attributes['execute'].value}"
expandEvent="#{richPanelMenuGroupBean.attributes['expandEvent'].value}"
expandSingle="#{richPanelMenuGroupBean.attributes['expandSingle'].value}"
- expanded="#{richPanelMenuGroupBean.attributes['expanded'].value}"
hoverClass="#{richPanelMenuGroupBean.attributes['hoverClass'].value}"
iconLeftClass="#{richPanelMenuGroupBean.attributes['iconLeftClass'].value}"
- leftIcon="#{richPanelMenuGroupBean.attributes['leftIcon'].value}"
- leftIconCollapsed="#{richPanelMenuGroupBean.attributes['leftIconCollapsed'].value}"
- leftIconDisabled="#{richPanelMenuGroupBean.attributes['leftIconDisabled'].value}"
- leftIconExpanded="#{richPanelMenuGroupBean.attributes['leftIconExpanded'].value}"
- rightIcon="#{richPanelMenuGroupBean.attributes['rightIcon'].value}"
- rightIconCollapsed="#{richPanelMenuGroupBean.attributes['rightIconCollapsed'].value}"
- rightIconDisabled="#{richPanelMenuGroupBean.attributes['rightIconDisabled'].value}"
- rightIconExpanded="#{richPanelMenuGroupBean.attributes['rightIconExpanded'].value}"
+ leftCollapsedIcon="#{richPanelMenuGroupBean.attributes['leftCollapsedIcon'].value}"
+ leftDisabledIcon="#{richPanelMenuGroupBean.attributes['leftDisabledIcon'].value}"
+ leftExpandedIcon="#{richPanelMenuGroupBean.attributes['leftExpandedIcon'].value}"
+ rightCollapsedIcon="#{richPanelMenuGroupBean.attributes['rightCollapsedIcon'].value}"
+ rightDisabledIcon="#{richPanelMenuGroupBean.attributes['rightDisabledIcon'].value}"
+ rightExpandedIcon="#{richPanelMenuGroupBean.attributes['rightExpandedIcon'].value}"
immediate="#{richPanelMenuGroupBean.attributes['immediate'].value}"
limitRender="#{richPanelMenuGroupBean.attributes['limitRender'].value}"
mode="#{richPanelMenuGroupBean.attributes['mode'].value}"
@@ -104,7 +102,64 @@
>
<rich:panelMenuItem id="item21" name="item21" label="Item 2.1"/>
<rich:panelMenuItem id="item22" name="item22" label="Item 2.2" />
- <rich:panelMenuItem id="item23" name="item23" label="Item 2.3"/>
+
+ <rich:panelMenuGroup id="group23" name="group23" label="Group 2.3 (influenced by attributes)"
+ action="#{richBean.dummyAction}"
+ actionListener="#{richBean.dummyActionListener}"
+ changeExpandListener="#{richPanelMenuGroupBean.changeExpandListener}"
+ expanded="#{richPanelMenuGroupBean.expanded['group23']}"
+
+ bubbleSelection="#{richPanelMenuGroupBean.attributes['bubbleSelection'].value}"
+ bypassUpdates="#{richPanelMenuGroupBean.attributes['bypassUpdates'].value}"
+ collapseEvent="#{richPanelMenuGroupBean.attributes['collapseEvent'].value}"
+ data="#{richPanelMenuGroupBean.attributes['data'].value}"
+ disabled="#{richPanelMenuGroupBean.attributes['disabled'].value}"
+ disabledClass="#{richPanelMenuGroupBean.attributes['disabledClass'].value}"
+ execute="#{richPanelMenuGroupBean.attributes['execute'].value}"
+ expandEvent="#{richPanelMenuGroupBean.attributes['expandEvent'].value}"
+ expandSingle="#{richPanelMenuGroupBean.attributes['expandSingle'].value}"
+ hoverClass="#{richPanelMenuGroupBean.attributes['hoverClass'].value}"
+ iconLeftClass="#{richPanelMenuGroupBean.attributes['iconLeftClass'].value}"
+ leftCollapsedIcon="#{richPanelMenuGroupBean.attributes['leftCollapsedIcon'].value}"
+ leftDisabledIcon="#{richPanelMenuGroupBean.attributes['leftDisabledIcon'].value}"
+ leftExpandedIcon="#{richPanelMenuGroupBean.attributes['leftExpandedIcon'].value}"
+ rightCollapsedIcon="#{richPanelMenuGroupBean.attributes['rightCollapsedIcon'].value}"
+ rightDisabledIcon="#{richPanelMenuGroupBean.attributes['rightDisabledIcon'].value}"
+ rightExpandedIcon="#{richPanelMenuGroupBean.attributes['rightExpandedIcon'].value}"
+ immediate="#{richPanelMenuGroupBean.attributes['immediate'].value}"
+ limitRender="#{richPanelMenuGroupBean.attributes['limitRender'].value}"
+ mode="#{richPanelMenuGroupBean.attributes['mode'].value}"
+ onbeforecollapse="#{richPanelMenuGroupBean.attributes['onbeforecollapse'].value}"
+ onbeforedomupdate="#{richPanelMenuGroupBean.attributes['onbeforedomupdate'].value}"
+ onbeforeexpand="#{richPanelMenuGroupBean.attributes['onbeforeexpand'].value}"
+ onbeforeselect="#{richPanelMenuGroupBean.attributes['onbeforeselect'].value}"
+ onbeforeswitch="#{richPanelMenuGroupBean.attributes['onbeforeswitch'].value}"
+ onclick="#{richPanelMenuGroupBean.attributes['onclick'].value}"
+ oncollapse="#{richPanelMenuGroupBean.attributes['oncollapse'].value}"
+ oncomplete="#{richPanelMenuGroupBean.attributes['oncomplete'].value}"
+ ondblclick="#{richPanelMenuGroupBean.attributes['ondblclick'].value}"
+ onexpand="#{richPanelMenuGroupBean.attributes['onexpand'].value}"
+ onmousedown="#{richPanelMenuGroupBean.attributes['onmousedown'].value}"
+ onmousemove="#{richPanelMenuGroupBean.attributes['onmousemove'].value}"
+ onmouseout="#{richPanelMenuGroupBean.attributes['onmouseout'].value}"
+ onmouseover="#{richPanelMenuGroupBean.attributes['onmouseover'].value}"
+ onmouseup="#{richPanelMenuGroupBean.attributes['onmouseup'].value}"
+ onselect="#{richPanelMenuGroupBean.attributes['onselect'].value}"
+ onswitch="#{richPanelMenuGroupBean.attributes['onswitch'].value}"
+ onunselect="#{richPanelMenuGroupBean.attributes['onunselect'].value}"
+ render="#{richPanelMenuGroupBean.attributes['render'].value}"
+ rendered="#{richPanelMenuGroupBean.attributes['rendered'].value}"
+ selectable="#{richPanelMenuGroupBean.attributes['selectable'].value}"
+ status="#{richPanelMenuGroupBean.attributes['status'].value}"
+ style="#{richPanelMenuGroupBean.attributes['style'].value}"
+ styleClass="#{richPanelMenuGroupBean.attributes['styleClass'].value}"
+ >
+ <rich:panelMenuItem id="item231" name="item231" label="Item 2.3.1"/>
+ <rich:panelMenuItem id="item232" name="item232" label="Item 2.3.2"/>
+ <rich:panelMenuItem id="item233" name="item233" label="Item 2.3.3"/>
+ </rich:panelMenuGroup>
+
+ <rich:panelMenuItem id="item24" name="item24" label="Item 2.4"/>
</rich:panelMenuGroup>
<rich:panelMenuGroup id="group3" name="group3" label="Group 3">
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:18:06 UTC (rev 21507)
+++ 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)
@@ -34,6 +34,7 @@
import static org.jboss.test.selenium.locator.reference.ReferencedLocator.ref;
import java.net.URL;
+import java.util.Arrays;
import java.util.Locale;
import javax.faces.event.PhaseId;
@@ -260,15 +261,15 @@
}
selenium.getEval(new JavaScript("window.metamerEvents = \"\";"));
-
- retrieveRequestTime.initializeValue();
}
public void testRequestEventsAfter(String... events) {
- waitGui.failWith("Page was not updated").waitForChange(retrieveRequestTime);
-
String[] actualEvents = selenium.getEval(new JavaScript("window.metamerEvents")).split(" ");
- assertEquals(actualEvents, events, "The events don't came in right order");
+ assertEquals(
+ actualEvents,
+ events,
+ format("The events ({0}) don't came in right order ({1})", Arrays.deepToString(actualEvents),
+ Arrays.deepToString(events)));
}
/**
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:18:06 UTC (rev 21507)
+++ 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)
@@ -2,6 +2,7 @@
import static org.jboss.test.selenium.locator.Attribute.CLASS;
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;
@@ -10,6 +11,7 @@
import org.jboss.test.selenium.framework.AjaxSelenium;
import org.jboss.test.selenium.framework.AjaxSeleniumProxy;
import org.jboss.test.selenium.locator.AttributeLocator;
+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.utils.text.SimplifiedFormat;
@@ -44,10 +46,18 @@
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)));
+ }
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)));
+ }
public Item getAnyTopItem() {
return new Item(topItems.getReferenced());
@@ -58,10 +68,12 @@
}
public class Group extends AbstractModel<JQueryLocator> implements Model {
- ReferencedLocator<JQueryLocator> label = ref(root, "> table > tbody > tr > td[class*=rf-][class*=-gr-lbl]");
- ReferencedLocator<JQueryLocator> leftIcon = ref(root, "> table > tbody > tr > td[class*=rf-][class*=-gr-ico]");
- ReferencedLocator<JQueryLocator> rightIcon = ref(root,
- "div[class*=rf-][class*=-gr-hdr] > table > tbody > tr > td[class*=rf-][class*=-itm-gr-ico]");
+ ReferencedLocator<JQueryLocator> header = ref(root, "> div[class*=rf-pm-][class*=-gr-hdr]");
+ ReferencedLocator<JQueryLocator> label = ref(header, "> table > tbody > tr > td[class*=rf-pm-][class*=-gr-lbl]");
+ ReferencedLocator<JQueryLocator> leftIcon = ref(header,
+ "> table > tbody > tr > td[class*=rf-pm-][class*=-gr-ico]");
+ ReferencedLocator<JQueryLocator> rightIcon = ref(header,
+ "> table > tbody > tr > td[class*=rf-pm-][class*=-gr-exp-ico]");
private ReferencedLocator<JQueryLocator> content = ref(root, "> div[class*=rf-pm-][class*=gr-cnt]");
private ReferencedLocator<JQueryLocator> items = ref(content, "> .rf-pm-itm");
@@ -86,7 +98,7 @@
public Item getItem(int index) {
return new Item(items.getNthOccurence(index));
}
-
+
public Item getItemContains(String string) {
return new Item(JQuerySelectors.append(items, SimplifiedFormat.format(":contains('{0}')", string)));
}
@@ -98,6 +110,10 @@
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)));
+ }
public Item getAnyItem() {
return new Item(items.getReferenced());
@@ -108,9 +124,21 @@
}
public boolean isSelected() {
- return selenium.getAttribute(this.getAttribute(CLASS)).contains("-sel");
+ return selenium.getAttribute(header.getAttribute(CLASS)).contains("-sel");
}
+ public boolean isHovered() {
+ return selenium.getAttribute(this.getAttribute(CLASS)).contains("-hov");
+ }
+
+ public boolean isDisabled() {
+ return selenium.getAttribute(this.getAttribute(CLASS)).contains("-dis");
+ }
+
+ public boolean isVisible() {
+ return selenium.isElementPresent(this) && selenium.isVisible(this);
+ }
+
public Icon getLeftIcon() {
return new Icon(leftIcon.getReferenced());
}
@@ -122,6 +150,22 @@
public Label getLabel() {
return new Label(label.getReferenced());
}
+
+ public void toggle() {
+ selenium.click(label);
+ }
+
+ public class Icon extends PanelMenu.Icon {
+
+ public Icon(JQueryLocator root) {
+ super(root);
+ }
+
+ @Override
+ public ElementLocator<JQueryLocator> getIcon() {
+ return this.getChild(jq("div:visible[class*=rf-pm-ico-]"));
+ }
+ }
}
public class Item extends AbstractModel<JQueryLocator> implements Model {
@@ -145,7 +189,7 @@
public boolean isDisabled() {
return selenium.getAttribute(this.getAttribute(CLASS)).contains("-dis");
}
-
+
public boolean isVisible() {
return selenium.isElementPresent(this) && selenium.isDisplayed(this);
}
@@ -169,9 +213,21 @@
public void hover() {
selenium.mouseOver(this);
}
+
+ public class Icon extends PanelMenu.Icon {
+
+ public Icon(JQueryLocator root) {
+ super(root);
+ }
+
+ @Override
+ public ElementLocator<JQueryLocator> getIcon() {
+ return this;
+ }
+ }
}
- public class Icon extends AbstractModel<JQueryLocator> {
+ public abstract class Icon extends AbstractModel<JQueryLocator> {
public Icon(JQueryLocator root) {
super(root);
@@ -180,12 +236,14 @@
ReferencedLocator<JQueryLocator> img = ref(root, "> img");
AttributeLocator<?> imgSrc = img.getAttribute(SRC);
+ public abstract ElementLocator<JQueryLocator> getIcon();
+
public boolean isTransparent() {
- return selenium.getAttribute(this.getAttribute(CLASS)).contains("-transparent");
+ return selenium.getAttribute(getIcon().getAttribute(CLASS)).contains("-transparent");
}
public boolean containsClass(String styleClass) {
- return selenium.belongsClass(this, styleClass);
+ return selenium.getAttribute(getIcon().getAttribute(CLASS)).contains(styleClass);
}
public boolean isCustomURL() {
@@ -195,7 +253,6 @@
public String getCustomURL() {
return selenium.getAttribute(imgSrc);
}
-
}
public class Label extends AbstractModel<JQueryLocator> {
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/AbstractPanelMenuGroupTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/AbstractPanelMenuGroupTest.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/AbstractPanelMenuGroupTest.java 2011-02-07 14:19:37 UTC (rev 21508)
@@ -0,0 +1,45 @@
+package org.richfaces.tests.metamer.ftest.richPanelMenuGroup;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+
+import java.net.URL;
+
+import org.jboss.test.selenium.GuardRequest;
+import org.jboss.test.selenium.request.RequestType;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.model.PanelMenu;
+
+public abstract class AbstractPanelMenuGroupTest extends AbstractMetamerTest {
+
+ PanelMenuGroupAttributes attributes = new PanelMenuGroupAttributes();
+ PanelMenu menu = new PanelMenu(pjq("div.rf-pm[id$=panelMenu]"));
+ PanelMenu.Group topGroup = menu.getGroupContains("Group 2");
+ PanelMenu.Group subGroup = topGroup.getGroupContains("Group 2.3");
+ PanelMenu.Icon leftIcon = topGroup.getLeftIcon();
+ PanelMenu.Icon rightIcon = topGroup.getRightIcon();
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richPanelMenuGroup/simple.xhtml");
+ }
+
+ void toggleGroup() {
+ new GuardRequest(getRequestTypeForMode()) {
+ @Override
+ public void command() {
+ topGroup.toggle();
+ }
+ }.waitRequest();
+ }
+
+ RequestType getRequestTypeForMode() {
+ switch (attributes.getMode()) {
+ case ajax:
+ return RequestType.XHR;
+ case server:
+ return RequestType.HTTP;
+ default:
+ return RequestType.NONE;
+ }
+ }
+}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/PanelMenuGroupAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/PanelMenuGroupAttributes.java 2011-02-07 14:18:06 UTC (rev 21507)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/PanelMenuGroupAttributes.java 2011-02-07 14:19:37 UTC (rev 21508)
@@ -77,13 +77,17 @@
setProperty("leftExpandedIcon", leftExpandedIcon);
}
- public void setLimitRender(String limitRender) {
+ public void setLimitRender(Boolean limitRender) {
setProperty("limitRender", limitRender);
}
public void setMode(PanelMenuMode mode) {
setProperty("mode", mode);
}
+
+ public PanelMenuMode getMode() {
+ return PanelMenuMode.valueOf(getProperty("mode"));
+ }
public void setRender(String render) {
setProperty("render", render);
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupClientSideHandlers.java 2011-02-07 14:19:37 UTC (rev 21508)
@@ -0,0 +1,128 @@
+/*******************************************************************************
+ * 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.richPanelMenuGroup;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.richfaces.PanelMenuMode.ajax;
+import static org.richfaces.PanelMenuMode.client;
+import static org.richfaces.PanelMenuMode.server;
+
+import java.net.URL;
+
+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 TestPanelMenuGroupClientSideHandlers extends AbstractPanelMenuGroupTest {
+
+ @Inject
+ @Use(empty = true)
+ String event;
+ String[] ajaxExpansionEvents = new String[] { "begin", "beforedomupdate", "beforeexpand", "beforeselect",
+ "beforeswitch", "switch", "expand", "select", "complete" };
+ String[] ajaxCollapsionEvents = new String[] { "begin", "beforedomupdate", "beforecollapse", "beforeswitch",
+ "switch", "collapse", "complete" };
+ String[] clientExpansionEvents = new String[] { "beforeexpand", "beforeselect", "beforeswitch", "switch", "expand" };
+ String[] clientCollapsionEvents = new String[] { "beforecollapse", "beforeswitch", "switch", "collapse" };
+ String[] serverExpansionEvents = new String[] { "switch", "expand" };
+ String[] serverCollapsionEvents = new String[] { "switch", "collapse" };
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richPanelMenuGroup/simple.xhtml");
+ }
+
+ @Test
+ @Use(field = "event", value = "ajaxCollapsionEvents")
+ public void testClientSideCollapsionEvent() {
+ attributes.setMode(ajax);
+ toggleGroup();
+ super.testRequestEventsBefore(event);
+ toggleGroup();
+ super.testRequestEventsAfter(event);
+ }
+
+ @Test
+ @Use(field = "event", value = "ajaxExpansionEvents")
+ public void testClientSideExpansionEvent() {
+ attributes.setMode(ajax);
+ super.testRequestEventsBefore(event);
+ toggleGroup();
+ super.testRequestEventsAfter(event);
+ }
+
+ @Test
+ public void testClientSideExpansionEventsOrderClient() {
+ attributes.setMode(client);
+ super.testRequestEventsBefore(serverExpansionEvents);
+ toggleGroup();
+ super.testRequestEventsAfter(serverExpansionEvents);
+ }
+
+ @Test
+ public void testClientSideCollapsionEventsOrderClient() {
+ attributes.setMode(client);
+ toggleGroup();
+ super.testRequestEventsBefore(clientCollapsionEvents);
+ toggleGroup();
+ super.testRequestEventsAfter(clientCollapsionEvents);
+ }
+
+ @Test
+ public void testClientSideExpansionEventsOrderAjax() {
+ attributes.setMode(ajax);
+ super.testRequestEventsBefore(ajaxExpansionEvents);
+ toggleGroup();
+ super.testRequestEventsAfter(ajaxExpansionEvents);
+ }
+
+ @Test
+ public void testClientSideCollapsionEventsOrderAjax() {
+ attributes.setMode(ajax);
+ toggleGroup();
+ super.testRequestEventsBefore(ajaxCollapsionEvents);
+ toggleGroup();
+ super.testRequestEventsAfter(ajaxCollapsionEvents);
+ }
+
+ @Test
+ public void testClientSideExpansionEventsOrderServer() {
+ attributes.setMode(server);
+ toggleGroup();
+ super.testRequestEventsBefore(serverExpansionEvents);
+ toggleGroup();
+ super.testRequestEventsAfter(serverExpansionEvents);
+ }
+
+ @Test
+ public void testClientSideCollapsionEventsOrderServer() {
+ attributes.setMode(server);
+ toggleGroup();
+ super.testRequestEventsBefore(serverCollapsionEvents);
+ toggleGroup();
+ super.testRequestEventsAfter(serverCollapsionEvents);
+ }
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupDOMEventHandlers.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupDOMEventHandlers.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupDOMEventHandlers.java 2011-02-07 14:19:37 UTC (rev 21508)
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * 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.richPanelMenuGroup;
+
+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 org.jboss.test.selenium.dom.Event;
+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 TestPanelMenuGroupDOMEventHandlers extends AbstractPanelMenuGroupTest {
+
+ @Inject
+ @Use("events")
+ Event event;
+ Event[] events = new Event[] { CLICK, DBLCLICK, MOUSEDOWN, MOUSEMOVE, MOUSEOUT, MOUSEOVER, MOUSEUP };
+
+ @Test
+ public void testDOMEventHandler() {
+ attributes.setMode(PanelMenuMode.client);
+ super.testFireEvent(event, topGroup);
+ }
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupMode.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupMode.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupMode.java 2011-02-07 14:19:37 UTC (rev 21508)
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * 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.richPanelMenuGroup;
+
+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 java.util.LinkedList;
+
+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.richfaces.tests.metamer.ftest.annotations.Uses;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestPanelMenuGroupMode extends AbstractPanelMenuGroupTest {
+
+ @Inject
+ @Use(booleans = { true, false })
+ Boolean immediate;
+
+ @Inject
+ @Use(booleans = { true, false })
+ Boolean bypassUpdates;
+
+ @Inject
+ @Use("requestModes")
+ PanelMenuMode mode = PanelMenuMode.ajax;
+ PanelMenuMode[] requestModes = new PanelMenuMode[] { PanelMenuMode.ajax, PanelMenuMode.server };
+
+ @Inject
+ @Use("listeners")
+ String listener;
+ String[] listeners = new String[] { "phases", "action invoked", "action listener invoked", "executeChecker",
+ "item changed" };
+
+ @Test
+ public void testMode() {
+ attributes.setImmediate(immediate);
+ attributes.setBypassUpdates(bypassUpdates);
+ attributes.setMode(mode);
+
+ attributes.setExecute("@this executeChecker");
+
+ toggleGroup();
+
+ if (mode != PanelMenuMode.client) {
+ if ("phases".equals(listener)) {
+ phaseInfo.assertPhases(getExpectedPhases());
+ } else {
+ phaseInfo.assertListener(getExecutionPhase(), listener);
+ }
+ }
+ }
+
+ @Test
+ @Uses({ @Use(field = "immediate", empty = true), @Use(field = "bypassUpdates", empty = true),
+ @Use(field = "mode", empty = true), @Use(field = "listener", empty = true) })
+ public void testClientMode() {
+ toggleGroup();
+ }
+
+ private PhaseId[] getExpectedPhases() {
+ LinkedList<PhaseId> list = new LinkedList<PhaseId>();
+ list.add(RESTORE_VIEW);
+ list.add(APPLY_REQUEST_VALUES);
+ if (!immediate) {
+ list.add(PROCESS_VALIDATIONS);
+ }
+ if (!immediate && !bypassUpdates) {
+ list.add(UPDATE_MODEL_VALUES);
+ list.add(INVOKE_APPLICATION);
+ }
+ list.add(RENDER_RESPONSE);
+ return list.toArray(new PhaseId[list.size()]);
+ }
+
+ private PhaseId getExecutionPhase() {
+ PhaseId[] phases = getExpectedPhases();
+ return phases[phases.length - 2];
+ }
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupSimple.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/TestPanelMenuGroupSimple.java 2011-02-07 14:19:37 UTC (rev 21508)
@@ -0,0 +1,194 @@
+package org.richfaces.tests.metamer.ftest.richPanelMenuGroup;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+
+import org.jboss.test.selenium.GuardRequest;
+import org.jboss.test.selenium.request.RequestType;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestPanelMenuGroupSimple extends AbstractPanelMenuGroupTest {
+
+ private static String SAMPLE_IMAGE = "/resources/images/loading.gif";
+ private static String CHEVRON_DOWN = "chevronDown";
+ private static String CHEVRON_DOWN_CLASS = "rf-ico-chevron-down";
+
+ @Test
+ public void testData() {
+ attributes.setData("RichFaces 4");
+ attributes.setOncomplete("data = event.data");
+
+ retrieveRequestTime.initializeValue();
+ topGroup.toggle();
+ waitGui.waitForChange(retrieveRequestTime);
+
+ assertEquals(retrieveWindowData.retrieve(), "RichFaces 4");
+ }
+
+ @Test
+ public void testDisabled() {
+ assertFalse(topGroup.isDisabled());
+
+ attributes.setDisabled(true);
+
+ assertFalse(topGroup.isSelected());
+ assertTrue(topGroup.isDisabled());
+
+ new GuardRequest(RequestType.NONE) {
+ public void command() {
+ topGroup.toggle();
+ }
+ }.waitRequest();
+
+ assertFalse(topGroup.isSelected());
+ assertTrue(topGroup.isDisabled());
+ }
+
+ @Test
+ public void testDisabledClass() {
+ attributes.setDisabled(true);
+ super.testStyleClass(topGroup, "disabledClass");
+ }
+
+ @Test
+ public void testLeftDisabledIcon() {
+ attributes.setLeftDisabledIcon(SAMPLE_IMAGE);
+
+ assertTrue(leftIcon.isTransparent());
+ assertFalse(leftIcon.isCustomURL());
+
+ attributes.setDisabled(true);
+
+ assertTrue(leftIcon.isCustomURL());
+ assertTrue(leftIcon.getCustomURL().endsWith(SAMPLE_IMAGE));
+ }
+
+ @Test
+ public void testLeftCollapsedIcon() {
+ attributes.setLeftCollapsedIcon(CHEVRON_DOWN);
+
+ toggleGroup();
+
+ assertTrue(leftIcon.containsClass(CHEVRON_DOWN_CLASS));
+
+ attributes.setDisabled(true);
+
+ assertTrue(leftIcon.isTransparent());
+ }
+
+ @Test
+ public void testLeftExpandedIcon() {
+ attributes.setLeftExpandedIcon(CHEVRON_DOWN);
+
+ assertTrue(leftIcon.containsClass(CHEVRON_DOWN_CLASS));
+
+ attributes.setDisabled(true);
+
+ assertTrue(leftIcon.isTransparent());
+ }
+
+ @Test
+ public void testLimitRender() {
+ attributes.setRender("renderChecker");
+ attributes.setLimitRender(true);
+
+ retrieveRequestTime.initializeValue();
+ retrieveRenderChecker.initializeValue();
+ topGroup.toggle();
+ waitAjax.waitForChange(retrieveRenderChecker);
+ assertFalse(retrieveRequestTime.isValueChanged());
+ }
+
+ @Test
+ public void testRendered() {
+ assertTrue(topGroup.isVisible());
+
+ attributes.setRendered(false);
+
+ assertFalse(topGroup.isVisible());
+ }
+
+ @Test
+ public void testRightDisabledIcon() {
+ attributes.setRightDisabledIcon(SAMPLE_IMAGE);
+
+ assertTrue(rightIcon.isTransparent());
+ assertFalse(rightIcon.isCustomURL());
+
+ attributes.setDisabled(true);
+
+ assertTrue(rightIcon.isCustomURL());
+ assertTrue(rightIcon.getCustomURL().endsWith(SAMPLE_IMAGE));
+ }
+
+ @Test
+ public void testRightExpandedIcon() {
+ attributes.setRightExpandedIcon(CHEVRON_DOWN);
+
+ assertTrue(rightIcon.containsClass(CHEVRON_DOWN_CLASS));
+
+ attributes.setDisabled(true);
+
+ assertTrue(rightIcon.isTransparent());
+ }
+
+ @Test
+ public void testRightCollapsedIcon() {
+ attributes.setRightCollapsedIcon(CHEVRON_DOWN);
+
+ toggleGroup();
+
+ assertTrue(rightIcon.containsClass(CHEVRON_DOWN_CLASS));
+
+ attributes.setDisabled(true);
+
+ assertTrue(rightIcon.isTransparent());
+ }
+
+ @Test
+ public void testSelectable() {
+ attributes.setSelectable(false);
+
+ new GuardRequest(RequestType.XHR) {
+ public void command() {
+ topGroup.toggle();
+ }
+ }.waitRequest();
+
+ assertFalse(topGroup.isSelected());
+
+ attributes.setSelectable(true);
+
+ new GuardRequest(RequestType.XHR) {
+ public void command() {
+ topGroup.toggle();
+ }
+ }.waitRequest();
+
+ assertTrue(topGroup.isSelected());
+ }
+
+ @Test
+ public void testStatus() {
+ attributes.setStatus("statusChecker");
+
+ retrieveStatusChecker.initializeValue();
+ topGroup.toggle();
+ waitAjax.waitForChange(retrieveStatusChecker);
+ }
+
+ @Test
+ public void testStyle() {
+ super.testStyle(topGroup, "style");
+ }
+
+ @Test
+ public void testStyleClass() {
+ super.testStyleClass(topGroup, "styleClass");
+ }
+}
15 years, 2 months
JBoss Rich Faces SVN: r21507 - in modules/tests/metamer/trunk: application/src/main/webapp/components/richPanelMenuItem and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-07 09:18:06 -0500 (Mon, 07 Feb 2011)
New Revision: 21507
Added:
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/richPanelMenuItem/TestPanelMenuItemClientSideHandlers.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemDOMEventHandlers.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemMode.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemSimple.java
Modified:
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.properties
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuItem/simple.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.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/richPanelMenuItem/PanelMenuItemAttributes.java
Log:
rich:panelMenuItem - automated (RFPL-950)
Modified: modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.properties
===================================================================
--- modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.properties 2011-02-07 14:17:40 UTC (rev 21506)
+++ modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.properties 2011-02-07 14:18:06 UTC (rev 21507)
@@ -11,15 +11,15 @@
attr.leftIcon.triangleDown=triangleDown
attr.leftIcon.customURL=/resources/images/loading.gif
attr.leftIcon.null=
-attr.leftIconDisabled.grid=grid
-attr.leftIconDisabled.disc=disc
-attr.leftIconDisabled.chevronUp=chevronUp
-attr.leftIconDisabled.chevronDown=chevronDown
-attr.leftIconDisabled.triangle=triangle
-attr.leftIconDisabled.triangleUp=triangleUp
-attr.leftIconDisabled.triangleDown=triangleDown
-attr.leftIconDisabled.customURL=/resources/images/loading.gif
-attr.leftIconDisabled.null=
+attr.leftDisabledIcon.grid=grid
+attr.leftDisabledIcon.disc=disc
+attr.leftDisabledIcon.chevronUp=chevronUp
+attr.leftDisabledIcon.chevronDown=chevronDown
+attr.leftDisabledIcon.triangle=triangle
+attr.leftDisabledIcon.triangleUp=triangleUp
+attr.leftDisabledIcon.triangleDown=triangleDown
+attr.leftDisabledIcon.customURL=/resources/images/loading.gif
+attr.leftDisabledIcon.null=
attr.rightIcon.grid=grid
attr.rightIcon.disc=disc
attr.rightIcon.chevronUp=chevronUp
@@ -29,12 +29,12 @@
attr.rightIcon.triangleDown=triangleDown
attr.rightIcon.customURL=/resources/images/loading.gif
attr.rightIcon.null=
-attr.rightIconDisabled.grid=grid
-attr.rightIconDisabled.disc=disc
-attr.rightIconDisabled.chevronUp=chevronUp
-attr.rightIconDisabled.chevronDown=chevronDown
-attr.rightIconDisabled.triangle=triangle
-attr.rightIconDisabled.triangleUp=triangleUp
-attr.rightIconDisabled.triangleDown=triangleDown
-attr.rightIconDisabled.customURL=/resources/images/loading.gif
-attr.rightIconDisabled.null=
\ No newline at end of file
+attr.rightDisabledIcon.grid=grid
+attr.rightDisabledIcon.disc=disc
+attr.rightDisabledIcon.chevronUp=chevronUp
+attr.rightDisabledIcon.chevronDown=chevronDown
+attr.rightDisabledIcon.triangle=triangle
+attr.rightDisabledIcon.triangleUp=triangleUp
+attr.rightDisabledIcon.triangleDown=triangleDown
+attr.rightDisabledIcon.customURL=/resources/images/loading.gif
+attr.rightDisabledIcon.null=
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuItem/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuItem/simple.xhtml 2011-02-07 14:17:40 UTC (rev 21506)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuItem/simple.xhtml 2011-02-07 14:18:06 UTC (rev 21507)
@@ -59,15 +59,16 @@
hoverClass="#{richPanelMenuItemBean.attributes['hoverClass'].value}"
leftIcon="#{richPanelMenuItemBean.attributes['leftIcon'].value}"
leftIconClass="#{richPanelMenuItemBean.attributes['leftIconClass'].value}"
- leftIconDisabled="#{richPanelMenuItemBean.attributes['leftIconDisabled'].value}"
+ leftDisabledIcon="#{richPanelMenuItemBean.attributes['leftDisabledIcon'].value}"
rightIcon="#{richPanelMenuItemBean.attributes['rightIcon'].value}"
rightIconClass="#{richPanelMenuItemBean.attributes['rightIconClass'].value}"
- rightIconDisabled="#{richPanelMenuItemBean.attributes['rightIconDisabled'].value}"
+ rightDisabledIcon="#{richPanelMenuItemBean.attributes['rightDisabledIcon'].value}"
immediate="#{richPanelMenuItemBean.attributes['immediate'].value}"
limitRender="#{richPanelMenuItemBean.attributes['limitRender'].value}"
mode="#{richPanelMenuItemBean.attributes['mode'].value}"
onbeforedomupdate="#{richPanelMenuItemBean.attributes['onbeforedomupdate'].value}"
onbeforeselect="#{richPanelMenuItemBean.attributes['onbeforeselect'].value}"
+ onbegin="#{richPanelMenuItemBean.attributes['onbegin'].value}"
onclick="#{richPanelMenuItemBean.attributes['onclick'].value}"
oncomplete="#{richPanelMenuItemBean.attributes['oncomplete'].value}"
ondblclick="#{richPanelMenuItemBean.attributes['ondblclick'].value}"
Added: 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 (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/GuardRequest.java 2011-02-07 14:18:06 UTC (rev 21507)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.jboss.test.selenium;
+
+import org.jboss.test.selenium.guard.request.RequestTypeGuard;
+import org.jboss.test.selenium.request.RequestType;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public abstract class GuardRequest {
+
+ private RequestTypeGuard guard;
+
+ public GuardRequest(RequestType requestExpected) {
+ guard = new RequestTypeGuard(requestExpected, false);
+ }
+
+ public void waitRequest() {
+ guard.doBeforeCommand();
+ command();
+ guard.doAfterCommand();
+ }
+
+ public abstract void command();
+}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java 2011-02-07 14:17:40 UTC (rev 21506)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java 2011-02-07 14:18:06 UTC (rev 21507)
@@ -22,6 +22,7 @@
package org.richfaces.tests.metamer.ftest;
import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guard;
+import static org.jboss.test.selenium.locator.Attribute.VALUE;
import static org.jboss.test.selenium.locator.LocatorFactory.jq;
import static org.jboss.test.selenium.locator.reference.ReferencedLocator.referenceInferred;
import static org.richfaces.tests.metamer.ftest.AbstractMetamerTest.pjq;
@@ -68,7 +69,10 @@
}
protected String getProperty(String propertyName) {
- final ElementLocator<?> locator = propertyLocator.format(propertyName, "");
+ final ReferencedLocator<JQueryLocator> locator = propertyLocator.format(propertyName, "");
+ if (selenium.getCount(locator) > 1) {
+ return selenium.getAttribute(propertyLocator.format(propertyName, "[checked]").getAttribute(VALUE));
+ }
return selenium.getValue(locator);
}
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:17:40 UTC (rev 21506)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/PanelMenu.java 2011-02-07 14:18:06 UTC (rev 21507)
@@ -1,19 +1,25 @@
package org.richfaces.tests.metamer.ftest.model;
import static org.jboss.test.selenium.locator.Attribute.CLASS;
+import static org.jboss.test.selenium.locator.Attribute.SRC;
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.JQuerySelectors;
+import org.jboss.test.selenium.RequestTypeModelGuard.Model;
import org.jboss.test.selenium.framework.AjaxSelenium;
import org.jboss.test.selenium.framework.AjaxSeleniumProxy;
+import org.jboss.test.selenium.locator.AttributeLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.locator.reference.ReferencedLocator;
+import org.jboss.test.selenium.utils.text.SimplifiedFormat;
-public class PanelMenu extends AbstractModel<JQueryLocator> {
+public class PanelMenu extends AbstractModel<JQueryLocator> implements Model {
AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
- private ReferencedLocator<JQueryLocator> topItems = ref(root, "> rf-pm-top-itm");
- private ReferencedLocator<JQueryLocator> topGroups = ref(root, "> rf-pm-top-gr");
+ private ReferencedLocator<JQueryLocator> topItems = ref(root, "> .rf-pm-top-itm");
+ private ReferencedLocator<JQueryLocator> topGroups = ref(root, "> .rf-pm-top-gr");
public PanelMenu(JQueryLocator root) {
super(root);
@@ -51,14 +57,15 @@
return new Group(topGroups.getReferenced());
}
- public class Group extends AbstractModel<JQueryLocator> {
+ public class Group extends AbstractModel<JQueryLocator> implements Model {
ReferencedLocator<JQueryLocator> label = ref(root, "> table > tbody > tr > td[class*=rf-][class*=-gr-lbl]");
ReferencedLocator<JQueryLocator> leftIcon = ref(root, "> table > tbody > tr > td[class*=rf-][class*=-gr-ico]");
ReferencedLocator<JQueryLocator> rightIcon = ref(root,
"div[class*=rf-][class*=-gr-hdr] > table > tbody > tr > td[class*=rf-][class*=-itm-gr-ico]");
- private ReferencedLocator<JQueryLocator> items = ref(root, "> rf-pm-itm");
- private ReferencedLocator<JQueryLocator> groups = ref(root, "> rf-pm-gr");
+ private ReferencedLocator<JQueryLocator> content = ref(root, "> div[class*=rf-pm-][class*=gr-cnt]");
+ private ReferencedLocator<JQueryLocator> items = ref(content, "> .rf-pm-itm");
+ private ReferencedLocator<JQueryLocator> groups = ref(content, "> .rf-pm-gr");
public Group(JQueryLocator root) {
super(root);
@@ -79,6 +86,10 @@
public Item getItem(int index) {
return new Item(items.getNthOccurence(index));
}
+
+ public Item getItemContains(String string) {
+ return new Item(JQuerySelectors.append(items, SimplifiedFormat.format(":contains('{0}')", string)));
+ }
public Iterable<Group> getAllGroups() {
return new ModelIterable<JQueryLocator, Group>(groups.getAllOccurrences(), Group.class);
@@ -99,7 +110,7 @@
public boolean isSelected() {
return selenium.getAttribute(this.getAttribute(CLASS)).contains("-sel");
}
-
+
public Icon getLeftIcon() {
return new Icon(leftIcon.getReferenced());
}
@@ -113,7 +124,7 @@
}
}
- public class Item extends AbstractModel<JQueryLocator> {
+ public class Item extends AbstractModel<JQueryLocator> implements Model {
ReferencedLocator<JQueryLocator> label = ref(root, "> table > tbody > tr > td[class*=rf-][class*=-itm-lbl]");
ReferencedLocator<JQueryLocator> leftIcon = ref(root, "> table > tbody > tr > td[class*=rf-][class*=-itm-ico]");
ReferencedLocator<JQueryLocator> rightIcon = ref(root,
@@ -131,6 +142,14 @@
return selenium.getAttribute(this.getAttribute(CLASS)).contains("-hov");
}
+ public boolean isDisabled() {
+ return selenium.getAttribute(this.getAttribute(CLASS)).contains("-dis");
+ }
+
+ public boolean isVisible() {
+ return selenium.isElementPresent(this) && selenium.isDisplayed(this);
+ }
+
public Icon getLeftIcon() {
return new Icon(leftIcon.getReferenced());
}
@@ -142,6 +161,14 @@
public Label getLabel() {
return new Label(label.getReferenced());
}
+
+ public void select() {
+ selenium.click(label);
+ }
+
+ public void hover() {
+ selenium.mouseOver(this);
+ }
}
public class Icon extends AbstractModel<JQueryLocator> {
@@ -150,6 +177,25 @@
super(root);
}
+ ReferencedLocator<JQueryLocator> img = ref(root, "> img");
+ AttributeLocator<?> imgSrc = img.getAttribute(SRC);
+
+ public boolean isTransparent() {
+ return selenium.getAttribute(this.getAttribute(CLASS)).contains("-transparent");
+ }
+
+ public boolean containsClass(String styleClass) {
+ return selenium.belongsClass(this, styleClass);
+ }
+
+ public boolean isCustomURL() {
+ return selenium.isElementPresent(img);
+ }
+
+ public String getCustomURL() {
+ return selenium.getAttribute(imgSrc);
+ }
+
}
public class Label extends AbstractModel<JQueryLocator> {
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/PanelMenuItemAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/PanelMenuItemAttributes.java 2011-02-07 14:17:40 UTC (rev 21506)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/PanelMenuItemAttributes.java 2011-02-07 14:18:06 UTC (rev 21507)
@@ -57,15 +57,15 @@
setProperty("leftDisabledIcon", leftDisabledIcon);
}
- public void setLeftExpandedIcon(String leftExpandedIcon) {
- setProperty("leftIcon", leftExpandedIcon);
+ public void setLeftIcon(String leftIcon) {
+ setProperty("leftIcon", leftIcon);
}
-
+
public void setLeftIconClass(String leftIconClass) {
setProperty("leftIconClass", leftIconClass);
}
- public void setLimitRender(String limitRender) {
+ public void setLimitRender(Boolean limitRender) {
setProperty("limitRender", limitRender);
}
@@ -73,6 +73,10 @@
setProperty("mode", mode);
}
+ public PanelMenuMode getMode() {
+ return PanelMenuMode.valueOf(getProperty("mode"));
+ }
+
public void setRender(String render) {
setProperty("render", render);
}
@@ -84,7 +88,11 @@
public void setRightDisabledIcon(String rightDisabledIcon) {
setProperty("rightDisabledIcon", rightDisabledIcon);
}
-
+
+ public void setRightIcon(String rightIcon) {
+ setProperty("rightIcon", rightIcon);
+ }
+
public void setRightIconClass(String rightIconClass) {
setProperty("rightIconClass", rightIconClass);
}
@@ -96,8 +104,8 @@
public void setStatus(String status) {
setProperty("status", status);
}
-
- public void setStyle (String style) {
+
+ public void setStyle(String style) {
setProperty("style", style);
}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemClientSideHandlers.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemClientSideHandlers.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemClientSideHandlers.java 2011-02-07 14:18:06 UTC (rev 21507)
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * 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.richPanelMenuItem;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.richfaces.PanelMenuMode.ajax;
+import static org.richfaces.PanelMenuMode.client;
+import static org.richfaces.PanelMenuMode.server;
+
+import java.net.URL;
+
+import org.jboss.test.selenium.GuardRequest;
+import org.jboss.test.selenium.request.RequestType;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.richfaces.tests.metamer.ftest.model.PanelMenu;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestPanelMenuItemClientSideHandlers extends AbstractMetamerTest {
+
+ PanelMenuItemAttributes attributes = new PanelMenuItemAttributes();
+ PanelMenu menu = new PanelMenu(pjq("div.rf-pm[id$=panelMenu]"));
+ PanelMenu.Item item = menu.getGroup(1).getItem(2);
+
+ @Inject
+ @Use(empty = true)
+ String event;
+ String[] ajaxEvents = new String[] { "begin", "beforedomupdate", "beforeselect", "select", "complete" };
+ String[] clientEvents = new String[] { "beforeselect", "select" };
+ String[] serverEvents = new String[] { "select" };
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richPanelMenuItem/simple.xhtml");
+ }
+
+ @Test
+ @Use(field = "event", value = "ajaxEvents")
+ public void testClientSideEvent() {
+ attributes.setMode(ajax);
+ super.testRequestEventsBefore(event);
+ selectItem();
+ super.testRequestEventsAfter(event);
+ }
+
+ @Test
+ public void testClientSideEventsOrderClient() {
+ attributes.setMode(client);
+ super.testRequestEventsBefore(clientEvents);
+ selectItem();
+ super.testRequestEventsAfter(clientEvents);
+ }
+
+ @Test
+ public void testClientSideEventsOrderAjax() {
+ attributes.setMode(ajax);
+ super.testRequestEventsBefore(ajaxEvents);
+ selectItem();
+ super.testRequestEventsAfter(ajaxEvents);
+ }
+
+ @Test
+ public void testClientSideEventsOrderServer() {
+ attributes.setMode(server);
+ super.testRequestEventsBefore(serverEvents);
+ selectItem();
+ super.testRequestEventsAfter(serverEvents);
+ }
+
+ private void selectItem() {
+ new GuardRequest(getRequestTypeForMode()) {
+ @Override
+ public void command() {
+ item.select();
+ }
+ }.waitRequest();
+ }
+
+ private RequestType getRequestTypeForMode() {
+ switch (attributes.getMode()) {
+ 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/richPanelMenuItem/TestPanelMenuItemDOMEventHandlers.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemDOMEventHandlers.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemDOMEventHandlers.java 2011-02-07 14:18:06 UTC (rev 21507)
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * 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.richPanelMenuItem;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.jboss.test.selenium.dom.Event.*;
+
+import java.net.URL;
+
+import org.jboss.test.selenium.dom.Event;
+import org.richfaces.PanelMenuMode;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.richfaces.tests.metamer.ftest.model.PanelMenu;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestPanelMenuItemDOMEventHandlers extends AbstractMetamerTest {
+
+ PanelMenuItemAttributes attributes = new PanelMenuItemAttributes();
+ PanelMenu menu = new PanelMenu(pjq("div.rf-pm[id$=panelMenu]"));
+ PanelMenu.Item item = menu.getGroup(1).getItem(2);
+
+ @Inject
+ @Use("events")
+ Event event;
+ Event[] events = new Event[] { CLICK, DBLCLICK, MOUSEDOWN, MOUSEMOVE, MOUSEOUT, MOUSEOVER, MOUSEUP };
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richPanelMenuItem/simple.xhtml");
+ }
+
+ @Test
+ public void testDOMEventHandler() {
+ attributes.setMode(PanelMenuMode.client);
+ super.testFireEvent(event, item);
+ }
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemMode.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemMode.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemMode.java 2011-02-07 14:18:06 UTC (rev 21507)
@@ -0,0 +1,133 @@
+/*******************************************************************************
+ * 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.richPanelMenuItem;
+
+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.jboss.test.selenium.utils.URLUtils.buildUrl;
+
+import java.net.URL;
+import java.util.LinkedList;
+
+import javax.faces.event.PhaseId;
+
+import org.jboss.test.selenium.GuardRequest;
+import org.jboss.test.selenium.request.RequestType;
+import org.richfaces.PanelMenuMode;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.richfaces.tests.metamer.ftest.model.PanelMenu;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestPanelMenuItemMode extends AbstractMetamerTest {
+
+ PanelMenuItemAttributes attributes = new PanelMenuItemAttributes();
+ PanelMenu menu = new PanelMenu(pjq("div.rf-pm[id$=panelMenu]"));
+ PanelMenu.Item item = menu.getGroup(1).getItem(2);
+
+ @Inject
+ @Use(booleans = { true, false })
+ Boolean immediate;
+
+ @Inject
+ @Use(booleans = { true, false })
+ Boolean bypassUpdates;
+
+ @Inject
+ @Use(enumeration = true)
+ PanelMenuMode mode = PanelMenuMode.ajax;
+
+ @Inject
+ @Use("listeners")
+ String listener;
+ String[] listeners = new String[] { "phases", "action invoked", "action listener invoked", "executeChecker",
+ "item changed" };
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richPanelMenuItem/simple.xhtml");
+ }
+
+ @Test
+ public void testMode() {
+ attributes.setImmediate(immediate);
+ attributes.setBypassUpdates(bypassUpdates);
+ attributes.setMode(mode);
+
+ attributes.setExecute("@this executeChecker");
+
+ new GuardRequest(getRequestTypeForMode()) {
+ @Override
+ public void command() {
+ item.select();
+ }
+ }.waitRequest();
+
+ if (mode != PanelMenuMode.client) {
+ if ("phases".equals(listener)) {
+ phaseInfo.assertPhases(getExpectedPhases());
+ } else {
+ phaseInfo.assertListener(getExecutionPhase(), listener);
+ }
+ }
+ }
+
+ private PhaseId[] getExpectedPhases() {
+ LinkedList<PhaseId> list = new LinkedList<PhaseId>();
+ list.add(RESTORE_VIEW);
+ list.add(APPLY_REQUEST_VALUES);
+ if (!immediate) {
+ list.add(PROCESS_VALIDATIONS);
+ }
+ if (!immediate && !bypassUpdates) {
+ list.add(UPDATE_MODEL_VALUES);
+ list.add(INVOKE_APPLICATION);
+ }
+ list.add(RENDER_RESPONSE);
+ return list.toArray(new PhaseId[list.size()]);
+ }
+
+ private PhaseId getExecutionPhase() {
+ PhaseId[] phases = getExpectedPhases();
+ return phases[phases.length - 2];
+ }
+
+ private RequestType getRequestTypeForMode() {
+ 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/richPanelMenuItem/TestPanelMenuItemSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemSimple.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/TestPanelMenuItemSimple.java 2011-02-07 14:18:06 UTC (rev 21507)
@@ -0,0 +1,194 @@
+package org.richfaces.tests.metamer.ftest.richPanelMenuItem;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+
+import java.net.URL;
+
+import org.jboss.test.selenium.GuardRequest;
+import org.jboss.test.selenium.request.RequestType;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.model.PanelMenu;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestPanelMenuItemSimple extends AbstractMetamerTest {
+
+ private static String SAMPLE_IMAGE = "/resources/images/loading.gif";
+ private static String CHEVRON_DOWN = "chevronDown";
+ private static String CHEVRON_DOWN_CLASS = "rf-ico-chevron-down";
+
+ PanelMenuItemAttributes attributes = new PanelMenuItemAttributes();
+ PanelMenu menu = new PanelMenu(pjq("div.rf-pm[id$=panelMenu]"));
+ PanelMenu.Item item = menu.getGroup(1).getItemContains("Item 1.2");
+ PanelMenu.Icon leftIcon = item.getLeftIcon();
+ PanelMenu.Icon rightIcon = item.getRightIcon();
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richPanelMenuItem/simple.xhtml");
+ }
+
+ @Test
+ public void testData() {
+ attributes.setData("RichFaces 4");
+ attributes.setOncomplete("data = event.data");
+
+ retrieveRequestTime.initializeValue();
+ item.select();
+ waitGui.waitForChange(retrieveRequestTime);
+
+ assertEquals(retrieveWindowData.retrieve(), "RichFaces 4");
+ }
+
+ @Test
+ public void testDisabled() {
+ assertFalse(item.isDisabled());
+
+ attributes.setDisabled(true);
+
+ assertFalse(item.isSelected());
+ assertTrue(item.isDisabled());
+
+ new GuardRequest(RequestType.NONE) {
+ public void command() {
+ item.select();
+ }
+ }.waitRequest();
+
+ assertFalse(item.isSelected());
+ assertTrue(item.isDisabled());
+ }
+
+ @Test
+ public void testDisabledClass() {
+ attributes.setDisabled(true);
+ super.testStyleClass(item, "disabledClass");
+ }
+
+ @Test
+ public void testLeftDisabledIcon() {
+ attributes.setLeftDisabledIcon(SAMPLE_IMAGE);
+
+ assertTrue(leftIcon.isTransparent());
+ assertFalse(leftIcon.isCustomURL());
+
+ attributes.setDisabled(true);
+
+ assertTrue(leftIcon.isCustomURL());
+ assertTrue(leftIcon.getCustomURL().endsWith(SAMPLE_IMAGE));
+ }
+
+ @Test
+ public void testLeftIcon() {
+ attributes.setLeftIcon(CHEVRON_DOWN);
+
+ assertTrue(leftIcon.containsClass(CHEVRON_DOWN_CLASS));
+
+ attributes.setDisabled(true);
+
+ assertTrue(leftIcon.isTransparent());
+ }
+
+ @Test
+ public void testLeftIconClass() {
+ super.testStyleClass(leftIcon, "leftIconClass");
+ }
+
+ @Test
+ public void testLimitRender() {
+ attributes.setRender("renderChecker");
+ attributes.setLimitRender(true);
+
+ retrieveRequestTime.initializeValue();
+ retrieveRenderChecker.initializeValue();
+ item.select();
+ waitAjax.waitForChange(retrieveRenderChecker);
+ assertFalse(retrieveRequestTime.isValueChanged());
+ }
+
+ @Test
+ public void testRendered() {
+ assertTrue(item.isVisible());
+
+ attributes.setRendered(false);
+
+ assertFalse(item.isVisible());
+ }
+
+ @Test
+ public void testRightDisabledIcon() {
+ attributes.setRightDisabledIcon(SAMPLE_IMAGE);
+
+ assertTrue(rightIcon.isTransparent());
+ assertFalse(rightIcon.isCustomURL());
+
+ attributes.setDisabled(true);
+
+ assertTrue(rightIcon.isCustomURL());
+ assertTrue(rightIcon.getCustomURL().endsWith(SAMPLE_IMAGE));
+ }
+
+ @Test
+ public void testRightIcon() {
+ attributes.setRightIcon(CHEVRON_DOWN);
+
+ assertTrue(rightIcon.containsClass(CHEVRON_DOWN_CLASS));
+
+ attributes.setDisabled(true);
+
+ assertTrue(rightIcon.isTransparent());
+ }
+
+ @Test
+ public void testRightIconClass() {
+ super.testStyleClass(rightIcon, "rightIconClass");
+ }
+
+ @Test
+ public void testSelectable() {
+ attributes.setSelectable(false);
+
+ new GuardRequest(RequestType.NONE) {
+ public void command() {
+ item.select();
+ }
+ }.waitRequest();
+
+ assertFalse(item.isSelected());
+
+ attributes.setSelectable(true);
+
+ new GuardRequest(RequestType.XHR) {
+ public void command() {
+ item.select();
+ }
+ }.waitRequest();
+
+ assertTrue(item.isSelected());
+ }
+
+ @Test
+ public void testStatus() {
+ attributes.setStatus("statusChecker");
+
+ retrieveStatusChecker.initializeValue();
+ item.select();
+ waitAjax.waitForChange(retrieveStatusChecker);
+ }
+
+ @Test
+ public void testStyle() {
+ super.testStyle(item, "style");
+ }
+
+ @Test
+ public void testStyleClass() {
+ super.testStyleClass(item, "styleClass");
+ }
+}
15 years, 2 months
JBoss Rich Faces SVN: r21506 - in trunk: ui/output/ui/src/main/resources/META-INF/resources/org.richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2011-02-07 09:17:40 -0500 (Mon, 07 Feb 2011)
New Revision: 21506
Modified:
trunk/examples/output-demo/src/main/webapp/qunit/panelMenu.xhtml
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuItem.js
Log:
RF-10248 PanelMenuItem/PanelMenuGroup: nested UIParam components should be supported
Modified: trunk/examples/output-demo/src/main/webapp/qunit/panelMenu.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/qunit/panelMenu.xhtml 2011-02-07 14:16:39 UTC (rev 21505)
+++ trunk/examples/output-demo/src/main/webapp/qunit/panelMenu.xhtml 2011-02-07 14:17:40 UTC (rev 21506)
@@ -66,8 +66,20 @@
execute="date-p" render="date-p"
>
- <pn:panelMenuGroup label="Group 1" selectable="true" execute="date-g1" render="date-g1">
- <pn:panelMenuItem execute="date-i" render="date-i">Item 1.1</pn:panelMenuItem>
+ <pn:panelMenuGroup label="Group 1" selectable="true" execute="date-g1" render="date-g1" mode="server">
+ <f:param name="alexParam01" value="alexValue01" />
+ <f:param name="alexParam02" value="alexValue02" />
+ <f:param name="alexParam03" value="alexValue03" />
+ <f:param name="alexParam04" value="alexValue04" />
+
+
+ <pn:panelMenuItem execute="date-i" render="date-i" mode="server">
+ <f:param name="alexParam11" value="alexValue11"/>
+ <f:param name="alexParam12" value="alexValue12"/>
+ <f:param name="alexParam13" value="alexValue13"/>
+ <f:param name="alexParam14" value="alexValue14"/>
+ Item 1.1
+ </pn:panelMenuItem>
<pn:panelMenuItem execute="date-i" render="date-i">Item 1.2</pn:panelMenuItem>
<pn:panelMenuItem execute="date-i" render="date-i">Item 1.3</pn:panelMenuItem>
</pn:panelMenuGroup>
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js 2011-02-07 14:16:39 UTC (rev 21505)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js 2011-02-07 14:17:40 UTC (rev 21506)
@@ -62,7 +62,7 @@
* */
execServer : function (group) {
group.__changeState();
- rf.submitForm(this.__getParentForm(group));
+ rf.submitForm(this.__getParentForm(group), group.options["ajax"]["parameters"] || {});
return false;
},
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuItem.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuItem.js 2011-02-07 14:16:39 UTC (rev 21505)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuItem.js 2011-02-07 14:17:40 UTC (rev 21506)
@@ -64,6 +64,7 @@
var params = {};
params[item.__panelMenu().id] = item.itemName;
+ $.extend(params, item.options["ajax"]["parameters"] || {});
rf.submitForm(this.__getParentForm(item), params);
15 years, 2 months
JBoss Rich Faces SVN: r21505 - in modules/tests/metamer/trunk: ftest-source/src/main/java/org/richfaces/tests/metamer/ftest and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-07 09:16:39 -0500 (Mon, 07 Feb 2011)
New Revision: 21505
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/
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/richPanelMenuGroup/
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/PanelMenuGroupAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/PanelMenuItemAttributes.java
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.java
Log:
rich:panelMenu - added attributes encapsulation (RFPL-950)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.java 2011-02-07 14:15:28 UTC (rev 21504)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.java 2011-02-07 14:16:39 UTC (rev 21505)
@@ -57,6 +57,7 @@
attributes = Attributes.getComponentAttributesFromFacesConfig(UIPanelMenuItem.class, getClass());
attributes.setAttribute("rendered", true);
+ attributes.setAttribute("selectable", true);
// already defined in source directly
attributes.remove("action");
Added: 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 (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenu/PanelMenuAttributes.java 2011-02-07 14:16:39 UTC (rev 21505)
@@ -0,0 +1,187 @@
+/*******************************************************************************
+ * 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 org.richfaces.PanelMenuMode;
+import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class PanelMenuAttributes extends AbstractComponentAttributes {
+ public void setBubbleSelection(Boolean bubbleSelection) {
+ setProperty("bubbleSelection", bubbleSelection);
+ }
+
+ public void setCollapseEvent(String collapseEvent) {
+ setProperty("collapseEvent", collapseEvent);
+ }
+
+ public void setDisabled(Boolean disabled) {
+ setProperty("disabled", disabled);
+ }
+
+ public void setExpandEvent(String expandEvent) {
+ setProperty("expandEvent", expandEvent);
+ }
+
+ public void setExpandSingle(String expandSingle) {
+ setProperty("expandSingle", expandSingle);
+ }
+
+ public void setGroupClass(String groupClass) {
+ setProperty("groupClass", groupClass);
+ }
+
+ public void setGroupCollapsedLeftIcon(String groupCollapsedLeftIcon) {
+ setProperty("groupCollapsedLeftIcon", groupCollapsedLeftIcon);
+ }
+
+ public void setGroupCollapsedRightIcon(String groupCollapsedRightIcon) {
+ setProperty("groupCollapsedRightIcon", groupCollapsedRightIcon);
+ }
+
+ public void setGroupDisabledClass(String groupDisabledClass) {
+ setProperty("groupDisabledClass", groupDisabledClass);
+ }
+
+ public void setGroupDisabledLeftIcon(String groupDisabledLeftIcon) {
+ setProperty("groupDisabledLeftIcon", groupDisabledLeftIcon);
+ }
+
+ public void setGroupDisabledRightIcon(String groupDisabledRightIcon) {
+ setProperty("groupDisabledRightIcon", groupDisabledRightIcon);
+ }
+
+ public void setGroupExpandedLeftIcon(String groupExpandedLeftIcon) {
+ setProperty("groupExpandedLeftIcon", groupExpandedLeftIcon);
+ }
+
+ public void setGroupExpandedRightIcon(String groupExpandedRightIcon) {
+ setProperty("groupExpandedRightIcon", groupExpandedRightIcon);
+ }
+
+ public void setGroupMode(PanelMenuMode groupMode) {
+ setProperty("groupMode", groupMode);
+ }
+
+ public void setItemClass(String itemClass) {
+ setProperty("itemClass", itemClass);
+ }
+
+ public void setItemDisabledClass(String itemDisabledClass) {
+ setProperty("itemDisabledClass", itemDisabledClass);
+ }
+
+ public void setItemDisabledLeftIcon(String itemDisabledLeftIcon) {
+ setProperty("itemDisabledLeftIcon", itemDisabledLeftIcon);
+ }
+
+ public void setItemDisabledRightIcon(String itemDisabledRightIcon) {
+ setProperty("itemDisabledRightIcon", itemDisabledRightIcon);
+ }
+
+ public void setLeftIcon(String leftIcon) {
+ setProperty("leftIcon", leftIcon);
+ }
+
+ public void setItemMode(PanelMenuMode itemMode) {
+ setProperty("itemMode", itemMode);
+ }
+
+ public void setItemRightIcon(String itemRightIcon) {
+ setProperty("itemRightIcon", itemRightIcon);
+ }
+
+ public void setRendered(Boolean rendered) {
+ setProperty("rendered", rendered);
+ }
+
+ public void setStyle(String style) {
+ setProperty("style", style);
+ }
+
+ public void setStyleClass(String styleClass) {
+ setProperty("styleClass", styleClass);
+ }
+
+ public void setTopGroupClass(String topGroupClass) {
+ setProperty("topGroupClass", topGroupClass);
+ }
+
+ public void setTopGroupCollapsedLeftIcon(String topGroupCollapsedLeftIcon) {
+ setProperty("topGroupCollapsedLeftIcon", topGroupCollapsedLeftIcon);
+ }
+
+ public void setTopGroupCollapsedRightIcon(String topGroupCollapsedRightIcon) {
+ setProperty("topGroupCollapsedRightIcon", topGroupCollapsedRightIcon);
+ }
+
+ public void setTopGroupDisabledClass(String topGroupDisabledClass) {
+ setProperty("topGroupDisabledClass", topGroupDisabledClass);
+ }
+
+ public void setTopGroupDisabledLeftIcon(String topGroupDisabledLeftIcon) {
+ setProperty("topGroupDisabledLeftIcon", topGroupDisabledLeftIcon);
+ }
+
+ public void setTopGroupDisabledRightIcon(String topGroupDisabledRightIcon) {
+ setProperty("topGroupDisabledRightIcon", topGroupDisabledRightIcon);
+ }
+
+ public void setTopGroupExpandedLeftIcon(String topGroupExpandedLeftIcon) {
+ setProperty("topGroupExpandedLeftIcon", topGroupExpandedLeftIcon);
+ }
+
+ public void setTopGroupExpandedRightIcon(String topGroupExpandedRightIcon) {
+ setProperty("topGroupExpandedRightIcon", topGroupExpandedRightIcon);
+ }
+
+ public void setTopItemClass(String topItemClass) {
+ setProperty("topItemClass", topItemClass);
+ }
+
+ public void setTopItemDisabledClass(String topItemDisabledClass) {
+ setProperty("topItemDisabledClass", topItemDisabledClass);
+ }
+
+ public void setTopItemDisabledLeftIcon(String topItemDisabledLeftIcon) {
+ setProperty("topItemDisabledLeftIcon", topItemDisabledLeftIcon);
+ }
+
+ public void setTopItemDisabledRightIcon(String topItemDisabledRightIcon) {
+ setProperty("topItemDisabledRightIcon", topItemDisabledRightIcon);
+ }
+
+ public void setTopItemLeftIcon(String topItemLeftIcon) {
+ setProperty("topItemLeftIcon", topItemLeftIcon);
+ }
+
+ public void setTopItemRightIcon(String topItemRightIcon) {
+ setProperty("topItemRightIcon", topItemRightIcon);
+ }
+
+ public void setWidth(Integer width) {
+ setProperty("width", width);
+ }
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/PanelMenuGroupAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/PanelMenuGroupAttributes.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuGroup/PanelMenuGroupAttributes.java 2011-02-07 14:16:39 UTC (rev 21505)
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * 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.richPanelMenuGroup;
+
+import org.richfaces.PanelMenuMode;
+import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class PanelMenuGroupAttributes extends AbstractComponentAttributes {
+ public void setBypassUpdates(Boolean bypassUpdates) {
+ setProperty("bypassUpdates", bypassUpdates);
+ }
+
+ public void setCollapseEvent(String collapseEvent) {
+ setProperty("collapseEvent", collapseEvent);
+ }
+
+ public void setData(String data) {
+ setProperty("data", data);
+ }
+
+ public void setDisabled(Boolean disabled) {
+ setProperty("disabled", disabled);
+ }
+
+ public void setDisabledClass(String disabledClass) {
+ setProperty("disabledClass", disabledClass);
+ }
+
+ public void setExecute(String execute) {
+ setProperty("execute", execute);
+ }
+
+ public void setExpandEvent(String expandEvent) {
+ setProperty("expandEvent", expandEvent);
+ }
+
+ public void setExpanded(Boolean expanded) {
+ setProperty("expanded", expanded);
+ }
+
+ public void setImmediate(Boolean immediate) {
+ setProperty("immediate", immediate);
+ }
+
+ public void setLeftCollapsedIcon(String leftCollapsedIcon) {
+ setProperty("leftCollapsedIcon", leftCollapsedIcon);
+ }
+
+ public void setLeftDisabledIcon(String leftDisabledIcon) {
+ setProperty("leftDisabledIcon", leftDisabledIcon);
+ }
+
+ public void setLeftExpandedIcon(String leftExpandedIcon) {
+ setProperty("leftExpandedIcon", leftExpandedIcon);
+ }
+
+ public void setLimitRender(String limitRender) {
+ setProperty("limitRender", limitRender);
+ }
+
+ public void setMode(PanelMenuMode mode) {
+ setProperty("mode", mode);
+ }
+
+ public void setRender(String render) {
+ setProperty("render", render);
+ }
+
+ public void setRendered(Boolean rendered) {
+ setProperty("rendered", rendered);
+ }
+
+ public void setRightCollapsedIcon(String rightCollapsedIcon) {
+ setProperty("rightCollapsedIcon", rightCollapsedIcon);
+ }
+
+ public void setRightDisabledIcon(String rightDisabledIcon) {
+ setProperty("rightDisabledIcon", rightDisabledIcon);
+ }
+
+ public void setRightExpandedIcon(String rightExpandedIcon) {
+ setProperty("rightExpandedIcon", rightExpandedIcon);
+ }
+
+ public void setSelectable(Boolean selectable) {
+ setProperty("selectable", selectable);
+ }
+
+ public void setStatus(String status) {
+ setProperty("status", status);
+ }
+
+ public void setStyle (String style) {
+ setProperty("style", style);
+ }
+
+ public void setStyleClass(String styleClass) {
+ setProperty("styleClass", styleClass);
+ }
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/PanelMenuItemAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/PanelMenuItemAttributes.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPanelMenuItem/PanelMenuItemAttributes.java 2011-02-07 14:16:39 UTC (rev 21505)
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * 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.richPanelMenuItem;
+
+import org.richfaces.PanelMenuMode;
+import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class PanelMenuItemAttributes extends AbstractComponentAttributes {
+ public void setBypassUpdates(Boolean bypassUpdates) {
+ setProperty("bypassUpdates", bypassUpdates);
+ }
+
+ public void setData(String data) {
+ setProperty("data", data);
+ }
+
+ public void setDisabled(Boolean disabled) {
+ setProperty("disabled", disabled);
+ }
+
+ public void setDisabledClass(String disabledClass) {
+ setProperty("disabledClass", disabledClass);
+ }
+
+ public void setExecute(String execute) {
+ setProperty("execute", execute);
+ }
+
+ public void setImmediate(Boolean immediate) {
+ setProperty("immediate", immediate);
+ }
+
+ public void setLeftDisabledIcon(String leftDisabledIcon) {
+ setProperty("leftDisabledIcon", leftDisabledIcon);
+ }
+
+ public void setLeftExpandedIcon(String leftExpandedIcon) {
+ setProperty("leftIcon", leftExpandedIcon);
+ }
+
+ public void setLeftIconClass(String leftIconClass) {
+ setProperty("leftIconClass", leftIconClass);
+ }
+
+ public void setLimitRender(String limitRender) {
+ setProperty("limitRender", limitRender);
+ }
+
+ public void setMode(PanelMenuMode mode) {
+ setProperty("mode", mode);
+ }
+
+ public void setRender(String render) {
+ setProperty("render", render);
+ }
+
+ public void setRendered(Boolean rendered) {
+ setProperty("rendered", rendered);
+ }
+
+ public void setRightDisabledIcon(String rightDisabledIcon) {
+ setProperty("rightDisabledIcon", rightDisabledIcon);
+ }
+
+ public void setRightIconClass(String rightIconClass) {
+ setProperty("rightIconClass", rightIconClass);
+ }
+
+ public void setSelectable(Boolean selectable) {
+ setProperty("selectable", selectable);
+ }
+
+ public void setStatus(String status) {
+ setProperty("status", status);
+ }
+
+ public void setStyle (String style) {
+ setProperty("style", style);
+ }
+
+ public void setStyleClass(String styleClass) {
+ setProperty("styleClass", styleClass);
+ }
+}
15 years, 2 months
JBoss Rich Faces SVN: r21504 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-07 09:15:28 -0500 (Mon, 07 Feb 2011)
New Revision: 21504
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/PanelMenu.java
Log:
rich:panelMenu - model for component (RFPL-950)
Added: 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 (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/PanelMenu.java 2011-02-07 14:15:28 UTC (rev 21504)
@@ -0,0 +1,163 @@
+package org.richfaces.tests.metamer.ftest.model;
+
+import static org.jboss.test.selenium.locator.Attribute.CLASS;
+import static org.jboss.test.selenium.locator.reference.ReferencedLocator.ref;
+
+import org.jboss.test.selenium.framework.AjaxSelenium;
+import org.jboss.test.selenium.framework.AjaxSeleniumProxy;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.jboss.test.selenium.locator.reference.ReferencedLocator;
+
+public class PanelMenu extends AbstractModel<JQueryLocator> {
+
+ AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
+
+ private ReferencedLocator<JQueryLocator> topItems = ref(root, "> rf-pm-top-itm");
+ private ReferencedLocator<JQueryLocator> topGroups = ref(root, "> rf-pm-top-gr");
+
+ public PanelMenu(JQueryLocator root) {
+ super(root);
+ }
+
+ public int getItemCount() {
+ return selenium.getCount(topItems);
+ }
+
+ public int getGroupCount() {
+ return selenium.getCount(topGroups);
+ }
+
+ public Iterable<Item> getAllItems() {
+ return new ModelIterable<JQueryLocator, Item>(topItems.getAllOccurrences(), Item.class);
+ }
+
+ public Iterable<Group> getAllGroups() {
+ return new ModelIterable<JQueryLocator, Group>(topGroups.getAllOccurrences(), Group.class);
+ }
+
+ public Item getItem(int index) {
+ return new Item(topItems.getNthOccurence(index));
+ }
+
+ public Group getGroup(int index) {
+ return new Group(topGroups.getNthOccurence(index));
+ }
+
+ public Item getAnyTopItem() {
+ return new Item(topItems.getReferenced());
+ }
+
+ public Group getAnyTopGroup() {
+ return new Group(topGroups.getReferenced());
+ }
+
+ public class Group extends AbstractModel<JQueryLocator> {
+ ReferencedLocator<JQueryLocator> label = ref(root, "> table > tbody > tr > td[class*=rf-][class*=-gr-lbl]");
+ ReferencedLocator<JQueryLocator> leftIcon = ref(root, "> table > tbody > tr > td[class*=rf-][class*=-gr-ico]");
+ ReferencedLocator<JQueryLocator> rightIcon = ref(root,
+ "div[class*=rf-][class*=-gr-hdr] > table > tbody > tr > td[class*=rf-][class*=-itm-gr-ico]");
+
+ private ReferencedLocator<JQueryLocator> items = ref(root, "> rf-pm-itm");
+ private ReferencedLocator<JQueryLocator> groups = ref(root, "> rf-pm-gr");
+
+ public Group(JQueryLocator root) {
+ super(root);
+ }
+
+ public int getItemCount() {
+ return selenium.getCount(items);
+ }
+
+ public int getGroupCount() {
+ return selenium.getCount(groups);
+ }
+
+ public Iterable<Item> getAllItems() {
+ return new ModelIterable<JQueryLocator, Item>(items.getAllOccurrences(), Item.class);
+ }
+
+ public Item getItem(int index) {
+ return new Item(items.getNthOccurence(index));
+ }
+
+ public Iterable<Group> getAllGroups() {
+ return new ModelIterable<JQueryLocator, Group>(groups.getAllOccurrences(), Group.class);
+ }
+
+ public Group getGroup(int index) {
+ return new Group(groups.getNthOccurence(index));
+ }
+
+ public Item getAnyItem() {
+ return new Item(items.getReferenced());
+ }
+
+ public Group getAnyGroup() {
+ return new Group(groups.getReferenced());
+ }
+
+ public boolean isSelected() {
+ return selenium.getAttribute(this.getAttribute(CLASS)).contains("-sel");
+ }
+
+ public Icon getLeftIcon() {
+ return new Icon(leftIcon.getReferenced());
+ }
+
+ public Icon getRightIcon() {
+ return new Icon(rightIcon.getReferenced());
+ }
+
+ public Label getLabel() {
+ return new Label(label.getReferenced());
+ }
+ }
+
+ public class Item extends AbstractModel<JQueryLocator> {
+ ReferencedLocator<JQueryLocator> label = ref(root, "> table > tbody > tr > td[class*=rf-][class*=-itm-lbl]");
+ ReferencedLocator<JQueryLocator> leftIcon = ref(root, "> table > tbody > tr > td[class*=rf-][class*=-itm-ico]");
+ ReferencedLocator<JQueryLocator> rightIcon = ref(root,
+ "> table > tbody > tr > td[class*=rf-][class*=-itm-exp-ico]");
+
+ public Item(JQueryLocator root) {
+ super(root);
+ }
+
+ public boolean isSelected() {
+ return selenium.getAttribute(this.getAttribute(CLASS)).contains("-sel");
+ }
+
+ public boolean isHovered() {
+ return selenium.getAttribute(this.getAttribute(CLASS)).contains("-hov");
+ }
+
+ public Icon getLeftIcon() {
+ return new Icon(leftIcon.getReferenced());
+ }
+
+ public Icon getRightIcon() {
+ return new Icon(rightIcon.getReferenced());
+ }
+
+ public Label getLabel() {
+ return new Label(label.getReferenced());
+ }
+ }
+
+ public class Icon extends AbstractModel<JQueryLocator> {
+
+ public Icon(JQueryLocator root) {
+ super(root);
+ }
+
+ }
+
+ public class Label extends AbstractModel<JQueryLocator> {
+
+ public Label(JQueryLocator root) {
+ super(root);
+ }
+
+ }
+
+}
15 years, 2 months