From richfaces-svn-commits at lists.jboss.org Thu Sep 1 10:26:46 2011 Content-Type: multipart/mixed; boundary="===============3430355732502771181==" MIME-Version: 1.0 From: richfaces-svn-commits at lists.jboss.org To: richfaces-svn-commits at lists.jboss.org Subject: [richfaces-svn-commits] JBoss Rich Faces SVN: r22675 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTooltip. Date: Thu, 01 Sep 2011 10:26:46 -0400 Message-ID: <201109011426.p81EQkje030911@svn01.web.mwc.hst.phx2.redhat.com> --===============3430355732502771181== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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/tes= ts/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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te= sts/metamer/ftest/richTooltip/TestTooltipTarget.java = (rev 0) +++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te= sts/metamer/ftest/richTooltip/TestTooltipTarget.java 2011-09-01 14:26:46 UT= C (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/targett= ing.xhtml + * + * @author Jan Jamrich + * + * @version $Revision$ + */ +public class TestTooltipTarget extends AbstractMetamerTest { + = + private TooltipAttributes attributes =3D new TooltipAttributes(); + private JQueryLocator panel1 =3D pjq("div[id$=3Dregular-div]"); + private JQueryLocator panel2 =3D pjq("div[id$=3Djsf-div]"); + private JQueryLocator panel3 =3D pjq("div[id$=3Dpanel_body]"); + = + TooltipModel tooltip1 =3D new TooltipModel(jq(".rf-tt"), panel1); + TooltipModel tooltip2 =3D new TooltipModel(jq(".rf-tt"), panel2); + TooltipModel tooltip3 =3D new TooltipModel(jq(".rf-tt"), panel3); + + @Override + public URL getTestUrl() { + return URLUtils.buildUrl(contextPath, "faces/components/richToolti= p/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)); + } +} --===============3430355732502771181==--