From richfaces-svn-commits at lists.jboss.org Wed Feb 25 14:21:30 2009 Content-Type: multipart/mixed; boundary="===============0858469056859521060==" 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: r12748 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces and 1 other directories. Date: Wed, 25 Feb 2009 14:21:30 -0500 Message-ID: --===============0858469056859521060== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: konstantin.mishin Date: 2009-02-25 14:21:30 -0500 (Wed, 25 Feb 2009) New Revision: 12748 Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/spa= cer/spacerAutoTest.xhtml Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/spa= cer/spacerTest.xhtml trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfac= es/AutoTester.java trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfac= es/testng/SpacerTest.java Log: RF-6191 Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages= /spacer/spacerAutoTest.xhtml =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 --- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/sp= acer/spacerAutoTest.xhtml (rev 0) +++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/sp= acer/spacerAutoTest.xhtml 2009-02-25 19:21:30 UTC (rev 12748) @@ -0,0 +1,24 @@ + + + = + + + + + + \ No newline at end of file Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pa= ges/spacer/spacerTest.xhtml =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 (Binary files differ) Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/= richfaces/AutoTester.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 --- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfa= ces/AutoTester.java 2009-02-25 17:12:01 UTC (rev 12747) +++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfa= ces/AutoTester.java 2009-02-25 19:21:30 UTC (rev 12748) @@ -453,6 +453,8 @@ } = public void testHTMLEvents() { + reset(); + clickLoad(); String componentId =3D getClientId(COMPONENT_ID); base.assertEvents(componentId, SeleniumEvent.STANDARD_HTML_EVENTS); } Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/= richfaces/testng/SpacerTest.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 --- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfa= ces/testng/SpacerTest.java 2009-02-25 17:12:01 UTC (rev 12747) +++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfa= ces/testng/SpacerTest.java 2009-02-25 19:21:30 UTC (rev 12748) @@ -21,6 +21,7 @@ package org.richfaces.testng; = import org.ajax4jsf.template.Template; +import org.richfaces.AutoTester; import org.richfaces.SeleniumTestBase; import org.testng.Assert; import org.testng.annotations.Test; @@ -34,16 +35,17 @@ String spacerId =3D parentId + "sp"; = writeStatus("Check width "); - assertWidth(1 + 2, spacerId); + assertWidth(1, spacerId); = writeStatus("Check height "); - assertHeight(5 + 2, spacerId); + assertHeight(5, spacerId); = writeStatus("Check styleClass "); assertStyleClass("sp", spacerId); = writeStatus("Check style "); - assertStyleClass("border: solid 1px green;", spacerId); + Assert.assertTrue(selenium.getAttribute("xpath=3Did('" + spacerId + "= ')@style") + .toLowerCase().indexOf("color: yellow") !=3D -1); } = private void assertWidth(int width, String spacerId) { @@ -77,17 +79,24 @@ } } = - private void assertStyle(String style, String spacerId) { - StringBuffer script =3D new StringBuffer(" document.getElementById= ('"); - script.append(spacerId); - script.append("').style"); + /** + * component with rendered =3D false is not present on the page, + * style and classes, standard HTML event attributes are output to = client + */ + @Test + public void testRenderedAndEvents(Template template) { + AutoTester autoTester =3D getAutoTester(this); + autoTester.renderPage(template, null); + autoTester.testRendered(); + autoTester.testHTMLEvents(); + } = - String s =3D runScript(script.toString()); - Assert.assertEquals(s, style); - } - - public String getTestUrl() { + public String getTestUrl() { return "pages/spacer/spacerTest.xhtml"; } - + = + @Override + public String getAutoTestUrl() { + return "pages/spacer/spacerAutoTest.xhtml"; + } } --===============0858469056859521060==--