From richfaces-svn-commits at lists.jboss.org Sun May 15 21:11:22 2011 Content-Type: multipart/mixed; boundary="===============2633893732178568646==" 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: r22489 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richGraphValidator and 1 other directory. Date: Sun, 15 May 2011 21:11:22 -0400 Message-ID: <201105160111.p4G1BM3w025412@svn01.web.mwc.hst.phx2.redhat.com> --===============2633893732178568646== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: jjamrich Date: 2011-05-15 21:11:22 -0400 (Sun, 15 May 2011) New Revision: 22489 Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tes= ts/metamer/ftest/richGraphValidator/ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tes= ts/metamer/ftest/richGraphValidator/GraphValidatorAttributes.java modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tes= ts/metamer/ftest/richGraphValidator/RichGraphValidatorTest.java Log: Add selenium tests for rich:graphValidator into Metamer Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces= /tests/metamer/ftest/richGraphValidator/GraphValidatorAttributes.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/richGraphValidator/GraphValidatorAttributes.java = (rev 0) +++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te= sts/metamer/ftest/richGraphValidator/GraphValidatorAttributes.java 2011-05-= 16 01:11:22 UTC (rev 22489) @@ -0,0 +1,50 @@ +/*************************************************************************= ****** + * 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.richGraphValidator; + +import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes; + +/** + * Component attributes for rich:graphValidator + * + * @author Jan Jamrich + * @version $Revision$ + */ +public class GraphValidatorAttributes extends AbstractComponentAttributes { + = + public void setRendered(Boolean rendered) { + setProperty("rendered", rendered); + } + = + public void setSummary(String summary) { + setProperty("summary", summary); + } + = + public void setValue(String value) { + setProperty("value", value); + } + = + public void setGroups(String groups) { + setProperty("groups", groups); + } + = +} Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces= /tests/metamer/ftest/richGraphValidator/RichGraphValidatorTest.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/richGraphValidator/RichGraphValidatorTest.java = (rev 0) +++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/te= sts/metamer/ftest/richGraphValidator/RichGraphValidatorTest.java 2011-05-16= 01:11:22 UTC (rev 22489) @@ -0,0 +1,159 @@ +/*************************************************************************= ****** + * 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.richGraphValidator; + +import static org.jboss.test.selenium.locator.LocatorFactory.jq; +import static org.jboss.test.selenium.utils.URLUtils.buildUrl; + +import java.net.URL; + +import org.jboss.test.selenium.locator.JQueryLocator; +import org.jboss.test.selenium.locator.option.OptionValueLocator; +import org.richfaces.tests.metamer.ftest.AbstractMetamerTest; +import org.testng.annotations.Test; + +/** + * Test for page /faces/components/richGraphValidator/all.xhtml + * + * @author Jan Jamrich + * @version $Revision$ + */ +public class RichGraphValidatorTest extends AbstractMetamerTest { + + private static final String SMILE =3D ":-)"; + private static final GraphValidatorAttributes attributes =3D new Graph= ValidatorAttributes(); + = + private static final String[] groups =3D {"", "javax.validation.groups= .Default", = + "org.richfaces.tests.metamer.validation.groups.ValidationGroupAllC= omponents", + "org.richfaces.tests.metamer.validation.groups.ValidationGroupBool= eanInputs", = + "org.richfaces.tests.metamer.validation.groups.ValidationGroupNume= ricInputs"}; + = + private JQueryLocator autocomplete =3D pjq("input[id$=3DautocompleteIn= put]"); + private JQueryLocator inputSecret =3D pjq("input[id$=3DinputSecret]"); + private JQueryLocator inputText =3D pjq("input[id$=3DinputText]"); + private JQueryLocator calendar =3D pjq("input[id$=3DcalendarInputDate]= "); + private JQueryLocator inputTextArea =3D pjq("textarea[id$=3DinputTexta= rea]"); + private JQueryLocator inplaceSelect =3D pjq("span[id$=3DinplaceSelect]= input[id$=3DinplaceSelectFocus]"); + private JQueryLocator inplaceInput =3D pjq("span[id$=3DinplaceInput] i= nput[id$=3DinplaceInputFocus]"); + private JQueryLocator selectManyCheckbox =3D pjq("input[id$=3DselectMa= nyCheckbox:4]"); + private JQueryLocator selectManyListbox =3D pjq("select[id$=3DselectMa= nyListbox]"); + private JQueryLocator selectManyMenu =3D pjq("select[id$=3DselectManyM= enu]"); + private JQueryLocator selectBooleanCheckbox =3D pjq("input[id$=3Dselec= tBooleanCheckbox]"); + private JQueryLocator inputNumberSliderInput =3D pjq("span[id$=3Dinput= NumberSlider] input.rf-insl-inp"); + private JQueryLocator inputNumberSpinnerInput =3D pjq("span[id$=3Dinpu= tNumberSpinner] input.rf-insp-inp"); + = + private JQueryLocator globalMessagesContainer =3D pjq("span[id$=3Dglob= alMessages]"); + private JQueryLocator header =3D pjq("div.rf-p-hdr[id$=3Dgv1h_header]"= ); + = + private OptionValueLocator optionSmile =3D new OptionValueLocator(SMIL= E); + = + private JQueryLocator applyChangesBtn =3D pjq("input[id$=3DapplyChange= s]"); + + @Override + public URL getTestUrl() { + return buildUrl(contextPath, "faces/components/richGraphValidator/= all.xhtml"); + } + = + @Test + public void testGroups() { + for (int i=3D0; i