From richfaces-svn-commits at lists.jboss.org Thu Oct 30 12:42:08 2008 Content-Type: multipart/mixed; boundary="===============0546573120275839894==" 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: r10987 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory. Date: Thu, 30 Oct 2008 12:42:08 -0400 Message-ID: --===============0546573120275839894== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: vmolotkov Date: 2008-10-30 12:42:08 -0400 (Thu, 30 Oct 2008) New Revision: 10987 Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inp= laceInput/testDefaultLabelAndSpaces.xhtml Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfac= es/testng/InplaceInputTest.java Log: tests for inplaceinput Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages= /inplaceInput/testDefaultLabelAndSpaces.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/in= placeInput/testDefaultLabelAndSpaces.xhtml (rev 0) +++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/in= placeInput/testDefaultLabelAndSpaces.xhtml 2008-10-30 16:42:08 UTC (rev 109= 87) @@ -0,0 +1,16 @@ + + + testControlsFacet + + + + + + + Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/= richfaces/testng/InplaceInputTest.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/InplaceInputTest.java 2008-10-30 15:48:59 UTC (rev 10986) +++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfa= ces/testng/InplaceInputTest.java 2008-10-30 16:42:08 UTC (rev 10987) @@ -43,6 +43,10 @@ = private static final String CONTROLS_FACET_BN_CANCEL =3D "cancel"; = + private static final String DEFAULTLABEL_AND_SPACES_PAGE =3D "testDefa= ultLabelAndSpaces.xhtml"; + = + private static final String DEFAULTLABEL_AND_SPACES_PAGE_ID_PREFIX =3D= "_dfas"; + = private String testUrl; = private String formId; @@ -187,7 +191,7 @@ = selenium.click("id=3D" + buttonId + REQUIRED_ATTRIBUTES_ID_PREFIX); waitForPageToLoad(); - checkMessage(messageId + REQUIRED_ATTRIBUTES_ID_PREFIX, "requiredMsg"= , CommonUtils.getSuccessfulTestMessage(inplaceInputId + REQUIRED_ATTRIBUTES= _ID_PREFIX), CommonUtils.getFailedTestMessage(inplaceInputId + REQUIRED_ATT= RIBUTES_ID_PREFIX)); + checkMessage(messageId + REQUIRED_ATTRIBUTES_ID_PREFIX, "text:require= dMsg", CommonUtils.getSuccessfulTestMessage(inplaceInputId + REQUIRED_ATTRI= BUTES_ID_PREFIX), CommonUtils.getFailedTestMessage(inplaceInputId + REQUIRE= D_ATTRIBUTES_ID_PREFIX)); } = /** @@ -221,9 +225,43 @@ CommonUtils.getFailedTestMessage(inplaceInputId + CONTROLS_FACET_I= D_PREFIX)); } = + /** + * Input some spaces in inplaceInput; verify that defaultLabel is = + * displayed after selecting; component does not disappear from the pa= ge + * = + * @param template - current template + */ + @Test + public void testDefaultLabelAndSpaces(Template template) { + setTestUrl(DEFAULTLABEL_AND_SPACES_PAGE); + init(template); + = + String iid =3D inplaceInputId + DEFAULTLABEL_AND_SPACES_PAGE_ID_PREFI= X; + = + checkMessage(iid, "defaultLabel", = + CommonUtils.getSuccessfulTestMessage(iid), = + CommonUtils.getFailedTestMessage(iid)); + = + typeAndCheck(iid, " ", "defaultLabel"); + typeAndCheck(iid, "test", "test"); + } + = + private void typeAndCheck(String iid, String word, String expectedWord= ) { + typeWord(iid, word); + checkMessage(iid, expectedWord, = + CommonUtils.getSuccessfulTestMessage(iid), = + CommonUtils.getFailedTestMessage(iid)); + } + = + private void typeWord(String iid, String word) { + clickById(iid); + type(iid + "tempValue", word); + selenium.fireEvent(iid + "tempValue", "blur"); + } + = private void checkMessage(String elementId, String expectedValue, Stri= ng okMsg, String errMsg) { String currentValue =3D getTextById(elementId); - check(("text:" + expectedValue).equals(currentValue), okMsg, errMsg); + check((expectedValue).equals(currentValue), okMsg, errMsg); } = private void check(boolean expression, String okMsg, String errMsg) { --===============0546573120275839894==--