Author: vmolotkov
Date: 2008-10-31 09:54:57 -0400 (Fri, 31 Oct 2008)
New Revision: 10989
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testShowControlsAttribute1.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testShowControlsAttribute2.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/includes/testBody.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/webapp/pages/inplaceInput/includes/testBody.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/includes/testBody.xhtml 2008-10-31
08:28:28 UTC (rev 10988)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/includes/testBody.xhtml 2008-10-31
13:54:57 UTC (rev 10989)
@@ -5,7 +5,7 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:form id="_form">
- <rich:inplaceInput id="ii_#{test_prefix}" value="#{value}"
required="#{required}" requiredMessage="#{requiredMessage}"
editEvent="#{editEvent}"/>
+ <rich:inplaceInput id="ii_#{test_prefix}" value="#{value}"
required="#{required}" requiredMessage="#{requiredMessage}"
editEvent="#{editEvent}" showControls="#{showControls}"/>
 
value: <h:outputText value="#{inplaceInputBean.text}"
id="data1_#{test_prefix}"/>
 
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testShowControlsAttribute1.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testShowControlsAttribute1.xhtml
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testShowControlsAttribute1.xhtml 2008-10-31
13:54:57 UTC (rev 10989)
@@ -0,0 +1,20 @@
+<!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">testShowControlsAttribute</ui:define>
+ <ui:define name="caseBody">
+ <ui:include src="includes/testBody.xhtml">
+ <ui:param name="test_prefix" value="tsca1"/>
+ <ui:param name="required" value="false"/>
+ <ui:param name="value" value="test"/>
+ <ui:param name="requiredMessage" value="" />
+ <ui:param name="showControls" value="false" />
+ <ui:param name="editEvent" value="onclick" />
+ </ui:include>
+ </ui:define>
+</ui:composition>
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testShowControlsAttribute2.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testShowControlsAttribute2.xhtml
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testShowControlsAttribute2.xhtml 2008-10-31
13:54:57 UTC (rev 10989)
@@ -0,0 +1,20 @@
+<!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">testShowControlsAttribute2</ui:define>
+ <ui:define name="caseBody">
+ <ui:include src="includes/testBody.xhtml">
+ <ui:param name="test_prefix" value="tsca2"/>
+ <ui:param name="required" value="false"/>
+ <ui:param name="value" value="test"/>
+ <ui:param name="requiredMessage" value="" />
+ <ui:param name="showControls" value="true" />
+ <ui:param name="editEvent" value="onclick" />
+ </ui:include>
+ </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-10-31
08:28:28 UTC (rev 10988)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceInputTest.java 2008-10-31
13:54:57 UTC (rev 10989)
@@ -47,6 +47,16 @@
private static final String DEFAULTLABEL_AND_SPACES_PAGE_ID_PREFIX =
"_dfas";
+ private static final String SHOW_CONTROLS_ATTRIBUTE1_PAGE =
"testShowControlsAttribute1.xhtml";
+
+ private static final String SHOW_CONTROLS_ATTRIBUTE1_PAGE_ID_PREFIX =
"_tsca1";
+
+ private static final String SHOW_CONTROLS_ATTRIBUTE2_PAGE =
"testShowControlsAttribute2.xhtml";
+
+ private static final String SHOW_CONTROLS_ATTRIBUTE2_PAGE_ID_PREFIX =
"_tsca2";
+
+ private static final String SHOW_CONTROLS_ATTRIBUTE_BAR = "bar";
+
private String testUrl;
private String formId;
@@ -246,6 +256,58 @@
typeAndCheck(iid, "test", "test");
}
+ /**
+ * Verify component behaviour with showControls="false" attribute
+ *
+ * @param template - current template
+ */
+ @Test
+ public void testShowControlsAttribute1(Template template) {
+ setTestUrl(SHOW_CONTROLS_ATTRIBUTE1_PAGE);
+ init(template);
+
+ String iid = inplaceInputId + SHOW_CONTROLS_ATTRIBUTE1_PAGE_ID_PREFIX;
+
+ clickById(iid);
+ check(!isVisibleById(iid + SHOW_CONTROLS_ATTRIBUTE_BAR),
+ CommonUtils.getSuccessfulTestMessage(iid),
+ CommonUtils.getFailedTestMessage(iid));
+
+ Map<String, String> expMap = new HashMap<String, String>();
+ expMap.put("clip", "rect(auto auto auto auto)");
+ assertStyleAttributes(iid+ "tempValue", expMap);
+ selenium.fireEvent(iid + "tempValue", "blur");
+ expMap.remove("clip");
+ expMap.put("clip", "rect(0px 0px 0px 0px)");
+ assertStyleAttributes(iid+ "tempValue", expMap);
+ }
+
+ /**
+ * The same as previous but with showControls="true" attribute
+ *
+ * @param template - current template
+ */
+ @Test
+ public void testShowControlsAttribute2(Template template) {
+ setTestUrl(SHOW_CONTROLS_ATTRIBUTE2_PAGE);
+ init(template);
+
+ String iid = inplaceInputId + SHOW_CONTROLS_ATTRIBUTE2_PAGE_ID_PREFIX;
+
+ clickById(iid);
+ check(isVisibleById(iid + SHOW_CONTROLS_ATTRIBUTE_BAR),
+ CommonUtils.getSuccessfulTestMessage(iid),
+ CommonUtils.getFailedTestMessage(iid));
+
+ Map<String, String> expMap = new HashMap<String, String>();
+ expMap.put("clip", "rect(auto auto auto auto)");
+ assertStyleAttributes(iid+ "tempValue", expMap);
+ selenium.fireEvent(iid + "tempValue", "blur");
+ expMap.remove("clip");
+ expMap.put("clip", "rect(auto auto auto auto)");
+ assertStyleAttributes(iid+ "tempValue", expMap);
+ }
+
private void typeAndCheck(String iid, String word, String expectedWord) {
typeWord(iid, word);
checkMessage(iid, expectedWord,