Author: mvitenkov
Date: 2009-05-27 05:21:27 -0400 (Wed, 27 May 2009)
New Revision: 14362
Added:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf5835/
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf5835/Bean.java
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf5835/
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf5835/Test.java
branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf5835.xhtml
Log:
add RF-5835 selenium test.
Added:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf5835/Bean.java
===================================================================
---
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf5835/Bean.java
(rev 0)
+++
branches/community/3.3.X/test-applications/regressionArea/regressionArea-ejb/src/main/java/org/richfaces/regressionarea/issues/rf5835/Bean.java 2009-05-27
09:21:27 UTC (rev 14362)
@@ -0,0 +1,42 @@
+package org.richfaces.regressionarea.issues.rf5835;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.model.TreeNode;
+import org.richfaces.model.TreeNodeImpl;
+
+@Name("treeBean")
+(a)Scope(ScopeType.SESSION)
+public class Bean {
+ private TreeNode data;
+
+
+ public TreeNode getData() {
+ return data;
+ }
+
+
+ public void setData(TreeNode data) {
+ this.data = data;
+ }
+
+
+ public Bean() {
+ TreeNodeImpl<String> n = new TreeNodeImpl<String>();
+ n.setData("rnode");
+ int i = 0;
+ for (i = 0; i < 10; i++) {
+ TreeNodeImpl<String> t = new TreeNodeImpl<String>();
+ t.setData("node-" + i);
+ n.addChild(Integer.valueOf(i), t);
+ }
+ data = new TreeNodeImpl<String>();
+ data.setData("data");
+ data.addChild(Integer.valueOf(i), n);
+
+ }
+
+
+
+}
Added:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf5835/Test.java
===================================================================
---
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf5835/Test.java
(rev 0)
+++
branches/community/3.3.X/test-applications/regressionArea/regressionArea-tests/src/test/java/org/richfaces/testng/rf5835/Test.java 2009-05-27
09:21:27 UTC (rev 14362)
@@ -0,0 +1,32 @@
+package org.richfaces.testng.rf5835;
+
+import org.richfaces.SeleniumTestBase;
+
+public class Test extends SeleniumTestBase {
+
+ @org.testng.annotations.Test
+ public void testExecute() throws Exception {
+ renderPage();
+
+ clickAjaxCommandAndWait("form:tree:10::_defaultNodeFace:handle");
+
+ //check if line is present in expanded childs
+ Number childs = getHeightById("form:tree:10::_defaultNodeFace:childs");
+ Number child =
selenium.getElementHeight("//div[@id='form:tree:10::_defaultNodeFace:childs']/table[1]");
+ int dif = 0;
+
+ if(!((dif=(10*child.intValue() - childs.intValue())) == 0)){
+ throw new AssertionError("white line is after the last child:" + dif);
+ }
+ //check if line is present after expanded childs
+ if((dif = getHeightById("form:tree").intValue() -
getHeightById("form:tree:childs").intValue()) != 0){
+ throw new AssertionError("white line is after all childs:" + dif);
+ }
+
+ }
+
+ @Override
+ public String getTestUrl() {
+ return "pages/rf5835.xhtml";
+ }
+}
\ No newline at end of file
Added:
branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf5835.xhtml
===================================================================
---
branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf5835.xhtml
(rev 0)
+++
branches/community/3.3.X/test-applications/regressionArea/regressionArea-web/src/main/webapp/pages/rf5835.xhtml 2009-05-27
09:21:27 UTC (rev 14362)
@@ -0,0 +1,18 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich">
+
+<ui:composition template="/layout/layout.xhtml">
+
+ <ui:define name="template">
+ <h:form style="margin: 0px; padding: 0px; border: 1px solid red;"
id="form">
+ <rich:tree id="tree" switchType="ajax"
value="#{treeBean.data}"
+ var="data" />
+ </h:form>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file