Author: vmolotkov
Date: 2008-11-11 13:41:36 -0500 (Tue, 11 Nov 2008)
New Revision: 11090
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testBasicBehaviour.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testRenderedAttribute.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/InplaceInputTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testJSApi.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceInputTest.java
Log:
tests for inplaceinput
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/InplaceInputTestBean.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/InplaceInputTestBean.java 2008-11-11
17:46:12 UTC (rev 11089)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/InplaceInputTestBean.java 2008-11-11
18:41:36 UTC (rev 11090)
@@ -21,6 +21,8 @@
private String newText = "";
+ private String iiValue = "test";
+
/**
* Gets value of text field.
* @return value of text field
@@ -64,4 +66,20 @@
public void setNewText(String newText) {
this.newText = newText;
}
+
+ /**
+ * @return the iiValue
+ */
+ public String getIiValue() {
+ return iiValue;
+ }
+
+ /**
+ * @param iiValue the iiValue to set
+ */
+ public void setIiValue(String iiValue) {
+ this.iiValue = iiValue;
+ }
+
+
}
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testBasicBehaviour.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testBasicBehaviour.xhtml
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testBasicBehaviour.xhtml 2008-11-11
18:41:36 UTC (rev 11090)
@@ -0,0 +1,25 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+ template="../../template/caseTemplate.xhtml">
+ <ui:define name="caseName">testBasicBehaviour</ui:define>
+ <ui:define name="caseBody">
+ <h:form id="_form">
+ <h:panelGroup id="group_tbb">
+ <table cellpadding="5" >
+ <tr>
+ <td></td>
+ <td>
+ <rich:inplaceInput id="ii_tbb"
value="#{inplaceInputBean.iiValue}">
+ </rich:inplaceInput>
+ </td>
+ </tr>
+ </table>
+ </h:panelGroup>
+ </h:form>
+ </ui:define>
+</ui:composition>
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testJSApi.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testJSApi.xhtml 2008-11-11
17:46:12 UTC (rev 11089)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testJSApi.xhtml 2008-11-11
18:41:36 UTC (rev 11090)
@@ -14,7 +14,7 @@
<tr>
<td></td>
<td>
- <rich:inplaceInput id="ii_tja" value="test"
showControls="true">
+ <rich:inplaceInput id="ii_tja"
value="#{inplaceInputBean.iiValue}" showControls="true">
</rich:inplaceInput>
<button id="okButton_tja"
onclick="#{rich:component('ii_tja')}.save();return
false;">ok</button>
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testRenderedAttribute.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testRenderedAttribute.xhtml
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testRenderedAttribute.xhtml 2008-11-11
18:41:36 UTC (rev 11090)
@@ -0,0 +1,25 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+ template="../../template/caseTemplate.xhtml">
+ <ui:define name="caseName">testRenderedAttribute</ui:define>
+ <ui:define name="caseBody">
+ <h:form id="_form">
+ <h:panelGroup id="group_tra">
+ <table cellpadding="5" >
+ <tr>
+ <td></td>
+ <td>
+ <rich:inplaceInput id="ii_tra"
value="#{inplaceInputBean.iiValue}" rendered="false">
+ </rich:inplaceInput>
+ </td>
+ </tr>
+ </table>
+ </h:panelGroup>
+ </h:form>
+ </ui:define>
+</ui:composition>
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceInputTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceInputTest.java 2008-11-11
17:46:12 UTC (rev 11089)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceInputTest.java 2008-11-11
18:41:36 UTC (rev 11090)
@@ -85,6 +85,14 @@
private static final String JS_API_ID_PREFIX = "_tja";
+ private static final String RENDERED_ATTRIBUTE_PAGE =
"testRenderedAttribute.xhtml";
+
+ private static final String RENDERED_ATTRIBUTE_ID_PREFIX = "_tra";
+
+ private static final String BASIC_BEHAVIOUR_PAGE =
"testBasicBehaviour.xhtml";
+
+ private static final String BASIC_BEHAVIOUR_ID_PREFIX = "_tbb";
+
private String testUrl;
private String formId;
@@ -497,10 +505,10 @@
String iid = inplaceInputId + JS_API_ID_PREFIX;
selenium.runScript("var inplaceinput = ($('" + iid +
"')).component;");
-
//Assert.assertTrue("test".equals(selenium.getEval("window.inplaceinput.getValue()")));
+
Assert.assertTrue("test".equals(selenium.getEval("window.inplaceinput.getValue()")));
- //selenium.getEval("window.inplaceinput.setValue('',
'JSApi')");
-
//Assert.assertTrue("JSApi".equals(selenium.getEval("window.inplaceinput.getValue()")));
+ selenium.getEval("window.inplaceinput.setValue(\"\", {value:
\"JSApi\"})");
+
Assert.assertTrue("JSApi".equals(selenium.getEval("window.inplaceinput.getValue()")));
selenium.getEval("window.inplaceinput.edit()");
Map<String, String> expMap = new HashMap<String, String>();
@@ -518,6 +526,32 @@
check("testInplaceInput".equals(getValueById(iid + "value")),
CommonUtils.getSuccessfulTestMessage(iid), CommonUtils.getFailedTestMessage(iid));
}
+ /**
+ * InplaceInput is present on the page and shows model value
+ *
+ * @param template - current temlate
+ */
+ @Test
+ public void testBasicBehaviour(Template template) {
+ setTestUrl(BASIC_BEHAVIOUR_PAGE);
+ init(template);
+
+ AssertValueEquals(inplaceInputId + BASIC_BEHAVIOUR_ID_PREFIX + "value",
"test");
+ }
+
+ /**
+ * Component with rendered = false is not present on the page
+ *
+ * @param template - current template
+ */
+ @Test
+ public void testRenderedAttribute(Template template) {
+ setTestUrl(RENDERED_ATTRIBUTE_PAGE);
+ init(template);
+
+ AssertNotRendered(inplaceInputId + RENDERED_ATTRIBUTE_ID_PREFIX);
+ }
+
private void typeAndCheck(String iid, String word, String expectedWord) {
typeWord(iid, word);
checkMessage(iid, expectedWord,