You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by pa...@apache.org on 2007/01/10 07:07:02 UTC

svn commit: r494729 - in /myfaces/tomahawk/trunk/examples/simple/src: main/webapp/WEB-INF/ main/webapp/testSuite/ test/selenium/

Author: paulsp
Date: Tue Jan  9 22:07:01 2007
New Revision: 494729

URL: http://svn.apache.org/viewvc?view=rev&rev=494729
Log:
MYFACES-654 Add test for <h:commandButton> and <h:outputLabel>.
Minor reordering of test.

           

Added:
    myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/hCommandButton.jsp   (with props)
    myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/hOutputLabel.jsp   (with props)
    myfaces/tomahawk/trunk/examples/simple/src/test/selenium/hCommandButtonTest.html   (with props)
    myfaces/tomahawk/trunk/examples/simple/src/test/selenium/hOutputLabelTest.html   (with props)
Modified:
    myfaces/tomahawk/trunk/examples/simple/src/main/webapp/WEB-INF/testSuite-config.xml
    myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/home.jsp
    myfaces/tomahawk/trunk/examples/simple/src/test/selenium/TestSuite.html
    myfaces/tomahawk/trunk/examples/simple/src/test/selenium/hOutputLinkTest.html

Modified: myfaces/tomahawk/trunk/examples/simple/src/main/webapp/WEB-INF/testSuite-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/webapp/WEB-INF/testSuite-config.xml?view=diff&rev=494729&r1=494728&r2=494729
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/webapp/WEB-INF/testSuite-config.xml (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/webapp/WEB-INF/testSuite-config.xml Tue Jan  9 22:07:01 2007
@@ -14,6 +14,10 @@
 			<to-view-id>/testSuite/home.jsp</to-view-id>
 		</navigation-case>
 		<navigation-case>
+			<from-outcome>hCommandButton</from-outcome>
+			<to-view-id>/testSuite/hCommandButton.jsp</to-view-id>
+		</navigation-case>
+		<navigation-case>
 			<from-outcome>hForm</from-outcome>
 			<to-view-id>/testSuite/hForm.jsp</to-view-id>
 		</navigation-case>
@@ -30,6 +34,14 @@
 			<to-view-id>/testSuite/hGraphicImage.jsp</to-view-id>
 		</navigation-case>
 		<navigation-case>
+			<from-outcome>hOutputLabel</from-outcome>
+			<to-view-id>/testSuite/hOutputLabel.jsp</to-view-id>
+		</navigation-case>
+		<navigation-case>
+			<from-outcome>hOutputLink</from-outcome>
+			<to-view-id>/testSuite/hOutputLink.jsp</to-view-id>
+		</navigation-case>
+		<navigation-case>
 			<from-outcome>hOutputText</from-outcome>
 			<to-view-id>/testSuite/hOutputText.jsp</to-view-id>
 		</navigation-case>
@@ -52,10 +64,6 @@
 		<navigation-case>
 			<from-outcome>page_4</from-outcome>
 			<to-view-id>/testSuite/page_4.jsp</to-view-id>
-		</navigation-case>
-		<navigation-case>
-			<from-outcome>tOutputLink</from-outcome>
-			<to-view-id>/testSuite/tOutputLink.jsp</to-view-id>
 		</navigation-case>
 		<navigation-case>
 			<from-outcome>tOutputText</from-outcome>

Added: myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/hCommandButton.jsp
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/hCommandButton.jsp?view=auto&rev=494729
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/hCommandButton.jsp (added)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/hCommandButton.jsp Tue Jan  9 22:07:01 2007
@@ -0,0 +1,65 @@
+<%@ page session="false" contentType="text/html;charset=utf-8"%>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+//-->
+
+<f:view>
+  <t:document>
+    <t:documentHead>
+      <t:htmlTag value="title">
+        <h:outputText value="#{view.viewId}" />
+      </t:htmlTag>
+    </t:documentHead>
+    <t:documentBody>
+      <h:outputText value="Running test #{view.viewId}" />
+      <t:htmlTag value="br" />
+      <t:htmlTag value="br" />
+
+      <!-- Begin test -->
+
+      <!-- Testing h:outputLabel -->
+      <h:form id="commandButtonForm">
+        <h:commandButton id="commandButton" value="Default"/>
+        <h:commandButton id="commandButtonImage" image="/images/logo.jpg" alt="Alt"/>
+        <h:commandButton id="commandButtonTitle" value="Title"  title="Popup Title"/>
+        <h:commandButton id="commandButtonReadOnly" value="Read Only" readonly="true"/>
+        <h:commandButton id="commandButtonNotReadOnly" value="not Read Only" readonly="false"/>
+        <h:commandButton id="commandButtonReset" value="Reset" type="reset"/>
+        <h:commandButton id="commandButtonSubmit" value="Submit" type="submit"/>
+        <h:commandButton id="commandButtonTabIndex" value="TabIndex" tabindex="4"/>
+      </h:form>
+
+      <!-- End test -->
+
+      <t:htmlTag value="br" />
+      <h:form id="footerLinks">
+        <h:commandLink id="homeLink" action="home" value="Home" />
+        <h:outputText value=" " />
+        <h:outputLink id="sourceLink" target="sourceWindow"
+          value="#{facesContext.externalContext.requestContextPath}#{view.viewId}.source">
+          <h:outputText value="View source in popup window" />
+        </h:outputLink>
+      </h:form>
+    </t:documentBody>
+  </t:document>
+</f:view>

Propchange: myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/hCommandButton.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/hOutputLabel.jsp
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/hOutputLabel.jsp?view=auto&rev=494729
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/hOutputLabel.jsp (added)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/hOutputLabel.jsp Tue Jan  9 22:07:01 2007
@@ -0,0 +1,64 @@
+<%@ page session="false" contentType="text/html;charset=utf-8"%>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+//-->
+
+<f:view>
+  <t:document>
+    <t:documentHead>
+      <t:htmlTag value="title">
+        <h:outputText value="#{view.viewId}" />
+      </t:htmlTag>
+    </t:documentHead>
+    <t:documentBody>
+      <h:outputText value="Running test #{view.viewId}" />
+      <t:htmlTag value="br" />
+      <t:htmlTag value="br" />
+
+      <!-- Begin test -->
+
+      <!-- Testing h:outputLabel -->
+      <h:form id="outputLabelForm">
+        <h:outputLabel for="inputText" value="Label A"/>
+        <h:inputText id="inputText" value="input Value"/>
+      </h:form>
+      <h:form id="outputLabelWithAttributesForm">
+        <h:outputLabel for="inputTextB" value="Label B" tabindex="2" title="Title"/>
+        <h:inputText id="inputTextB" value="input Value"/>
+      </h:form>
+
+
+      <!-- End test -->
+
+      <t:htmlTag value="br" />
+      <h:form id="footerLinks">
+        <h:commandLink id="homeLink" action="home" value="Home" />
+        <h:outputText value=" " />
+        <h:outputLink id="sourceLink" target="sourceWindow"
+          value="#{facesContext.externalContext.requestContextPath}#{view.viewId}.source">
+          <h:outputText value="View source in popup window" />
+        </h:outputLink>
+      </h:form>
+    </t:documentBody>
+  </t:document>
+</f:view>

Propchange: myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/hOutputLabel.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/home.jsp
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/home.jsp?view=diff&rev=494729&r1=494728&r2=494729
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/home.jsp (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/main/webapp/testSuite/home.jsp Tue Jan  9 22:07:01 2007
@@ -33,11 +33,11 @@
     <t:documentBody>
       <h:form>
         <t:panelNavigation2 layout="list">
-          <t:navigationMenuItem action="hForm" itemLabel="h:Form" />
-          <t:navigationMenuItem action="hGraphicImage" itemLabel="h:graphicImage" />
+          <t:navigationMenuItem action="hCommandButton" itemLabel="h:commandButton" />
           <t:navigationMenuItem action="hForm" itemLabel="h:Form" />
           <t:navigationMenuItem action="hFormWithInputs" itemLabel="h:Form and h:input..." />
           <t:navigationMenuItem action="hFormWithSelects" itemLabel="h:Form and h:select..." />
+          <t:navigationMenuItem action="hGraphicImage" itemLabel="h:graphicImage" />
           <t:navigationMenuItem action="hOutputLink" itemLabel="h:outputLink" />
           <t:navigationMenuItem action="hOutputText" itemLabel="h:outputText" />
           <t:navigationMenuItem action="hPanelGrid" itemLabel="h:panelGrid" />

Modified: myfaces/tomahawk/trunk/examples/simple/src/test/selenium/TestSuite.html
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/test/selenium/TestSuite.html?view=diff&rev=494729&r1=494728&r2=494729
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/test/selenium/TestSuite.html (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/test/selenium/TestSuite.html Tue Jan  9 22:07:01 2007
@@ -36,13 +36,13 @@
            </td>
          </tr>
          <tr>
-            <td>
-               <a href="tOutputTextTest.html">tOutputText</a>
+           <td>
+               <a href="hFormTest.html">hForm</a>
            </td>
          </tr>
          <tr>
            <td>
-               <a href="hFormTest.html">hForm</a>
+               <a href="hCommandButtonTest.html">hCommandButton</a>
            </td>
          </tr>
          <tr>
@@ -52,8 +52,8 @@
          </tr>
          <tr>
             <td>
-               <a href="tPanelNavigation2Test.html">tPanelNavigation2</a>
-            </td>
+               <a href="tOutputTextTest.html">tOutputText</a>
+           </td>
          </tr>
          <tr>
            <td>
@@ -65,6 +65,11 @@
                <a href="hFormWithSelectsTest.html">hForm with Selects</a>
            </td>
          </tr>
-      </table>
+         <tr>
+            <td>
+               <a href="tPanelNavigation2Test.html">tPanelNavigation2</a>
+            </td>
+         </tr>
+     </table>
    </body>
 </html>

Added: myfaces/tomahawk/trunk/examples/simple/src/test/selenium/hCommandButtonTest.html
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/test/selenium/hCommandButtonTest.html?view=auto&rev=494729
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/test/selenium/hCommandButtonTest.html (added)
+++ myfaces/tomahawk/trunk/examples/simple/src/test/selenium/hCommandButtonTest.html Tue Jan  9 22:07:01 2007
@@ -0,0 +1,69 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>hCommandButton</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">hCommandButton</td></tr>
+</thead><tbody>
+<tr>
+	<td>open</td>
+	<td>/myfaces-example-simple/testSuite/home.jsf</td>
+	<td></td>
+</tr>
+<tr>
+	<td>open</td>
+	<td>/myfaces-example-simple/testSuite/hCommandButton.jsf</td>
+	<td></td>
+</tr>
+<tr>
+	<td>verifyAttribute</td>
+	<td>//input[@id='commandButtonForm:commandButton']@value</td>
+	<td>Default</td>
+</tr>
+<tr>
+	<td>verifyAttribute</td>
+	<td>//input[@id='commandButtonForm:commandButtonImage']@type</td>
+	<td>image</td>
+</tr>
+<tr>
+	<td>verifyAttribute</td>
+	<td>//input[@id='commandButtonForm:commandButtonImage']@src</td>
+	<td>regexp:(http:\/\/*|)\/images\/logo.jpg</td>
+</tr>
+<tr>
+	<td>verifyAttribute</td>
+	<td>//input[@id='commandButtonForm:commandButtonImage']@alt</td>
+	<td>Alt</td>
+</tr>
+<tr>
+	<td>verifyAttribute</td>
+	<td>//input[@id='commandButtonForm:commandButtonTitle']@title</td>
+	<td>Popup Title</td>
+</tr>
+<tr>
+	<td>verifyAttribute</td>
+	<td>//input[@id='commandButtonForm:commandButtonReadOnly']@readonly</td>
+	<td>glob:*</td>
+</tr>
+<tr>
+	<td>verifyAttribute</td>
+	<td>//input[@id='commandButtonForm:commandButtonReset']@type</td>
+	<td>reset</td>
+</tr>
+<tr>
+	<td>verifyAttribute</td>
+	<td>//input[@id='commandButtonForm:commandButtonSubmit']@type</td>
+	<td>submit</td>
+</tr>
+<tr>
+	<td>verifyAttribute</td>
+	<td>//input[@id='commandButtonForm:commandButtonTabIndex']@tabindex</td>
+	<td>4</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>

Propchange: myfaces/tomahawk/trunk/examples/simple/src/test/selenium/hCommandButtonTest.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: myfaces/tomahawk/trunk/examples/simple/src/test/selenium/hOutputLabelTest.html
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/test/selenium/hOutputLabelTest.html?view=auto&rev=494729
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/test/selenium/hOutputLabelTest.html (added)
+++ myfaces/tomahawk/trunk/examples/simple/src/test/selenium/hOutputLabelTest.html Tue Jan  9 22:07:01 2007
@@ -0,0 +1,44 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>hOutputLabelTest</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">hOutputLabelTest</td></tr>
+</thead><tbody>
+<tr>
+	<td>open</td>
+	<td>/myfaces-example-simple/testSuite/home.jsf</td>
+	<td></td>
+</tr>
+<tr>
+	<td>open</td>
+	<td>/myfaces-example-simple/testSuite/hOutputLabel.jsf</td>
+	<td></td>
+</tr>
+<tr>
+	<td>verifyText</td>
+	<td>//label[@for='outputLabelForm:inputText']</td>
+	<td>Label A</td>
+</tr>
+<tr>
+	<td>verifyText</td>
+	<td>//label[@for='outputLabelWithAttributesForm:inputTextB']</td>
+	<td>Label B</td>
+</tr>
+<tr>
+	<td>verifyAttribute</td>
+	<td>//label[@for='outputLabelWithAttributesForm:inputTextB']@tabindex</td>
+	<td>2</td>
+</tr>
+<tr>
+	<td>verifyAttribute</td>
+	<td>//label[@for='outputLabelWithAttributesForm:inputTextB']@title</td>
+	<td>Title</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>

Propchange: myfaces/tomahawk/trunk/examples/simple/src/test/selenium/hOutputLabelTest.html
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/tomahawk/trunk/examples/simple/src/test/selenium/hOutputLinkTest.html
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/examples/simple/src/test/selenium/hOutputLinkTest.html?view=diff&rev=494729&r1=494728&r2=494729
==============================================================================
--- myfaces/tomahawk/trunk/examples/simple/src/test/selenium/hOutputLinkTest.html (original)
+++ myfaces/tomahawk/trunk/examples/simple/src/test/selenium/hOutputLinkTest.html Tue Jan  9 22:07:01 2007
@@ -29,7 +29,7 @@
 	<td>//span[@id='hOutputText']</td>
 	<td></td>
 </tr>
-<!--Test sttributes-->
+<!--Test attributes-->
 <tr>
 	<td>assertElementPresent</td>
 	<td>//span[@id='hOutputText']</td>