JBoss Rich Faces SVN: r21185 - in trunk/ui/output/ui/src/main: java/org/richfaces/renderkit/html and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-01-24 15:28:24 -0500 (Mon, 24 Jan 2011)
New Revision: 21185
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTooltip.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TooltipRenderer.java
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tooltip.js
Log:
https://issues.jboss.org/browse/RF-10285
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTooltip.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTooltip.java 2011-01-24 19:38:25 UTC (rev 21184)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTooltip.java 2011-01-24 20:28:24 UTC (rev 21185)
@@ -32,7 +32,12 @@
import org.richfaces.TooltipLayout;
import org.richfaces.TooltipMode;
-import org.richfaces.cdk.annotations.*;
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.EventName;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.cdk.annotations.TagType;
import org.richfaces.context.ExtendedVisitContext;
import org.richfaces.context.ExtendedVisitContextMode;
import org.richfaces.renderkit.MetaComponentRenderer;
@@ -90,9 +95,6 @@
@Attribute(defaultValue = "Positioning.DEFAULT")
public abstract Positioning getDirection();
- @Attribute
- public abstract boolean isDisabled();
-
@Attribute(defaultValue = "true")
public abstract boolean isFollowMouse();
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TooltipRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TooltipRenderer.java 2011-01-24 19:38:25 UTC (rev 21184)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TooltipRenderer.java 2011-01-24 20:28:24 UTC (rev 21185)
@@ -169,7 +169,6 @@
options.put("attached", tooltip.isAttached());
options.put("offset", getOffset(tooltip));
options.put("mode", tooltip.getMode());
- options.put("disabled", tooltip.isDisabled());
options.put("hideDelay", tooltip.getHideDelay());
options.put("hideEvent", tooltip.getHideEvent());
options.put("showDelay", tooltip.getShowDelay());
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tooltip.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tooltip.js 2011-01-24 19:38:25 UTC (rev 21184)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tooltip.js 2011-01-24 20:28:24 UTC (rev 21185)
@@ -39,7 +39,6 @@
offset : [10, 10],
attached : true,
mode : TooltipMode.DEFAULT,
- disabled : false,
hideDelay : 0,
hideEvent : "mouseleave",
showDelay : 0,
13 years, 11 months
JBoss Rich Faces SVN: r21184 - trunk/ui/output/ui/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2011-01-24 14:38:25 -0500 (Mon, 24 Jan 2011)
New Revision: 21184
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java
Log:
RF-10242
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java 2011-01-24 18:00:27 UTC (rev 21183)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java 2011-01-24 19:38:25 UTC (rev 21184)
@@ -569,6 +569,7 @@
@Override
+ @Attribute(hidden=true)
public void setValue(Object value) {
super.setValue(value);
13 years, 11 months
JBoss Rich Faces SVN: r21183 - in modules/tests/metamer/trunk: ftest-source/src/main/java/org/richfaces/tests/metamer/ftest and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-01-24 13:00:27 -0500 (Mon, 24 Jan 2011)
New Revision: 21183
Added:
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichPopupPanelBean.properties
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPopupPanel/
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPopupPanel/TestRichPopupPanel.java
Log:
https://issues.jboss.org/browse/RFPL-676
* added 33 tests for popup panel
Added: modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichPopupPanelBean.properties
===================================================================
--- modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichPopupPanelBean.properties (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichPopupPanelBean.properties 2011-01-24 18:00:27 UTC (rev 21183)
@@ -0,0 +1,4 @@
+attr.domElementAttachment.body=body
+attr.domElementAttachment.form=form
+attr.domElementAttachment.parent=parent
+attr.domElementAttachment.null=
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPopupPanel/TestRichPopupPanel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPopupPanel/TestRichPopupPanel.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPopupPanel/TestRichPopupPanel.java 2011-01-24 18:00:27 UTC (rev 21183)
@@ -0,0 +1,521 @@
+/*******************************************************************************
+ * 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.richPopupPanel;
+
+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.encapsulated.JavaScript;
+import org.jboss.test.selenium.geometry.Offset;
+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/richPopupPanel/simple.xhtml
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+public class TestRichPopupPanel extends AbstractMetamerTest {
+
+ private JQueryLocator openButton = pjq("input[id$=openPanelButton]");
+ private JQueryLocator panel = pjq("div[id$=popupPanel]");
+ private JQueryLocator panelContainer = jq("div.rf-pp-cntr");
+ private JQueryLocator content = jq("div.rf-pp-cnt");
+ private JQueryLocator header = jq("div.rf-pp-hdr");
+ private JQueryLocator controls = jq("div.rf-pp-hdr-cntrls a");
+ private JQueryLocator scroller = jq("div.rf-pp-cnt-scrlr");
+ private JQueryLocator shadow = jq("div.rf-pp-shdw");
+ private JQueryLocator resizerW = jq("div.rf-pp-hndlr-l");
+ private JQueryLocator resizerN = jq("div.rf-pp-hndlr-t");
+ private JQueryLocator resizerE = jq("div.rf-pp-hndlr-r");
+ private JQueryLocator resizerS = jq("div.rf-pp-hndlr-b");
+ private JQueryLocator resizerNW = jq("div.rf-pp-hndlr-tl");
+ private JQueryLocator resizerNE = jq("div.rf-pp-hndlr-tr");
+ private JQueryLocator resizerSW = jq("div.rf-pp-hndlr-bl");
+ private JQueryLocator resizerSE = jq("div.rf-pp-hndlr-br");
+ private JQueryLocator mask = jq("div.rf-pp-shade");
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richPopupPanel/simple.xhtml");
+ }
+
+ @Test
+ public void testInit() {
+ assertTrue(selenium.isElementPresent(openButton), "Button for opening popup should be on the page.");
+ assertTrue(selenium.isElementPresent(panel), "Popup panel is not present on the page.");
+ assertFalse(selenium.isVisible(panel), "Popup panel is visible.");
+
+ selenium.click(openButton);
+ assertTrue(selenium.isVisible(panel), "Popup panel should be visible.");
+ assertTrue(selenium.isVisible(panelContainer), "Popup panel's container should be visible.");
+ assertTrue(selenium.isVisible(header), "Popup panel's header should be visible.");
+ assertTrue(selenium.isVisible(controls), "Popup panel's controls should be visible.");
+ assertTrue(selenium.isVisible(scroller), "Popup panel's scroller should be visible.");
+ assertTrue(selenium.isVisible(shadow), "Popup panel's shadow should be visible.");
+ assertTrue(selenium.isVisible(resizerE), "Popup panel's right resizer should be visible.");
+ assertTrue(selenium.isVisible(resizerN), "Popup panel's top resizer should be visible.");
+ assertTrue(selenium.isVisible(resizerS), "Popup panel's bottom resizer should be visible.");
+ assertTrue(selenium.isVisible(resizerW), "Popup panel's left resizer should be visible.");
+ assertTrue(selenium.isVisible(resizerNE), "Popup panel's top-right resizer should be visible.");
+ assertTrue(selenium.isVisible(resizerNW), "Popup panel's top-left resizer should be visible.");
+ assertTrue(selenium.isVisible(resizerSE), "Popup panel's bottom-right resizer should be visible.");
+ assertTrue(selenium.isVisible(resizerSW), "Popup panel's bottom-left resizer should be visible.");
+ assertFalse(selenium.isElementPresent(mask), "Mask should not be visible.");
+
+ assertEquals(selenium.getText(header), "popup panel header", "Header of popup panel");
+ assertTrue(selenium.getText(content).startsWith("Lorem ipsum"), "Panel's content should start with 'Lorem ipsum'.");
+ assertTrue(selenium.getText(content).endsWith("hide this panel"), "Panel's content should end with 'hide this panel'.");
+ }
+
+ @Test
+ public void testHidePanel() {
+ selenium.click(openButton);
+ assertTrue(selenium.isVisible(panel), "Popup panel is not visible.");
+ selenium.click(controls);
+ assertFalse(selenium.isVisible(panel), "Popup panel is visible.");
+
+ selenium.click(openButton);
+ assertTrue(selenium.isVisible(panel), "Popup panel is not visible.");
+ selenium.click(jq("div.rf-pp-cnt a"));
+ assertFalse(selenium.isVisible(panel), "Popup panel is visible.");
+ }
+
+ @Test
+ public void testMove() {
+ selenium.click(openButton);
+ int panelLeft = selenium.getElementPositionLeft(panelContainer);
+ int panelTop = selenium.getElementPositionTop(panelContainer);
+ int shadowLeft = selenium.getElementPositionLeft(shadow);
+ int shadowTop = selenium.getElementPositionTop(shadow);
+
+ assertEquals(selenium.getStyle(header, new CssProperty("cursor")), "move", "Cursor used when mouse is over panel's header.");
+ selenium.dragAndDrop(header, new Offset(200, -100));
+
+ assertEquals(selenium.getElementPositionLeft(panelContainer), panelLeft + 200, "Panel's position after move to the right (200px).");
+ assertEquals(selenium.getElementPositionLeft(shadow), shadowLeft + 200, "Shadow's position after move to the right (200px).");
+
+ // cannot test top position because of bug in Selenium
+// assertEquals(selenium.getElementPositionTop(panelContainer), panelTop - 100, "Panel's position after move to the top (100px).");
+// assertEquals(selenium.getElementPositionTop(shadow), shadowTop - 100, "Shadow's position after move to the top (100px).");
+ }
+
+ @Test
+ public void testResizeHorizontal() {
+ selenium.click(openButton);
+ int panelWidth = selenium.getElementWidth(panelContainer);
+ int panelHeight = selenium.getElementHeight(panelContainer);
+ int shadowWidth = selenium.getElementWidth(shadow);
+ int shadowHeight = selenium.getElementHeight(shadow);
+
+ assertEquals(selenium.getStyle(resizerW, new CssProperty("cursor")), "w-resize", "Cursor used when mouse is over panel's left resizer.");
+ assertEquals(selenium.getStyle(resizerE, new CssProperty("cursor")), "e-resize", "Cursor used when mouse is over panel's right resizer.");
+
+ selenium.dragAndDrop(resizerW, new Offset(100, 0));
+
+ assertEquals(selenium.getElementWidth(panelContainer), panelWidth - 100, "Panel's width after resizing horizontally (-100px).");
+ assertEquals(selenium.getElementHeight(panelContainer), panelHeight, "Panel's height after resizing horizontally.");
+ assertEquals(selenium.getElementWidth(shadow), shadowWidth - 100, "Shadow's width after resizing horizontally (-100px).");
+ assertEquals(selenium.getElementHeight(shadow), shadowHeight, "Shadow's height after resizing horizontally.");
+
+ selenium.dragAndDrop(resizerE, new Offset(100, 0));
+
+ assertEquals(selenium.getElementWidth(panelContainer), panelWidth, "Panel's width after resizing horizontally (100px).");
+ assertEquals(selenium.getElementHeight(panelContainer), panelHeight, "Panel's height after resizing horizontally.");
+ assertEquals(selenium.getElementWidth(shadow), shadowWidth, "Shadow's width after resizing horizontally (100px).");
+ assertEquals(selenium.getElementHeight(shadow), shadowHeight, "Shadow's height after resizing horizontally.");
+ }
+// @Test
+// public void testResizeVertical() {
+// selenium.click(openButton);
+// int panelWidth = selenium.getElementWidth(panelContainer);
+// int panelHeight = selenium.getElementHeight(panelContainer);
+// int shadowWidth = selenium.getElementWidth(shadow);
+// int shadowHeight = selenium.getElementHeight(shadow);
+//
+// assertEquals(selenium.getStyle(resizerN, new CssProperty("cursor")), "n-resize", "Cursor used when mouse is over panel's top resizer.");
+// assertEquals(selenium.getStyle(resizerS, new CssProperty("cursor")), "s-resize", "Cursor used when mouse is over panel's bottom resizer.");
+//
+// selenium.dragAndDrop(resizerN, new Offset(0, 100));
+//
+// assertEquals(selenium.getElementWidth(panelContainer), panelWidth, "Panel's width after resizing vertically (-100px).");
+// assertEquals(selenium.getElementHeight(panelContainer), panelHeight - 100, "Panel's height after resizing vertically.");
+// assertEquals(selenium.getElementWidth(shadow), shadowWidth, "Shadow's width after resizing vertically (-100px).");
+// assertEquals(selenium.getElementHeight(shadow), shadowHeight - 100, "Shadow's height after resizing vertically.");
+//
+// selenium.dragAndDrop(resizerS, new Offset(0, -100));
+//
+// assertEquals(selenium.getElementWidth(panelContainer), panelWidth, "Panel's width after resizing vertically (100px).");
+// assertEquals(selenium.getElementHeight(panelContainer), panelHeight, "Panel's height after resizing vertically.");
+// assertEquals(selenium.getElementWidth(shadow), shadowWidth, "Shadow's width after resizing vertically (100px).");
+// assertEquals(selenium.getElementHeight(shadow), shadowHeight, "Shadow's height after resizing vertically.");
+// }
+
+ @Test
+ public void testControlsClass() {
+ testStyleClass(pjq("div[id$=popupPanel_header_controls]"), "controlsClass");
+ }
+
+ @Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10249")
+ public void testDomElementAttachment() {
+ selenium.click(openButton);
+ assertTrue(selenium.isElementPresent(jq("body ").getChild(panelContainer)), "Panel container should be attached to the body element.");
+
+ selenium.click(pjq("input[name$=domElementAttachmentInput][value=parent]"));
+ selenium.waitForPageToLoad();
+ selenium.click(openButton);
+ assertTrue(selenium.isElementPresent(panel.getChild(panelContainer)), "Panel container should be attached to the parent element.");
+
+ selenium.click(pjq("input[name$=domElementAttachmentInput][value=]"));
+ selenium.waitForPageToLoad();
+ selenium.click(openButton);
+ assertTrue(selenium.isElementPresent(jq("body").getChild(panelContainer)), "Panel container should be attached to the body element.");
+
+ selenium.click(pjq("input[name$=domElementAttachmentInput][value=form]"));
+ selenium.waitForPageToLoad();
+ selenium.click(openButton);
+ assertTrue(selenium.isElementPresent(jq("form[id*=form]").getChild(panelContainer)), "Panel container should be attached to the form element.");
+ }
+
+ @Test
+ public void testHeader() {
+ selenium.type(pjq("input[type=text][id$=headerInput]"), "new header");
+ selenium.waitForPageToLoad();
+
+ assertEquals(selenium.getText(header), "new header", "Header of the popup panel.");
+ }
+
+ @Test
+ public void testHeaderClass() {
+ testStyleClass(header, "headerClass");
+ }
+
+ @Test
+ public void testHeight() {
+ // TODO rewrite this test so that it will test RF-10251
+ selenium.click(openButton);
+ waitGui.failWith("Panel was not opened.").until(isDisplayed.locator(panel));
+ assertEquals(selenium.getStyle(panelContainer, CssProperty.HEIGHT), "300px", "Height of the panel");
+
+ selenium.type(pjq("input[id$=heightInput]"), "400");
+ selenium.waitForPageToLoad();
+ selenium.click(openButton);
+ waitGui.failWith("Panel was not opened.").until(isDisplayed.locator(panel));
+ assertEquals(selenium.getStyle(panelContainer, CssProperty.HEIGHT), "400px", "Height of the panel");
+ }
+
+ @Test
+ public void testLeft() {
+ double width = Integer.parseInt(selenium.getEval(new JavaScript("window.document.body.clientWidth")));
+ width = (width - 500) / 2;
+ selenium.click(openButton);
+ waitGui.failWith("Panel was not opened.").until(isDisplayed.locator(panel));
+ assertEquals(selenium.getElementPositionLeft(panelContainer), Math.round(width), "Left margin of the panel");
+
+ selenium.type(pjq("input[id$=leftInput]"), "200");
+ selenium.waitForPageToLoad();
+ selenium.click(openButton);
+ waitGui.failWith("Panel was not opened.").until(isDisplayed.locator(panel));
+ assertEquals(selenium.getElementPositionLeft(panelContainer), 200, "Left margin of the panel");
+ }
+
+ @Test
+ public void testModal() {
+ selenium.click(pjq("input[name$=modalInput][value=true]"));
+ selenium.waitForPageToLoad();
+
+ selenium.click(openButton);
+ waitGui.failWith("Panel was not opened.").until(isDisplayed.locator(panel));
+ assertTrue(selenium.isVisible(mask), "Mask should be visible.");
+ }
+
+ @Test
+ public void testMovable() {
+ selenium.click(pjq("input[name$=moveableInput][value=false]"));
+ selenium.waitForPageToLoad();
+
+ selenium.click(openButton);
+ int panelLeft = selenium.getElementPositionLeft(panelContainer);
+ int panelTop = selenium.getElementPositionTop(panelContainer);
+ int shadowLeft = selenium.getElementPositionLeft(shadow);
+ int shadowTop = selenium.getElementPositionTop(shadow);
+
+ assertEquals(selenium.getStyle(header, new CssProperty("cursor")), "default", "Cursor used when mouse is over panel's header.");
+ selenium.dragAndDrop(header, new Offset(200, -100));
+
+ assertEquals(selenium.getElementPositionLeft(panelContainer), panelLeft, "Panel's position after move to the right (200px).");
+ assertEquals(selenium.getElementPositionLeft(shadow), shadowLeft, "Shadow's position after move to the right (200px).");
+ }
+
+ @Test
+ public void testOnbeforehideOnhide() {
+ selenium.type(pjq("input[type=text][id$=onbeforehideInput]"), "metamerEvents += \"beforehide \"");
+ selenium.waitForPageToLoad();
+ selenium.type(pjq("input[type=text][id$=onhideInput]"), "metamerEvents += \"hide \"");
+ selenium.waitForPageToLoad();
+
+ selenium.getEval(new JavaScript("window.metamerEvents = \"\";"));
+
+ selenium.click(openButton);
+ selenium.click(controls);
+
+ String[] events = selenium.getEval(new JavaScript("window.metamerEvents")).split(" ");
+
+ assertEquals(events.length, 2, "2 events should be fired.");
+ assertEquals(events[0], "beforehide", "Attribute onbeforehide doesn't work");
+ assertEquals(events[1], "hide", "Attribute onhide doesn't work");
+ }
+
+ @Test
+ public void testOnbeforeshowOnshow() {
+ selenium.type(pjq("input[type=text][id$=onbeforeshowInput]"), "metamerEvents += \"beforeshow \"");
+ selenium.waitForPageToLoad();
+ selenium.type(pjq("input[type=text][id$=onshowInput]"), "metamerEvents += \"show \"");
+ selenium.waitForPageToLoad();
+
+ selenium.getEval(new JavaScript("window.metamerEvents = \"\";"));
+
+ selenium.click(openButton);
+
+ String[] events = selenium.getEval(new JavaScript("window.metamerEvents")).split(" ");
+
+ assertEquals(events.length, 2, "2 events should be fired.");
+ assertEquals(events[0], "beforeshow", "Attribute onbeforeshow doesn't work");
+ assertEquals(events[1], "show", "Attribute onshow doesn't work");
+ }
+
+ @Test
+ public void testOnmaskclick() {
+ selenium.click(pjq("input[name$=modalInput][value=true]"));
+ selenium.waitForPageToLoad();
+
+ testFireEvent(Event.CLICK, mask, "maskclick");
+ }
+
+ @Test
+ public void testOnmaskcontextmenu() {
+ selenium.click(pjq("input[name$=modalInput][value=true]"));
+ selenium.waitForPageToLoad();
+
+ testFireEvent(new Event("contextmenu"), mask, "maskcontextmenu");
+ }
+
+ @Test
+ public void testOnmaskdblclick() {
+ selenium.click(pjq("input[name$=modalInput][value=true]"));
+ selenium.waitForPageToLoad();
+
+ testFireEvent(Event.DBLCLICK, mask, "maskdblclick");
+ }
+
+ @Test
+ public void testOnmaskmousedown() {
+ selenium.click(pjq("input[name$=modalInput][value=true]"));
+ selenium.waitForPageToLoad();
+
+ testFireEvent(Event.MOUSEDOWN, mask, "maskmousedown");
+ }
+
+ @Test
+ public void testOnmaskmousemove() {
+ selenium.click(pjq("input[name$=modalInput][value=true]"));
+ selenium.waitForPageToLoad();
+
+ testFireEvent(Event.MOUSEMOVE, mask, "maskmousemove");
+ }
+
+ @Test
+ public void testOnmaskmouseout() {
+ selenium.click(pjq("input[name$=modalInput][value=true]"));
+ selenium.waitForPageToLoad();
+
+ testFireEvent(Event.MOUSEOUT, mask, "maskmouseout");
+ }
+
+ @Test
+ public void testOnmaskmouseover() {
+ selenium.click(pjq("input[name$=modalInput][value=true]"));
+ selenium.waitForPageToLoad();
+
+ testFireEvent(Event.MOUSEOVER, mask, "maskmouseover");
+ }
+
+ @Test
+ public void testOnmaskmouseup() {
+ selenium.click(pjq("input[name$=modalInput][value=true]"));
+ selenium.waitForPageToLoad();
+
+ testFireEvent(Event.MOUSEUP, mask, "maskmouseup");
+ }
+
+ @Test
+ public void testOnmove() {
+ selenium.type(pjq("input[id$=onmoveInput]"), "metamerEvents += \"move \"");
+ selenium.waitForPageToLoad();
+
+ selenium.dragAndDrop(header, new Offset(1, 0));
+
+ waitGui.failWith("Attribute onmove does not work correctly.").until(new EventFiredCondition(new Event("move")));
+ }
+
+ @Test
+ public void testOnresize() {
+ selenium.type(pjq("input[id$=onresizeInput]"), "metamerEvents += \"resize \"");
+ selenium.waitForPageToLoad();
+
+ selenium.dragAndDrop(resizerE, new Offset(100, 0));
+
+ waitGui.failWith("Attribute onresize does not work correctly.").until(new EventFiredCondition(new Event("resize")));
+ }
+
+ @Test
+ public void testRendered() {
+ selenium.click(pjq("input[type=radio][name$=renderedInput][value=false]"));
+ selenium.waitForPageToLoad();
+
+ assertFalse(selenium.isElementPresent(panel), "Popup panel should not be rendered when rendered=false.");
+ }
+
+ @Test
+ public void testResizeable() {
+ selenium.click(pjq("input[name$=resizeableInput][value=false]"));
+ selenium.waitForPageToLoad();
+
+ assertFalse(selenium.isElementPresent(resizerE), "Popup panel's right resizer should not be present on the page.");
+ assertFalse(selenium.isElementPresent(resizerN), "Popup panel's top resizer should not be present on the page.");
+ assertFalse(selenium.isElementPresent(resizerS), "Popup panel's bottom resizer should not be present on the page.");
+ assertFalse(selenium.isElementPresent(resizerW), "Popup panel's left resizer should not be present on the page.");
+ assertFalse(selenium.isElementPresent(resizerNE), "Popup panel's top-right resizer should not be present on the page.");
+ assertFalse(selenium.isElementPresent(resizerNW), "Popup panel's top-left resizer should not be present on the page.");
+ assertFalse(selenium.isElementPresent(resizerSE), "Popup panel's bottom-right resizer should not be present on the page.");
+ assertFalse(selenium.isElementPresent(resizerSW), "Popup panel's bottom-left resizer should not be present on the page.");
+ }
+
+ @Test
+ public void testShadowDepth() {
+ selenium.type(pjq("input[id$=shadowDepthInput]"), "15");
+ selenium.waitForPageToLoad();
+
+ selenium.click(openButton);
+ waitGui.failWith("Panel was not opened.").until(isDisplayed.locator(panel));
+ int panelPos = selenium.getElementPositionLeft(panelContainer);
+ int shadowPos = selenium.getElementPositionLeft(shadow);
+ assertEquals(shadowPos - panelPos, 15, "Depth of the shadow (left-right).");
+
+ panelPos = selenium.getElementPositionTop(panelContainer);
+ shadowPos = selenium.getElementPositionTop(shadow);
+ assertEquals(shadowPos - panelPos, 15, "Depth of the shadow (top-bottom).");
+
+ selenium.type(pjq("input[id$=shadowDepthInput]"), "0");
+ selenium.waitForPageToLoad();
+
+ selenium.click(openButton);
+ waitGui.failWith("Panel was not opened.").until(isDisplayed.locator(panel));
+ panelPos = selenium.getElementPositionLeft(panelContainer);
+ shadowPos = selenium.getElementPositionLeft(shadow);
+ assertEquals(shadowPos - panelPos, 0, "Depth of the shadow (left-right).");
+
+ panelPos = selenium.getElementPositionTop(panelContainer);
+ shadowPos = selenium.getElementPositionTop(shadow);
+ assertEquals(shadowPos - panelPos, 0, "Depth of the shadow (top-bottom).");
+ }
+
+ @Test
+ public void testShadowOpacity() {
+ selenium.click(openButton);
+ waitGui.failWith("Panel was not opened.").until(isDisplayed.locator(panel));
+ assertEquals(selenium.getStyle(shadow, new CssProperty("opacity")), "0.1", "Default shadow opacity");
+
+ selenium.type(pjq("input[id$=shadowOpacityInput]"), "0.7");
+ selenium.waitForPageToLoad();
+
+ selenium.click(openButton);
+ waitGui.failWith("Panel was not opened.").until(isDisplayed.locator(panel));
+ assertEquals(selenium.getStyle(shadow, new CssProperty("opacity")), "0.7", "Shadow opacity");
+ }
+
+ @Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10245")
+ public void testStyle() {
+ testStyle(panelContainer, "style");
+ }
+
+ @Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10245")
+ public void testStyleClass() {
+ testStyleClass(panelContainer, "styleClass");
+ }
+
+ @Test
+ public void testTop() {
+ double top = Integer.parseInt(selenium.getEval(new JavaScript("window.document.body.clientHeight")));
+ top = (top - 300) / 2;
+ selenium.click(openButton);
+ waitGui.failWith("Panel was not opened.").until(isDisplayed.locator(panel));
+ assertEquals(selenium.getElementPositionTop(panelContainer), Math.round(top), "Top margin of the panel");
+
+ selenium.type(pjq("input[id$=topInput]"), "200");
+ selenium.waitForPageToLoad();
+ selenium.click(openButton);
+ waitGui.failWith("Panel was not opened.").until(isDisplayed.locator(panel));
+ assertEquals(selenium.getElementPositionTop(panelContainer), 200, "Top margin of the panel");
+ }
+
+ @Test
+ public void testWidth() {
+ // TODO rewrite this test so that it will test RF-10251
+ selenium.click(openButton);
+ waitGui.failWith("Panel was not opened.").until(isDisplayed.locator(panel));
+ assertEquals(selenium.getStyle(panelContainer, CssProperty.WIDTH), "500px", "Width of the panel");
+
+ selenium.type(pjq("input[id$=widthInput]"), "400");
+ selenium.waitForPageToLoad();
+ selenium.click(openButton);
+ waitGui.failWith("Panel was not opened.").until(isDisplayed.locator(panel));
+ assertEquals(selenium.getStyle(panelContainer, CssProperty.WIDTH), "400px", "Width of the panel");
+ }
+
+ @Test
+ public void testZindex() {
+ selenium.click(openButton);
+ waitGui.failWith("Panel was not opened.").until(isDisplayed.locator(panel));
+ assertEquals(selenium.getStyle(panelContainer, new CssProperty("z-index")), "0", "Zindex of the panel");
+
+ selenium.type(pjq("input[id$=zindexInput]"), "30");
+ selenium.waitForPageToLoad();
+ selenium.click(openButton);
+ waitGui.failWith("Panel was not opened.").until(isDisplayed.locator(panel));
+ assertEquals(selenium.getStyle(panelContainer, new CssProperty("z-index")), "30", "Z-index of the panel");
+ }
+}
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPopupPanel/TestRichPopupPanel.java
___________________________________________________________________
Name: svn:keywords
+ Revision
13 years, 11 months
JBoss Rich Faces SVN: r21182 - trunk/cdk/attributes/src/main/resources/META-INF/cdk/attributes.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2011-01-24 11:58:22 -0500 (Mon, 24 Jan 2011)
New Revision: 21182
Modified:
trunk/cdk/attributes/src/main/resources/META-INF/cdk/attributes/command-button-props.xml
Log:
RF-9946
Modified: trunk/cdk/attributes/src/main/resources/META-INF/cdk/attributes/command-button-props.xml
===================================================================
--- trunk/cdk/attributes/src/main/resources/META-INF/cdk/attributes/command-button-props.xml 2011-01-24 16:57:46 UTC (rev 21181)
+++ trunk/cdk/attributes/src/main/resources/META-INF/cdk/attributes/command-button-props.xml 2011-01-24 16:58:22 UTC (rev 21182)
@@ -22,6 +22,21 @@
<property>
<description>
+ Flag indicating that this element must never
+ receive focus or be included in a subsequent
+ submit.
+ </description>
+ <display-name>Disabled Flag</display-name>
+ <icon />
+ <property-name>disabled</property-name>
+ <property-class>boolean</property-class>
+ <property-extension>
+ <cdk:pass-through>false</cdk:pass-through>
+ </property-extension>
+ </property>
+
+ <property>
+ <description>
Javascript code executed when a pointer button is
clicked over this element.
</description>
13 years, 11 months
JBoss Rich Faces SVN: r21181 - in trunk: examples/misc-demo/src/main/webapp and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2011-01-24 11:57:46 -0500 (Mon, 24 Jan 2011)
New Revision: 21181
Modified:
trunk/examples/misc-demo/pom.xml
trunk/examples/misc-demo/src/main/webapp/index.jsp
trunk/ui/misc/ui/src/main/java/org/richfaces/component/behavior/ComponentControlBehavior.java
trunk/ui/misc/ui/src/main/java/org/richfaces/renderkit/ComponentControlBehaviorRenderer.java
trunk/ui/misc/ui/src/main/resources/META-INF/resources/org.richfaces/component-control.js
Log:
http://jira.jboss.com/jira/browse/RF-10080
Modified: trunk/examples/misc-demo/pom.xml
===================================================================
--- trunk/examples/misc-demo/pom.xml 2011-01-24 16:46:58 UTC (rev 21180)
+++ trunk/examples/misc-demo/pom.xml 2011-01-24 16:57:46 UTC (rev 21181)
@@ -47,6 +47,10 @@
<groupId>org.richfaces.ui.misc</groupId>
<artifactId>richfaces-ui-misc-ui</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.input</groupId>
+ <artifactId>richfaces-ui-input-ui</artifactId>
+ </dependency>
<!-- todo remove this dependency -->
<dependency>
<groupId>org.richfaces.ui.core</groupId>
Modified: trunk/examples/misc-demo/src/main/webapp/index.jsp
===================================================================
--- trunk/examples/misc-demo/src/main/webapp/index.jsp 2011-01-24 16:46:58 UTC (rev 21180)
+++ trunk/examples/misc-demo/src/main/webapp/index.jsp 2011-01-24 16:57:46 UTC (rev 21181)
@@ -6,6 +6,7 @@
<body>
<a href="pages/index.jsf">Facelets</a><br />
+ <a href="pages/componentControl.jsf">componentControl dev sample</a><br />
</body>
</html>
\ No newline at end of file
Modified: trunk/ui/misc/ui/src/main/java/org/richfaces/component/behavior/ComponentControlBehavior.java
===================================================================
--- trunk/ui/misc/ui/src/main/java/org/richfaces/component/behavior/ComponentControlBehavior.java 2011-01-24 16:46:58 UTC (rev 21180)
+++ trunk/ui/misc/ui/src/main/java/org/richfaces/component/behavior/ComponentControlBehavior.java 2011-01-24 16:57:46 UTC (rev 21181)
@@ -49,7 +49,7 @@
private List<UIComponent> children;
enum PropertyKeys {
- event, target, selector, operation
+ event, target, selector, operation, onbeforeoperation
}
public List<UIComponent> getChildren() {
@@ -94,6 +94,15 @@
public void setOperation(String operation) {
getStateHelper().put(PropertyKeys.operation, operation);
}
+
+ @Attribute
+ public String getOnbeforeoperation() {
+ return (String) getStateHelper().eval(PropertyKeys.onbeforeoperation);
+ }
+
+ public void setOnbeforeoperation(String onbeforeoperation) {
+ getStateHelper().put(PropertyKeys.onbeforeoperation, onbeforeoperation);
+ }
@Override
public String getRendererType() {
@@ -108,6 +117,8 @@
setTarget((String) value);
} else if (compare(PropertyKeys.selector, name)) {
setSelector((String) value);
+ } else if (compare(PropertyKeys.onbeforeoperation, name)) {
+ setOnbeforeoperation((String) value);
}
}
}
Modified: trunk/ui/misc/ui/src/main/java/org/richfaces/renderkit/ComponentControlBehaviorRenderer.java
===================================================================
--- trunk/ui/misc/ui/src/main/java/org/richfaces/renderkit/ComponentControlBehaviorRenderer.java 2011-01-24 16:46:58 UTC (rev 21180)
+++ trunk/ui/misc/ui/src/main/java/org/richfaces/renderkit/ComponentControlBehaviorRenderer.java 2011-01-24 16:57:46 UTC (rev 21181)
@@ -75,6 +75,8 @@
private static final String PARAM_TARGET = "target";
private static final String PARAM_SELECTOR = "selector";
+
+ private static final String PARAM_ONBEFOREOPERATION = "onbeforeoperation";
private static final Pattern COMMA_SEPARATED_STRING = Pattern.compile("\\s*,\\s*");
@@ -106,6 +108,13 @@
parameters.put(PARAM_CALLBACK, callback);
parameters.put(PARAM_TARGET, resolveTargets(facesContext, targetSourceString));
parameters.put(PARAM_SELECTOR, selector);
+
+ String onBeforeOperation = controlBehavior.getOnbeforeoperation();
+ if (null!=onBeforeOperation && !onBeforeOperation.isEmpty()) {
+ JSFunctionDefinition onBeforeOperationFunction = new JSFunctionDefinition(new JSReference(REF_EVENT));
+ onBeforeOperationFunction.addToBody(onBeforeOperation);
+ parameters.put(PARAM_ONBEFOREOPERATION, onBeforeOperationFunction);
+ }
// execution function
JSFunction eventFunction = new JSFunction(FUNC_NAME);
Modified: trunk/ui/misc/ui/src/main/resources/META-INF/resources/org.richfaces/component-control.js
===================================================================
--- trunk/ui/misc/ui/src/main/resources/META-INF/resources/org.richfaces/component-control.js 2011-01-24 16:46:58 UTC (rev 21180)
+++ trunk/ui/misc/ui/src/main/resources/META-INF/resources/org.richfaces/component-control.js 2011-01-24 16:57:46 UTC (rev 21181)
@@ -11,6 +11,11 @@
var selector = parameters.selector;
var callback = parameters.callback;
+ if (parameters.onbeforeoperation && typeof parameters.onbeforeoperation == "function") {
+ var result = parameters.onbeforeoperation(event);
+ if (result=="false" || result==0) return;
+ }
+
if (targetList) {
for (var i = 0; i < targetList.length; i++) {
var component = document.getElementById(targetList[i]);
13 years, 11 months
JBoss Rich Faces SVN: r21180 - trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2011-01-24 11:46:58 -0500 (Mon, 24 Jan 2011)
New Revision: 21180
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js
Log:
RF-10218 Menu group: attributes direction and jointPoint don't work
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js 2011-01-24 15:57:53 UTC (rev 21179)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js 2011-01-24 16:46:58 UTC (rev 21180)
@@ -54,20 +54,15 @@
var positionOffset = [
groupOptions[i].horizontalOffset,
groupOptions[i].verticalOffset];
- var onshow = groupOptions[i].onshow;
- var onhide = groupOptions[i].onhide;
-
- //var eventType = "mouseover";
-
if (null != groupId) {
- // var popup = new RichFaces.ui.Popup(groupId +
- // '_list', options);
this.groupList[groupId] = new RichFaces.ui.MenuGroup(groupId,
{
rootMenuId : this.id,
- onshow : onshow,
- onhide : onhide,
- positionOffset: positionOffset
+ onshow : groupOptions[i].onshow,
+ onhide : groupOptions[i].onhide,
+ positionOffset: positionOffset,
+ jointPoint : groupOptions[i].jointPoint,
+ direction : groupOptions[i].direction
});
}
}
13 years, 11 months
JBoss Rich Faces SVN: r21179 - in modules/tests/metamer/trunk: ftest/src/test/resources and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-24 10:57:53 -0500 (Mon, 24 Jan 2011)
New Revision: 21179
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TooltipAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TooltipModel.java
Modified:
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTooltipBean.properties
modules/tests/metamer/trunk/ftest/src/test/resources/testng-output.xml
Log:
rich:tooltip - automated Simple sample (RFPL-884)
Modified: modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTooltipBean.properties
===================================================================
--- modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTooltipBean.properties 2011-01-24 15:56:48 UTC (rev 21178)
+++ modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTooltipBean.properties 2011-01-24 15:57:53 UTC (rev 21179)
@@ -2,6 +2,7 @@
attr.layout.block=block
attr.direction.auto=auto
attr.direction.topLeft=topLeft
+attr.direction.topRight=topRight
attr.direction.bottomLeft=bottomLeft
attr.direction.bottomRight=bottomRight
attr.direction.autoLeft=autoLeft
@@ -13,10 +14,14 @@
attr.mode.ajax=ajax
attr.jointPoint.auto=auto
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.null=
\ No newline at end of file
+attr.jointPoint.null=
+attr.dir.ltr=ltr
+attr.dir.rtl=rtl
+attr.dir.null=
\ No newline at end of file
Modified: modules/tests/metamer/trunk/ftest/src/test/resources/testng-output.xml
===================================================================
--- modules/tests/metamer/trunk/ftest/src/test/resources/testng-output.xml 2011-01-24 15:56:48 UTC (rev 21178)
+++ modules/tests/metamer/trunk/ftest/src/test/resources/testng-output.xml 2011-01-24 15:57:53 UTC (rev 21179)
@@ -14,6 +14,7 @@
<package name="org.richfaces.tests.metamer.ftest.richTogglePanelItem" />
<package name="org.richfaces.tests.metamer.ftest.richToolbar" />
<package name="org.richfaces.tests.metamer.ftest.richToolbarGroup" />
+ <package name="org.richfaces.tests.metamer.ftest.richTooltip" />
</packages>
</test>
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipSimple.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipSimple.java 2011-01-24 15:57:53 UTC (rev 21179)
@@ -0,0 +1,413 @@
+/*******************************************************************************
+ * 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.richTooltip;
+
+import static javax.faces.event.PhaseId.APPLY_REQUEST_VALUES;
+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.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.locator.LocatorFactory.jq;
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.jboss.test.selenium.utils.text.SimplifiedFormat.format;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
+
+import java.net.URL;
+
+import org.jboss.test.selenium.css.CssProperty;
+import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.geometry.Dimension;
+import org.jboss.test.selenium.geometry.Point;
+import org.jboss.test.selenium.javascript.JQueryScript;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.richfaces.TooltipLayout;
+import org.richfaces.TooltipMode;
+import org.richfaces.component.Positioning;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+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 TestTooltipSimple extends AbstractMetamerTest {
+
+ private static final int EVENT_OFFSET = 10;
+ private static final int PRESET_OFFSET = 5;
+
+ TooltipAttributes attributes = new TooltipAttributes();
+ JQueryLocator panel = pjq("div[id$=panel]");
+ TooltipModel tooltip = new TooltipModel(panel.getChild(jq("* >.rf-tt")), panel);
+
+ Point eventPosition;
+
+ @Inject
+ @Use(empty = true)
+ Positioning direction;
+
+ Integer[] offsets = new Integer[] { 0, PRESET_OFFSET, -PRESET_OFFSET };
+
+ @Inject
+ @Use(ints = 0)
+ Integer verticalOffset;
+
+ @Inject
+ @Use(ints = 0)
+ Integer horizontalOffset;
+
+ @Inject
+ @Use(empty = true)
+ Event domEvent;
+ Event[] domEvents = { CLICK, DBLCLICK, MOUSEDOWN, MOUSEMOVE, MOUSEOUT, MOUSEOVER, MOUSEUP };
+
+ @Inject
+ @Use(empty = true)
+ Boolean followMouse = true;
+
+ @Inject
+ @Use(empty = true)
+ Integer presetDelay;
+
+ @Inject
+ @Use(empty = true)
+ TooltipLayout layout;
+
+ @Inject
+ @Use(empty = true)
+ TooltipMode mode;
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richTooltip/simple.xhtml");
+ }
+
+ @Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10282")
+ public void testLifecycle() {
+ attributes.setMode(TooltipMode.ajax);
+ tooltip.recall();
+ phaseInfo.assertPhases(RESTORE_VIEW, APPLY_REQUEST_VALUES, RENDER_RESPONSE);
+ }
+
+ @Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10285")
+ public void testData() {
+ fail("TODO needs comment ");
+ }
+
+ @Test
+ public void testDir() {
+ super.testDir(tooltip);
+ }
+
+ @Test
+ @Uses({ @Use(field = "direction", enumeration = true), @Use(field = "verticalOffset", value = "offsets"),
+ @Use(field = "horizontalOffset", value = "offsets") })
+ public void testPositioning() {
+ attributes.setDirection(direction);
+ attributes.setHorizontalOffset(horizontalOffset);
+ attributes.setVerticalOffset(verticalOffset);
+
+ if (direction == Positioning.auto) {
+ direction = Positioning.topRight;
+ }
+
+ recallTooltipInRightBottomCornerOfPanel(0, 0);
+
+ final Point tooltipPosition = selenium.getElementPosition(tooltip);
+ final Dimension tooltipDimension = selenium.getElementDimension(tooltip);
+
+ if (getHorizontalAlignment() != null) {
+ switch (getHorizontalAlignment()) {
+ case RIGHT:
+ assertEquals(tooltipPosition.getX(), eventPosition.getX() + horizontalOffset);
+ break;
+ case LEFT:
+ assertEquals(tooltipPosition.getX() + tooltipDimension.getWidth(), eventPosition.getX()
+ - horizontalOffset);
+ default:
+ }
+ }
+
+ if (getVerticalAlignment() != null) {
+ switch (getVerticalAlignment()) {
+ case BOTTOM:
+ assertEquals(tooltipPosition.getY(), eventPosition.getY() + verticalOffset);
+ break;
+ case TOP:
+ assertEquals(tooltipPosition.getY() + tooltipDimension.getHeight(), eventPosition.getY()
+ - verticalOffset);
+ default:
+ }
+ }
+ }
+
+ @Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10283")
+ public void testDisabled() {
+ fail("TODO needs comment ");
+ }
+
+ @Test
+ public void testExecute() {
+ attributes.setExecute("@this executeChecker");
+ attributes.setMode(TooltipMode.ajax);
+
+ tooltip.recall();
+
+ phaseInfo.assertListener(UPDATE_MODEL_VALUES, "executeChecker");
+ }
+
+ @Test
+ @Use(field = "followMouse", booleans = { true, false })
+ public void testFollowMouse() {
+ attributes.setFollowMouse(followMouse);
+
+ recallTooltipInRightBottomCornerOfPanel(0, 0);
+
+ Point initialPosition = selenium.getElementPosition(tooltip);
+
+ recallTooltipInRightBottomCornerOfPanel(-5, -5);
+
+ Point nextPosition = selenium.getElementPosition(tooltip);
+
+ int expectedOffset = (followMouse) ? -5 : 0;
+
+ assertEquals(nextPosition.getX() - initialPosition.getX(), expectedOffset);
+ assertEquals(nextPosition.getY() - initialPosition.getY(), expectedOffset);
+ }
+
+ @Test
+ @Use(field = "presetDelay", ints = { 0, 1000, 5000 })
+ public void testHideDelay() {
+
+ attributes.setMode(TooltipMode.ajax);
+ attributes.setHideDelay(presetDelay);
+
+ tooltip.recall();
+ long delay = System.currentTimeMillis();
+ tooltip.hide();
+ waitGui.timeout(6000).until(isNotDisplayed.locator(tooltip));
+ delay = System.currentTimeMillis() - delay;
+
+ long deviation = Math.abs(presetDelay - delay);
+ long maxDeviation = Math.max(200, presetDelay / 2);
+
+ assertTrue(deviation < maxDeviation,
+ format("deviation '{0}' is greater than maxDeviation '{1}'", deviation, maxDeviation));
+ }
+
+ @Test
+ public void testHideEvent() {
+ attributes.setHideEvent("mouseup");
+
+ tooltip.recall();
+ waitGui.until(isDisplayed.locator(tooltip));
+
+ selenium.mouseUpAt(panel, new Point(5, 5));
+ waitGui.until(isNotDisplayed.locator(tooltip));
+ }
+
+ @Test
+ public void testLang() {
+ super.testLang(tooltip);
+ }
+
+ @Test
+ @Use(field = "layout", enumeration = true)
+ public void testLayout() {
+ attributes.setLayout(layout);
+
+ String expectedTagName = (layout == TooltipLayout.block) ? "div" : "span";
+
+ String actualTagName = selenium.getEval(JQueryScript.jqScript(tooltip, "get(0).tagName"));
+ actualTagName = actualTagName.toLowerCase();
+
+ assertEquals(actualTagName, expectedTagName);
+ }
+
+ @Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10287")
+ public void testLimitRender() {
+ attributes.setLimitRender(true);
+ attributes.setRender("@this renderChecker");
+ attributes.setMode(TooltipMode.ajax);
+
+ retrieveRenderChecker.initializeValue();
+
+ tooltip.recall();
+
+ assertTrue(retrieveRenderChecker.isValueChanged());
+ }
+
+ @Test
+ @Use(field = "mode", enumeration = true)
+ public void testMode() {
+ attributes.setMode(mode);
+
+ retrieveRequestTime.initializeValue();
+
+ tooltip.recall();
+ waitAjax.until(isDisplayed.locator(tooltip));
+ assertEquals(retrieveRequestTime.isValueChanged(), mode == TooltipMode.ajax);
+
+ retrieveRequestTime.initializeValue();
+ tooltip.hide();
+ waitGui.until(isNotDisplayed.locator(tooltip));
+ assertFalse(retrieveRequestTime.isValueChanged());
+ }
+
+ @Test
+ @Use(field = "domEvent", value = "domEvents")
+ public void testDomEvents() {
+ tooltip.recall();
+ waitGui.until(isDisplayed.locator(tooltip));
+
+ testFireEvent(domEvent, tooltip);
+ }
+
+ @Test
+ public void testRendered() {
+ attributes.setRendered(false);
+
+ assertFalse(selenium.isElementPresent(tooltip));
+ }
+
+ @Test
+ @Use(field = "presetDelay", ints = { 0, 1000, 5000 })
+ public void testShowDelay() {
+
+ attributes.setMode(TooltipMode.client);
+ attributes.setShowDelay(presetDelay);
+
+ long delay = System.currentTimeMillis();
+ tooltip.recall();
+ waitGui.timeout(6000).until(isDisplayed.locator(tooltip));
+ delay = System.currentTimeMillis() - delay;
+
+ long deviation = Math.abs(presetDelay - delay);
+ long maxDeviation = Math.max(200, presetDelay / 2);
+
+ assertTrue(deviation < maxDeviation,
+ format("deviation '{0}' is greater than maxDeviation '{1}'", deviation, maxDeviation));
+ }
+
+ @Test
+ public void testShowEvent() {
+ attributes.setShowEvent("mouseup");
+
+ selenium.mouseUpAt(panel, new Point(5, 5));
+ waitGui.until(isDisplayed.locator(tooltip));
+ }
+
+ @Test
+ public void testStatus() {
+ attributes.setStatus("statusChecker");
+ attributes.setMode(TooltipMode.ajax);
+
+ retrieveStatusChecker.initializeValue();
+ tooltip.recall();
+ assertTrue(retrieveStatusChecker.isValueChanged());
+
+ }
+
+ @Test
+ public void testStyle() {
+ super.testStyle(tooltip, "style");
+ }
+
+ @Test
+ public void testStyleClass() {
+ super.testStyleClass(tooltip, "styleClass");
+ }
+
+ @Test
+ public void testTitle() {
+ super.testTitle(tooltip);
+ }
+
+ @Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10286")
+ public void testZindex() {
+ attributes.setZindex(10);
+
+ String zindex = selenium.getStyle(tooltip, CssProperty.Z_INDEX);
+ assertEquals(zindex, "10");
+ }
+
+ private void recallTooltipInRightBottomCornerOfPanel(int offsetX, int offsetY) {
+ final Point panelPosition = selenium.getElementPosition(panel);
+ final Dimension panelDimension = selenium.getElementDimension(panel);
+
+ eventPosition = new Point(panelPosition.getX() + panelDimension.getWidth() - EVENT_OFFSET, panelPosition.getY()
+ + panelDimension.getHeight() - EVENT_OFFSET);
+
+ tooltip.recall(panelDimension.getWidth() - EVENT_OFFSET + offsetX, panelDimension.getHeight() - EVENT_OFFSET
+ + offsetY);
+ }
+
+ private HorizontalAlignment getHorizontalAlignment() {
+ if (direction != null) {
+ if (direction.toString().toLowerCase().contains("left")) {
+ return HorizontalAlignment.LEFT;
+ }
+ if (direction.toString().toLowerCase().contains("right")) {
+ return HorizontalAlignment.RIGHT;
+ }
+ }
+ return null;
+ }
+
+ private VerticalAlignment getVerticalAlignment() {
+ if (direction != null) {
+ if (direction.toString().contains("top")) {
+ return VerticalAlignment.TOP;
+ }
+ if (direction.toString().contains("bottom")) {
+ return VerticalAlignment.BOTTOM;
+ }
+ }
+ return null;
+ }
+
+ private enum HorizontalAlignment {
+ LEFT, RIGHT
+ }
+
+ private enum VerticalAlignment {
+ TOP, BOTTOM
+ }
+
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TooltipAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TooltipAttributes.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TooltipAttributes.java 2011-01-24 15:57:53 UTC (rev 21179)
@@ -0,0 +1,150 @@
+/*******************************************************************************
+ * 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.richTooltip;
+
+import org.richfaces.TooltipLayout;
+import org.richfaces.TooltipMode;
+import org.richfaces.component.Positioning;
+import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TooltipAttributes extends AbstractComponentAttributes {
+
+ public void setData(String data) {
+ setProperty("data", data);
+ }
+
+ public void setDir(String dir) {
+ setProperty("dir", dir);
+ }
+
+ public void setDirection(Positioning direction) {
+ setProperty("direction", direction);
+ }
+
+ public void setDisabled(Boolean disabled) {
+ setProperty("disabled", disabled);
+ }
+
+ public void setExecute(String execute) {
+ setProperty("execute", execute);
+ }
+
+ public void setFollowMouse(Boolean followMouse) {
+ setProperty("followMouse", followMouse);
+ }
+
+ public void setHideDelay(Integer hideDelay) {
+ setProperty("hideDelay", hideDelay);
+ }
+
+ public void setHideEvent(String hideEvent) {
+ setProperty("hideEvent", hideEvent);
+ }
+
+ public void setHorizontalOffset(Integer horizontalOffset) {
+ setProperty("horizontalOffset", horizontalOffset);
+ }
+
+ public void setJointPoint(Positioning positioning) {
+ setProperty("positioning", positioning);
+ }
+
+ public void setLang(String lang) {
+ setProperty("lang", lang);
+ }
+
+ public void setLayout(TooltipLayout layout) {
+ setProperty("layout", layout);
+ }
+
+ public void setLimitRender(Boolean limitRender) {
+ setProperty("limitRender", limitRender);
+ }
+
+ public void setMode(TooltipMode mode) {
+ setProperty("mode", mode);
+ }
+
+ public void setOnbeforehide(String onbeforehide) {
+ setProperty("onbeforehide", onbeforehide);
+ }
+
+ public void setOnbeforeshow(String onbeforeshow) {
+ setProperty("onbeforeshow", onbeforeshow);
+ }
+
+ public void setOnhide(String onhide) {
+ setProperty("onhide", onhide);
+ }
+
+ public void setOnshow(String onshow) {
+ setProperty("onshow", onshow);
+ }
+
+ public void setRender(String render) {
+ setProperty("render", render);
+ }
+
+ public void setRendered(Boolean rendered) {
+ setProperty("rendered", rendered);
+ }
+
+ public void setShowDelay(Integer showDelay) {
+ setProperty("showDelay", showDelay);
+ }
+
+ public void setShowEvent(String showEvent) {
+ setProperty("showEvent", showEvent);
+ }
+
+ public void setStatus(String status) {
+ setProperty("status", status);
+ }
+
+ public void setStyle(String style) {
+ setProperty("style", style);
+ }
+
+ public void setStyleClass(String styleClass) {
+ setProperty("styleClass", styleClass);
+ }
+
+ public void setTarget(String target) {
+ setProperty("target", target);
+ }
+
+ public void setTitle(String title) {
+ setProperty("title", title);
+ }
+
+ public void setVerticalOffset(Integer verticalOffset) {
+ setProperty("verticalOffset", verticalOffset);
+ }
+
+ public void setZindex(Integer zindex) {
+ setProperty("zindex", zindex);
+ }
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TooltipModel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TooltipModel.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TooltipModel.java 2011-01-24 15:57:53 UTC (rev 21179)
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * 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.richTooltip;
+
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guard;
+
+import org.jboss.test.selenium.framework.AjaxSelenium;
+import org.jboss.test.selenium.framework.AjaxSeleniumProxy;
+import org.jboss.test.selenium.geometry.Point;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.jboss.test.selenium.request.RequestType;
+import org.richfaces.TooltipMode;
+import org.richfaces.tests.metamer.ftest.model.AbstractModel;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TooltipModel extends AbstractModel<JQueryLocator> {
+
+ private AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
+
+ private TooltipMode mode = TooltipMode.client;
+ private JQueryLocator target;
+
+ public TooltipModel(JQueryLocator root, JQueryLocator target) {
+ super(root);
+ this.target = target;
+ }
+
+ public void setMode(TooltipMode mode) {
+ this.mode = mode;
+ }
+
+ public TooltipMode getMode() {
+ return mode;
+ }
+
+ public JQueryLocator getTarget() {
+ return target;
+ }
+
+ public void recall() {
+ recall(5, 5);
+ }
+
+ public void recall(int x, int y) {
+ if (selenium.isVisible(getRoot())) {
+ guard(selenium, getRequestType()).mouseMoveAt(target, new Point(x, y));
+ } else {
+ guard(selenium, getRequestType()).mouseOverAt(target, new Point(x, y));
+ }
+ }
+
+ public void hide() {
+ hide(-1, -1);
+ }
+
+ public void hide(int x, int y) {
+ guard(selenium, getRequestType()).mouseOutAt(target, new Point(x, y));
+ }
+
+ private RequestType getRequestType() {
+ switch (mode) {
+ case ajax:
+ return RequestType.XHR;
+ default:
+ return null;
+ }
+ }
+
+}
13 years, 11 months
JBoss Rich Faces SVN: r21178 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-24 10:56:48 -0500 (Mon, 24 Jan 2011)
New Revision: 21178
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java
Log:
MatrixConfigured - better output of message when problems with field injection
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java 2011-01-24 15:56:11 UTC (rev 21177)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java 2011-01-24 15:56:48 UTC (rev 21178)
@@ -366,8 +366,8 @@
}
satisfied = true;
} else {
- throw new IllegalStateException("cannot satisfy parameter with declared field "
- + field.getName());
+ throw new IllegalStateException("cannot satisfy parameter with declared field '"
+ + field.getName() + "'");
}
}
}
13 years, 11 months
JBoss Rich Faces SVN: r21177 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-24 10:56:11 -0500 (Mon, 24 Jan 2011)
New Revision: 21177
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java
Log:
AbstractComponentAttributes - fixed behavior for enums (where enum in the attribute value fits exactly the name of enum value)
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-01-24 15:55:36 UTC (rev 21176)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java 2011-01-24 15:56:11 UTC (rev 21177)
@@ -87,10 +87,12 @@
String valueAsString = value.toString();
if (value.getClass().isEnum()) {
- valueAsString = valueAsString.toLowerCase();
- valueAsString = WordUtils.capitalizeFully(valueAsString, new char[] { '_' });
- valueAsString = valueAsString.replace("_", "");
- valueAsString = StringUtils.uncapitalize(valueAsString);
+ if ("select".equals(inputType) && !selenium.getSelectOptions(locator).contains(valueAsString)) {
+ valueAsString = valueAsString.toLowerCase();
+ valueAsString = WordUtils.capitalizeFully(valueAsString, new char[] { '_' });
+ valueAsString = valueAsString.replace("_", "");
+ valueAsString = StringUtils.uncapitalize(valueAsString);
+ }
}
if ("text".equals(inputType)) {
@@ -139,7 +141,7 @@
OptionValueLocator optionLocator = new OptionValueLocator(value);
guard(selenium, requestType).select(locator, optionLocator);
}
-
+
public void setOncomplete(String oncomplete) {
setProperty("oncomplete", oncomplete);
}
13 years, 11 months
JBoss Rich Faces SVN: r21176 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/javascript.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-24 10:55:36 -0500 (Mon, 24 Jan 2011)
New Revision: 21176
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/javascript/JQueryScript.java
Log:
JQueryScript takes ExtendedLocator<JQueryLocator> instead of JQueryLocator directly
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/javascript/JQueryScript.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/javascript/JQueryScript.java 2011-01-24 15:25:54 UTC (rev 21175)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/javascript/JQueryScript.java 2011-01-24 15:55:36 UTC (rev 21176)
@@ -25,6 +25,7 @@
import org.apache.commons.lang.StringEscapeUtils;
import org.jboss.test.selenium.encapsulated.JavaScript;
+import org.jboss.test.selenium.locator.ExtendedLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
/**
@@ -43,12 +44,12 @@
StringEscapeUtils.escapeJavaScript(selector), jqueryScript));
}
- public JQueryScript(JQueryLocator jQueryLocator) {
+ public JQueryScript(ExtendedLocator<JQueryLocator> jQueryLocator) {
super(format("jQuery('{0}', selenium.browserbot.getCurrentWindow().document)",
StringEscapeUtils.escapeJavaScript(jQueryLocator.getRawLocator())));
}
- public JQueryScript(JQueryLocator jQueryLocator, String jqueryScript) {
+ public JQueryScript(ExtendedLocator<JQueryLocator> jQueryLocator, String jqueryScript) {
super(format("jQuery('{0}', selenium.browserbot.getCurrentWindow().document).{1}",
StringEscapeUtils.escapeJavaScript(jQueryLocator.getRawLocator()), jqueryScript));
}
@@ -65,7 +66,7 @@
return new JQueryScript(selector, jqueryScript);
}
- public static JQueryScript jqScript(JQueryLocator jQueryLocator, String jqueryScript) {
+ public static JQueryScript jqScript(ExtendedLocator<JQueryLocator> jQueryLocator, String jqueryScript) {
return new JQueryScript(jQueryLocator, jqueryScript);
}
}
13 years, 11 months