You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2012/02/09 08:09:14 UTC
svn commit: r1242229 - in
/myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src:
main/webapp/tc/tree/
test/java/org/apache/myfaces/tobago/example/test/tc/tree/
Author: lofwyr
Date: Thu Feb 9 07:09:14 2012
New Revision: 1242229
URL: http://svn.apache.org/viewvc?rev=1242229&view=rev
Log:
test the marked feature
Added:
myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/tc/tree/
myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/tc/tree/TreeMarkedSeleniumTest.java
Modified:
myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/webapp/tc/tree/tree-marked-with-model.xhtml
Modified: myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/webapp/tc/tree/tree-marked-with-model.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/webapp/tc/tree/tree-marked-with-model.xhtml?rev=1242229&r1=1242228&r2=1242229&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/webapp/tc/tree/tree-marked-with-model.xhtml (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/webapp/tc/tree/tree-marked-with-model.xhtml Thu Feb 9 07:09:14 2012
@@ -32,8 +32,8 @@
<tc:tree id="tree" value="#{tree.tree}" var="node" showRoot="true" showRootJunction="true">
<tc:treeNode id="node" expanded="true" marked="#{node.userObject.selected}">
- <tc:treeIndent/>
- <tc:treeCommand label="#{node.userObject.name}"/>
+ <tc:treeIndent id="indent"/>
+ <tc:treeCommand label="#{node.userObject.name}" id="command"/>
</tc:treeNode>
</tc:tree>
Added: myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/tc/tree/TreeMarkedSeleniumTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/tc/tree/TreeMarkedSeleniumTest.java?rev=1242229&view=auto
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/tc/tree/TreeMarkedSeleniumTest.java (added)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/tc/tree/TreeMarkedSeleniumTest.java Thu Feb 9 07:09:14 2012
@@ -0,0 +1,56 @@
+package org.apache.myfaces.tobago.example.test.tc.tree;
+
+/*
+ * 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.
+ */
+
+import org.apache.myfaces.tobago.example.test.MultiSuffixSeleniumTest;
+import org.apache.myfaces.tobago.util.Parameterized;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(Parameterized.class)
+public class TreeMarkedSeleniumTest extends MultiSuffixSeleniumTest {
+
+ public TreeMarkedSeleniumTest(String suffix) {
+ super(suffix);
+ }
+
+ @Test
+ public void testHtmlResource() throws InterruptedException {
+
+ final String unmarked = "tobago-treeNode";
+ final String marked = unmarked + " " + "tobago-treeNode-markup-marked";
+
+ // load page
+ open("/tc/tree/tree-marked-with-model.");
+ Assert.assertEquals(
+ "Node 1 should not be marked!", unmarked, getSelenium().getAttribute("page:tree:1:node@class"));
+ Assert.assertEquals(
+ "Node 2 should not be marked!", unmarked, getSelenium().getAttribute("page:tree:2:node@class"));
+
+ // click on tree node 1
+ getSelenium().click("page:tree:1:command");
+ getSelenium().waitForPageToLoad("5000");
+
+ Assert.assertEquals(
+ "Node 1 should be marked now!", marked, getSelenium().getAttribute("page:tree:1:node@class"));
+ Assert.assertEquals(
+ "Node 2 should not be marked!", unmarked, getSelenium().getAttribute("page:tree:2:node@class"));
+ }
+
+}