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");
+ }
+}