Author: ppitonak(a)redhat.com
Date: 2011-01-26 10:24:37 -0500 (Wed, 26 Jan 2011)
New Revision: 21235
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropDownMenu/
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropDownMenu/TestRichDropDownMenu.java
Modified:
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichDropDownMenuBean.properties
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropDownMenu/sideMenu.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropDownMenu/topMenu.xhtml
Log:
https://issues.jboss.org/browse/RFPL-957
* samples for ddm fixed
* added 31 new tests for drop down menu
Modified:
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichDropDownMenuBean.properties
===================================================================
---
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichDropDownMenuBean.properties 2011-01-26
15:08:33 UTC (rev 21234)
+++
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichDropDownMenuBean.properties 2011-01-26
15:24:37 UTC (rev 21235)
@@ -1,3 +1,25 @@
attr.dir.ltr=ltr
attr.dir.rtl=rtl
attr.dir.null=
+
+attr.direction.topLeft=topLeft
+attr.direction.topRight=topRight
+attr.direction.bottomLeft=bottomLeft
+attr.direction.bottomRight=bottomRight
+attr.direction.autoLeft=autoLeft
+attr.direction.autoRight=autoRight
+attr.direction.topAuto=topAuto
+attr.direction.bottomAuto=bottomAuto
+attr.direction.auto=auto
+attr.direction.null=
+
+attr.jointPoint.topLeft=topLeft
+attr.jointPoint.topRight=topRight
+attr.jointPoint.bottomLeft=bottomLeft
+attr.jointPoint.bottomRight=bottomRight
+attr.jointPoint.autoLeft=autoLeft
+attr.jointPoint.autoRight=autoRight
+attr.jointPoint.topAuto=topAuto
+attr.jointPoint.bottomAuto=bottomAuto
+attr.jointPoint.auto=auto
+attr.jointPoint.null=
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropDownMenu/sideMenu.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropDownMenu/sideMenu.xhtml 2011-01-26
15:08:33 UTC (rev 21234)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropDownMenu/sideMenu.xhtml 2011-01-26
15:24:37 UTC (rev 21235)
@@ -6,7 +6,7 @@
<!--
JBoss, Home of Professional Open Source
-Copyright 2010, Red Hat, Inc. and individual contributors
+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.
@@ -56,8 +56,11 @@
<h:panelGrid styleClass="vertical-menu-cell"
columnClasses="optionList" columns="1" cellspacing="0"
cellpadding="0">
<rich:dropDownMenu id="menu1"
dir="#{richDropDownMenuBean.attributes['dir'].value}"
+
direction="#{richDropDownMenuBean.attributes['direction'].value}"
disabled="#{richDropDownMenuBean.attributes['disabled'].value}"
hideDelay="#{richDropDownMenuBean.attributes['hideDelay'].value}"
+
horizontalOffset="#{richDropDownMenuBean.attributes['horizontalOffset'].value}"
+
jointPoint="#{richDropDownMenuBean.attributes['jointPoint'].value}"
lang="#{richDropDownMenuBean.attributes['lang'].value}"
mode="#{richDropDownMenuBean.attributes['mode'].value}"
onclick="#{richDropDownMenuBean.attributes['onclick'].value}"
@@ -75,13 +78,14 @@
onmouseover="#{richDropDownMenuBean.attributes['onmouseover'].value}"
onmouseup="#{richDropDownMenuBean.attributes['onmouseup'].value}"
onshow="#{richDropDownMenuBean.attributes['onshow'].value}"
-
popupWith="#{richDropDownMenuBean.attributes['popupWith'].value}"
+
popupWidth="#{richDropDownMenuBean.attributes['popupWidth'].value}"
rendered="#{richDropDownMenuBean.attributes['rendered'].value}"
showDelay="#{richDropDownMenuBean.attributes['showDelay'].value}"
showEvent="#{richDropDownMenuBean.attributes['showEvent'].value}"
style="#{richDropDownMenuBean.attributes['style'].value}"
styleClass="#{richDropDownMenuBean.attributes['styleClass'].value}"
title="#{richDropDownMenuBean.attributes['title'].value}"
+
verticalOffset="#{richDropDownMenuBean.attributes['verticalOffset'].value}"
<f:facet name="label">
<h:panelGroup>
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropDownMenu/topMenu.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropDownMenu/topMenu.xhtml 2011-01-26
15:08:33 UTC (rev 21234)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropDownMenu/topMenu.xhtml 2011-01-26
15:24:37 UTC (rev 21235)
@@ -6,7 +6,7 @@
<!--
JBoss, Home of Professional Open Source
-Copyright 2010, Red Hat, Inc. and individual contributors
+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.
@@ -56,8 +56,11 @@
<rich:toolbar id="toolbar" height="26px">
<rich:dropDownMenu id="menu1"
dir="#{richDropDownMenuBean.attributes['dir'].value}"
+
direction="#{richDropDownMenuBean.attributes['direction'].value}"
disabled="#{richDropDownMenuBean.attributes['disabled'].value}"
hideDelay="#{richDropDownMenuBean.attributes['hideDelay'].value}"
+
horizontalOffset="#{richDropDownMenuBean.attributes['horizontalOffset'].value}"
+
jointPoint="#{richDropDownMenuBean.attributes['jointPoint'].value}"
lang="#{richDropDownMenuBean.attributes['lang'].value}"
mode="#{richDropDownMenuBean.attributes['mode'].value}"
onclick="#{richDropDownMenuBean.attributes['onclick'].value}"
@@ -75,13 +78,14 @@
onmouseover="#{richDropDownMenuBean.attributes['onmouseover'].value}"
onmouseup="#{richDropDownMenuBean.attributes['onmouseup'].value}"
onshow="#{richDropDownMenuBean.attributes['onshow'].value}"
-
popupWith="#{richDropDownMenuBean.attributes['popupWith'].value}"
+
popupWidth="#{richDropDownMenuBean.attributes['popupWidth'].value}"
rendered="#{richDropDownMenuBean.attributes['rendered'].value}"
showDelay="#{richDropDownMenuBean.attributes['showDelay'].value}"
showEvent="#{richDropDownMenuBean.attributes['showEvent'].value}"
style="#{richDropDownMenuBean.attributes['style'].value}"
styleClass="#{richDropDownMenuBean.attributes['styleClass'].value}"
title="#{richDropDownMenuBean.attributes['title'].value}"
+
verticalOffset="#{richDropDownMenuBean.attributes['verticalOffset'].value}"
<f:facet name="label">
<h:panelGroup>
@@ -90,13 +94,13 @@
</h:panelGroup>
</f:facet>
- <rich:menuItem label="New"
action="#{richDropDownMenuBean.doNew}"
icon="/resources/images/icons/create_doc.gif"/>
+ <rich:menuItem id="menuItem1" label="New"
action="#{richDropDownMenuBean.doNew}"
icon="/resources/images/icons/create_doc.gif"/>
- <rich:menuItem label="Open"
action="#{richDropDownMenuBean.doOpen}"
icon="/resources/images/icons/open.gif" />
+ <rich:menuItem id="menuItem2" label="Open"
action="#{richDropDownMenuBean.doOpen}"
icon="/resources/images/icons/open.gif" />
- <rich:menuGroup label="Open Recent..."
disabled="true">
- <rich:menuItem label="Save"
action="#{richDropDownMenuBean.doSave}"
icon="/resources/images/icons/save.gif" />
- <rich:menuItem label="Save All"
action="#{richDropDownMenuBean.doSaveAll}">
+ <rich:menuGroup id="menuGroup3" label="Open
Recent..." disabled="true">
+ <rich:menuItem id="menuItem31"
label="Save" action="#{richDropDownMenuBean.doSave}"
icon="/resources/images/icons/save.gif" />
+ <rich:menuItem id="menuItem32" label="Save
All" action="#{richDropDownMenuBean.doSaveAll}">
<f:facet name="icon">
<h:graphicImage library="images/icons"
name="save_all.gif" />
</f:facet>
@@ -105,23 +109,23 @@
<rich:menuSeparator id="menuSeparator11" />
- <rich:menuGroup label="Save As...">
- <rich:menuItem label="Save"
action="#{richDropDownMenuBean.doSave}"
icon="/resources/images/icons/save.gif" />
- <rich:menuItem label="Save All"
action="#{richDropDownMenuBean.doSaveAll}">
+ <rich:menuGroup id="menuGroup4" label="Save
As...">
+ <rich:menuItem id="menuItem41"
label="Save" action="#{richDropDownMenuBean.doSave}"
icon="/resources/images/icons/save.gif" />
+ <rich:menuItem id="menuItem42" label="Save
All" action="#{richDropDownMenuBean.doSaveAll}">
<f:facet name="icon">
<h:graphicImage library="images/icons"
name="save_all.gif" />
</f:facet>
</rich:menuItem>
- <rich:menuItem label="Send Online"
icon="/resources/images/icons/save.gif" disabled="true" />
+ <rich:menuItem id="menuItem43" label="Send
Online" icon="/resources/images/icons/save.gif" disabled="true"
/>
</rich:menuGroup>
- <rich:menuItem label="Print"
action="#{richDropDownMenuBean.doPrint}" disabled="true"/>
+ <rich:menuItem id="menuItem5" label="Print"
action="#{richDropDownMenuBean.doPrint}" disabled="true"/>
- <rich:menuItem label="Close"
action="#{richDropDownMenuBean.doClose}" />
+ <rich:menuItem id="menuItem6" label="Close"
action="#{richDropDownMenuBean.doClose}" />
<rich:menuSeparator id="menuSeparator12" />
- <rich:menuItem label="Exit"
action="#{richDropDownMenuBean.doExit}" />
+ <rich:menuItem id="menuItem7" label="Exit"
action="#{richDropDownMenuBean.doExit}" />
</rich:dropDownMenu>
@@ -131,23 +135,23 @@
Links
</h:panelGrid>
</f:facet>
- <rich:menuItem submitMode="none"
onclick="document.location.href='http://jboss.org/richfaces'...
+ <rich:menuItem id="menuItemRFLink"
submitMode="none"
onclick="document.location.href='http://jboss.org/richfaces'...
<h:outputLink
value="http://jboss.org/richfaces">
<h:outputText value="RichFaces Home
Page"></h:outputText>
</h:outputLink>
</rich:menuItem>
- <rich:menuItem submitMode="none"
onclick="document.location.href='http://community.jboss.org/en/r...
+ <rich:menuItem id="menuItemForumLink"
submitMode="none"
onclick="document.location.href='http://community.jboss.org/en/r...
<h:outputLink
value="http://community.jboss.org/en/richfaces?view=discussions"...
Forum</h:outputLink>
</rich:menuItem>
</rich:dropDownMenu>
<rich:toolbarGroup id="rightGroup"
location="right">
<rich:dropDownMenu id="menu3" label="Search"
direction="bottomLeft" jointPoint="bottomRight"
styleClass="search" mode="client">
- <rich:menuItem>
+ <rich:menuItem id="menuItemInput">
<h:inputText id="searchinput" />
<button type="button">Search</button>
</rich:menuItem>
- <rich:menuItem label="Enter your search criteria
here" disabled="true"/>
+ <rich:menuItem id="menuItemLabel" label="Enter
your search criteria here" disabled="true"/>
</rich:dropDownMenu>
</rich:toolbarGroup>
</rich:toolbar>
@@ -158,7 +162,7 @@
Current Selection:
<h:outputText id="output" style="font-weight:bold"
value="#{richDropDownMenuBean.current}"></h:outputText>
</a4j:outputPanel>
-
+
<br /><br />
</ui:define>
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropDownMenu/TestRichDropDownMenu.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropDownMenu/TestRichDropDownMenu.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropDownMenu/TestRichDropDownMenu.java 2011-01-26
15:24:37 UTC (rev 21235)
@@ -0,0 +1,326 @@
+/*******************************************************************************
+ * 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.richfaces.tests.metamer.ftest.richDropDownMenu;
+
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardHttp;
+import static
org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardNoRequest;
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+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.css.CssProperty;
+import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.jboss.test.selenium.waiting.EventFiredCondition;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.testng.annotations.Test;
+
+/**
+ * Test case for page /faces/components/richDropDownMenu/topMenu.xhtml
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+public class TestRichDropDownMenu extends AbstractMetamerTest {
+
+ private JQueryLocator fileMenu = pjq("div[id$=menu1]");
+ private JQueryLocator fileMenuLabel = pjq("div[id$=menu1]
div.rf-ddm-lbl-dec");
+ private JQueryLocator fileMenuList = pjq("div[id$=menu1_list]");
+ private JQueryLocator group = pjq("div[id$=menuGroup4]");
+ private JQueryLocator groupList = pjq("div[id$=menuGroup4_list]");
+ private JQueryLocator icon = fileMenu.getDescendant(jq("img.pic"));
+ private JQueryLocator emptyIcon = fileMenu.getDescendant(jq(">
span.rf-ddm-itm-ic > div.rf-ddm-emptyIcon"));
+ private JQueryLocator menuItem41 = pjq("div[id$=menuItem41]");
+ private JQueryLocator output = pjq("span[id$=output]");
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath,
"faces/components/richDropDownMenu/topMenu.xhtml");
+ }
+
+ @Test
+ public void testInit() {
+ assertTrue(selenium.isElementPresent(fileMenu), "Drop down menu
\"File\" should be present on the page.");
+ assertTrue(selenium.isVisible(fileMenu), "Drop down menu \"File\"
should be visible on the page.");
+
+ assertTrue(selenium.isElementPresent(group), "Menu group \"Save
As...\" should be present on the page.");
+ assertFalse(selenium.isVisible(group), "Menu group \"Save As...\"
should not be visible on the page.");
+
+ assertFalse(selenium.isDisplayed(fileMenuList), "Menu should not be
expanded.");
+ guardNoRequest(selenium).mouseOver(fileMenuLabel);
+ assertTrue(selenium.isDisplayed(fileMenuList), "Menu should be
expanded.");
+
+ assertTrue(selenium.isElementPresent(group), "Menu group \"Save
As...\" should be present on the page.");
+ assertTrue(selenium.isVisible(group), "Menu group \"Save As...\"
should be visible on the page.");
+
+ assertTrue(selenium.isElementPresent(menuItem41), "Menu item
\"Save\" should be present on the page.");
+ assertFalse(selenium.isVisible(menuItem41), "Menu item \"Save\"
should not be visible on the page.");
+
+ assertFalse(selenium.isDisplayed(groupList), "Submenu should not be
expanded.");
+ guardNoRequest(selenium).mouseOver(group);
+ assertTrue(selenium.isDisplayed(groupList), "Submenu should be
expanded.");
+
+ assertTrue(selenium.isElementPresent(menuItem41), "Menu item
\"Save\" should be present on the page.");
+ assertTrue(selenium.isVisible(menuItem41), "Menu item \"Save\"
should be visible on the page.");
+
+ assertTrue(selenium.isElementPresent(icon), "Icon of menu group should not
be present on the page.");
+
+ assertTrue(selenium.isElementPresent(fileMenuLabel), "Label of menu should
be present on the page.");
+ assertTrue(selenium.isVisible(fileMenuLabel), "Label of menu should be
visible on the page.");
+
+ assertEquals(selenium.getText(fileMenuLabel), "File", "Label of
the menu");
+ }
+
+ @Test
+ public void testDir() {
+ testDir(fileMenu);
+ }
+
+ @Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10305")
+ public void testDisabled() {
+
selenium.click(pjq("input[type=radio][name$=disabledInput][value=true]"));
+ selenium.waitForPageToLoad();
+
+ assertTrue(selenium.belongsClass(fileMenu, "rf-ddm-itm-dis"),
"Menu should have class \"rf-ddm-itm-dis\".");
+ assertTrue(selenium.isElementPresent(emptyIcon), "Empty icon should be
present.");
+ assertFalse(selenium.isElementPresent(icon), "Icon should not be
present.");
+ }
+
+ @Test
+ public void testHideDelay() {
+ selenium.type(pjq("input[id$=hideDelayInput]"), "3000");
+ selenium.waitForPageToLoad();
+
+ selenium.mouseOver(fileMenuLabel);
+ selenium.mouseOut(fileMenuLabel);
+ assertTrue(selenium.isDisplayed(fileMenuList), "Menu should be
expanded.");
+ waitFor(3000);
+ assertFalse(selenium.isDisplayed(fileMenuList), "Menu should not be
expanded.");
+ }
+
+ @Test
+ public void testLang() {
+ testLang(fileMenu);
+ }
+
+ @Test
+ public void testModeAjax() {
+ selenium.mouseOver(fileMenuLabel);
+ guardXhr(selenium).click(menuItem41);
+
+ waitGui.failWith("Output did not
change.").until(textEquals.locator(output).text("Save"));
+ }
+
+ @Test
+ public void testModeNone() {
+ selenium.type(pjq("input[id$=modeInput]"), "");
+ selenium.waitForPageToLoad();
+
+ testModeServer();
+ }
+
+ @Test
+ public void testModeServer() {
+ selenium.type(pjq("input[id$=modeInput]"), "server");
+ selenium.waitForPageToLoad();
+
+ selenium.mouseOver(fileMenuLabel);
+ guardHttp(selenium).click(menuItem41);
+ assertEquals(selenium.getText(output), "Save", "Output did not
change");
+ }
+
+ @Test
+ public void testModeClient() {
+ selenium.type(pjq("input[id$=modeInput]"), "client");
+ selenium.waitForPageToLoad();
+
+ selenium.mouseOver(fileMenuLabel);
+ guardNoRequest(selenium).click(menuItem41);
+ }
+
+ @Test
+ public void testOnclick() {
+ testFireEvent(Event.CLICK, fileMenu);
+ }
+
+ @Test
+ public void testOndblclick() {
+ testFireEvent(Event.DBLCLICK, fileMenu);
+ }
+
+ @Test
+ public void testOngrouphide() {
+ selenium.type(pjq("input[id$=ongrouphideInput]"), "metamerEvents
+= \"grouphide \"");
+ selenium.waitForPageToLoad();
+
+ selenium.mouseOver(fileMenuLabel);
+ selenium.mouseOver(group);
+ waitGui.interval(2000).withDelay(true).failWith("Menu group was not
opened.").until(isDisplayed.locator(groupList));
+ selenium.mouseOut(group);
+
+ waitGui.failWith("Attribute ongrouphide does not work
correctly").until(new EventFiredCondition(new Event("grouphide")));
+ }
+
+ @Test
+ public void testOngroupshow() {
+ selenium.type(pjq("input[id$=ongroupshowInput]"), "metamerEvents
+= \"groupshow \"");
+ selenium.waitForPageToLoad();
+
+ selenium.mouseOver(fileMenuLabel);
+ selenium.mouseOver(group);
+ waitGui.interval(2000).withDelay(true).failWith("Menu group was not
opened.").until(isDisplayed.locator(group));
+
+ waitGui.failWith("Attribute ongroupshow does not work
correctly").until(new EventFiredCondition(new Event("groupshow")));
+ }
+
+ @Test
+ public void testOnhide() {
+ selenium.type(pjq("input[id$=onhideInput]"), "metamerEvents +=
\"hide \"");
+ selenium.waitForPageToLoad();
+
+ selenium.mouseOver(fileMenuLabel);
+ selenium.mouseOut(fileMenuLabel);
+
+ waitGui.failWith("Attribute onhide does not work correctly").until(new
EventFiredCondition(new Event("hide")));
+ }
+
+ @Test
+ public void testOnitemclick() {
+ testFireEvent(Event.CLICK, menuItem41, "itemclick");
+ }
+
+ @Test
+ public void testOnkeydown() {
+ testFireEvent(Event.KEYDOWN, fileMenu);
+ }
+
+ @Test
+ public void testOnkeypress() {
+ testFireEvent(Event.KEYPRESS, fileMenu);
+ }
+
+ @Test
+ public void testOnkeyup() {
+ testFireEvent(Event.KEYUP, fileMenu);
+ }
+
+ @Test
+ public void testOnmousedown() {
+ testFireEvent(Event.MOUSEDOWN, fileMenu);
+ }
+
+ @Test
+ public void testOnmousemove() {
+ testFireEvent(Event.MOUSEMOVE, fileMenu);
+ }
+
+ @Test
+ public void testOnmouseout() {
+ testFireEvent(Event.MOUSEOUT, fileMenu);
+ }
+
+ @Test
+ public void testOnmouseover() {
+ testFireEvent(Event.MOUSEOVER, fileMenu);
+ }
+
+ @Test
+ public void testOnmouseup() {
+ testFireEvent(Event.MOUSEUP, fileMenu);
+ }
+
+ @Test
+ public void testOnshow() {
+ selenium.type(pjq("input[id$=onshowInput]"), "metamerEvents +=
\"show \"");
+ selenium.waitForPageToLoad();
+
+ selenium.mouseOver(fileMenuLabel);
+
+ waitGui.failWith("Attribute onshow does not work correctly").until(new
EventFiredCondition(new Event("show")));
+ }
+
+ @Test
+ public void testPopupWidth() {
+ assertEquals(selenium.getStyle(fileMenuList, CssProperty.WIDTH),
"250px", "Default width of menu");
+
+ selenium.type(pjq("input[id$=popupWidthInput]"), "150");
+ selenium.waitForPageToLoad();
+ assertEquals(selenium.getStyle(fileMenuList, CssProperty.WIDTH),
"150px", "Width of menu");
+
+ selenium.type(pjq("input[id$=popupWidthInput]"), "423");
+ selenium.waitForPageToLoad();
+ assertEquals(selenium.getStyle(fileMenuList, CssProperty.WIDTH),
"423px", "Width of menu");
+ }
+
+ @Test
+ public void testRendered() {
+
selenium.click(pjq("input[type=radio][name$=renderedInput][value=false]"));
+ selenium.waitForPageToLoad();
+
+ assertFalse(selenium.isElementPresent(fileMenu), "Menu should not be
rendered when rendered=false.");
+ assertTrue(selenium.isDisplayed(fileMenu), "Menu should be displayed when
item 1 is not rendered.");
+ }
+
+ @Test
+ public void testShowDelay() {
+ selenium.type(pjq("input[id$=showDelayInput]"), "3000");
+ selenium.waitForPageToLoad();
+
+ selenium.mouseOver(fileMenuLabel);
+ assertFalse(selenium.isDisplayed(fileMenuList), "Menu should not be
expanded.");
+ waitGui.interval(3000).withDelay(true).failWith("Menu was not
opened.").until(isDisplayed.locator(fileMenuList));
+ }
+
+ @Test
+ public void testShowEvent() {
+ selenium.type(pjq("input[id$=showEventInput]"), "click");
+ selenium.waitForPageToLoad();
+
+ selenium.mouseOver(fileMenuLabel);
+ assertFalse(selenium.isDisplayed(fileMenuList), "Menu should not be
expanded.");
+
+ selenium.click(fileMenuLabel);
+ waitGui.withDelay(true).failWith("Menu was not
expanded.").until(isDisplayed.locator(fileMenuList));
+ }
+
+ @Test
+ public void testStyle() {
+ testStyle(fileMenu, "style");
+ }
+
+ @Test
+ public void testStyleClass() {
+ testStyleClass(fileMenu, "styleClass");
+ }
+
+ @Test
+ public void testTitle() {
+ testTitle(fileMenu);
+ }
+}
Property changes on:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropDownMenu/TestRichDropDownMenu.java
___________________________________________________________________
Name: svn:keywords
+ Revision