Author: vmolotkov
Date: 2008-10-28 10:15:39 -0400 (Tue, 28 Oct 2008)
New Revision: 10942
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testEditEventAttribute.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/includes/testBody.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/template/caseTemplate.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-28
13:58:48 UTC (rev 10941)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/includes/testBody.xhtml 2008-10-28
14:15:39 UTC (rev 10942)
@@ -7,14 +7,16 @@
<h:form id="_form">
<rich:inplaceInput id="ii_#{test_prefix}"
required="#{required}"
requiredMessage="#{requiredMessage}"
+ editEvent="#{editEvent}"
value="#{value}"/>
 
+ value: <h:outputText value="#{inplaceInputBean.text}"
id="data1_#{test_prefix}"/>
+  
+ <span id="text_#{test_prefix}" >
+ text: <h:message for="ii_#{test_prefix}"/><h:outputText
value="#{inplaceInputBean.text}"></h:outputText>
+ </span>
+ <br/>
+ <br/>
<h:commandButton id="bn_#{test_prefix}"
action="#{inplaceInputBean.action}"
value="Submit"></h:commandButton>
- <div>
- value: <h:outputText style="font-weight: bold; border: 1px solid green"
value="#{inplaceInputBean.text}" id="data1_#{test_prefix}"/>
- </div>
- <div id="text_#{test_prefix}">
- text: <h:message for="ii_#{test_prefix}"/><h:outputText
value="#{inplaceInputBean.text}"></h:outputText>
- </div>
</h:form>
</ui:composition>
\ No newline at end of file
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testEditEventAttribute.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testEditEventAttribute.xhtml
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/inplaceInput/testEditEventAttribute.xhtml 2008-10-28
14:15:39 UTC (rev 10942)
@@ -0,0 +1,19 @@
+<!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">testEditEventAttribute</ui:define>
+ <ui:define name="caseBody">
+ <ui:include src="includes/testBody.xhtml">
+ <ui:param name="test_prefix" value="teea"/>
+ <ui:param name="required" value="false"/>
+ <ui:param name="value" value="value"/>
+ <ui:param name="requiredMessage" value="" />
+ <ui:param name="editEvent" value="ondblclick" />
+ </ui:include>
+ </ui:define>
+</ui:composition>
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/template/caseTemplate.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/template/caseTemplate.xhtml 2008-10-28
13:58:48 UTC (rev 10941)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/template/caseTemplate.xhtml 2008-10-28
14:15:39 UTC (rev 10942)
@@ -9,13 +9,9 @@
<ui:composition template="#{templateBean.templatePath}">
<ui:define name="component">
<table width="100%">
- <colgroup>
- <col width="30%"/>
- <col width="70%"/>
- </colgroup>
<tr>
- <td><ui:insert name="caseName"/></td>
- <td>
+ <td width="30%"><ui:insert
name="caseName"/></td>
+ <td width="70%">
<ui:insert name="caseBody"/>
</td>
</tr>
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-28
13:58:48 UTC (rev 10941)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/InplaceInputTest.java 2008-10-28
14:15:39 UTC (rev 10942)
@@ -1,5 +1,8 @@
package org.richfaces.testng;
+import java.util.HashMap;
+import java.util.Map;
+
import org.ajax4jsf.template.Template;
import org.richfaces.SeleniumTestBase;
import org.richfaces.testng.util.CommonUtils;
@@ -28,6 +31,10 @@
private static final String REQUIRED_ATTRIBUTES_ID_PREFIX = "_tra";
+ private static final String EDITEVENT_ATTRIBUTES_PAGE =
"testEditEventAttribute.xhtml";
+
+ private static final String EDITEVENT_ATTRIBUTES_ID_PREFIX = "_teea";
+
private String testUrl;
private String formId;
@@ -174,11 +181,27 @@
waitForPageToLoad();
checkMessage(messageId + REQUIRED_ATTRIBUTES_ID_PREFIX, "requiredMsg",
CommonUtils.getSuccessfulTestMessage(inplaceInputId),
CommonUtils.getFailedTestMessage(inplaceInputId));
}
+
+ /**
+ * Check 'editEvent' attribute
+ *
+ * @param template - current template
+ */
+ @Test
+ public void testEditEventAttribute(Template template) {
+ setTestUrl(EDITEVENT_ATTRIBUTES_PAGE);
+ init(template);
+
+ selenium.doubleClick(inplaceInputId + EDITEVENT_ATTRIBUTES_ID_PREFIX);
+ Map<String, String> expMap = new HashMap<String, String>();
+ expMap.put("clip", "rect(auto, auto, auto, auto)");
+ assertStyleAttributes(inplaceInputId + EDITEVENT_ATTRIBUTES_ID_PREFIX +
"tempValue", expMap);
+ }
private void checkMessage(String elementId, String expectedValue, String okMsg,
String errMsg) {
String currentValue = getTextById(elementId);
if (("text:" + expectedValue).equals(currentValue)) {
- writeStatus(okMsg, true);
+ writeStatus(okMsg);
} else {
writeStatus(errMsg, true);
Assert.fail(errMsg);