Author: jjamrich
Date: 2011-09-01 10:26:46 -0400 (Thu, 01 Sep 2011)
New Revision: 22675
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipTarget.java
Log:
RFPL-1054: add test for rich:tooltip by @target
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipTarget.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipTarget.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip/TestTooltipTarget.java 2011-09-01
14:26:46 UTC (rev 22675)
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * 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.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 org.jboss.test.selenium.locator.LocatorFactory.jq;
+
+import java.net.URL;
+
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.jboss.test.selenium.utils.URLUtils;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * Test for @target attribute on page faces/components/richTooltip/targetting.xhtml
+ *
+ * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
+ *
+ * @version $Revision$
+ */
+public class TestTooltipTarget extends AbstractMetamerTest {
+
+ private TooltipAttributes attributes = new TooltipAttributes();
+ private JQueryLocator panel1 = pjq("div[id$=regular-div]");
+ private JQueryLocator panel2 = pjq("div[id$=jsf-div]");
+ private JQueryLocator panel3 = pjq("div[id$=panel_body]");
+
+ TooltipModel tooltip1 = new TooltipModel(jq(".rf-tt"), panel1);
+ TooltipModel tooltip2 = new TooltipModel(jq(".rf-tt"), panel2);
+ TooltipModel tooltip3 = new TooltipModel(jq(".rf-tt"), panel3);
+
+ @Override
+ public URL getTestUrl() {
+ return URLUtils.buildUrl(contextPath,
"faces/components/richTooltip/targetting.xhtml");
+ }
+
+ @BeforeMethod
+ public void setupAttributes() {
+ attributes.setShowEvent("mouseover");
+ attributes.setHideEvent("mouseout");
+ }
+
+ @Test
+ public void testTarget() {
+ // 1. first target
+ attributes.setTarget("regular-div");
+ tooltip1.recall();
+ waitGui.until(isDisplayed.locator(tooltip1));
+
+ // 2. target
+ attributes.setTarget("form:jsf-div");
+ tooltip2.recall();
+ waitGui.until(isDisplayed.locator(tooltip2));
+
+ // 3. default target
+ attributes.setTarget("form:panel");
+ tooltip3.recall();
+ waitGui.until(isDisplayed.locator(tooltip3));
+ }
+}