Author: andrei_exadel
Date: 2008-10-06 08:27:20 -0400 (Mon, 06 Oct 2008)
New Revision: 10670
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataScroller/dataScroller.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataScrollerTest.java
Log:
Datascroller: test rendering and HTML attributes
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataScroller/dataScroller.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataScroller/dataScroller.xhtml 2008-10-06
12:20:08 UTC (rev 10669)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataScroller/dataScroller.xhtml 2008-10-06
12:27:20 UTC (rev 10670)
@@ -27,6 +27,12 @@
align="left"
maxPages="#{dataScrollerBean.maxPages}"
page="#{dataScrollerBean.page}"
+ onclick="EventQueue.fire('onclick')"
+ onmousedown="EventQueue.fire('onmousedown')"
+ onmousemove="EventQueue.fire('onmousemove')"
+ onmouseout="EventQueue.fire('onmouseout')"
+ onmouseover="EventQueue.fire('onmouseover')"
+ onmouseup="EventQueue.fire('onmouseup')"
/>
<br/><br/>
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataScrollerTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataScrollerTest.java 2008-10-06
12:20:08 UTC (rev 10669)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataScrollerTest.java 2008-10-06
12:27:20 UTC (rev 10670)
@@ -6,7 +6,13 @@
package org.richfaces.testng;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.ajax4jsf.template.Template;
+import org.richfaces.SeleniumEvent;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
import org.testng.annotations.Test;
@@ -24,17 +30,41 @@
String dataTableId;
+
@Test
public void testDataScroller(Template template) {
renderPage(template);
String parentId = getParentId();
dataScrollerId = parentId + "_data:scroller";
dataScrollerTableId = parentId + "_data:scroller_table";
+
+ //FIXME: currently dataTableId is invalid (dataTableId + ':0'). May be it's
cause of problem with component state storing inside dataTable.
dataTableId = (!template.getName().equals(Template.DATA_TABLE.getName())) ? parentId +
"_data:tbl" : parentId + "_data:tbl:0";
testRendering();
+ testHTMLEvent(dataScrollerId);
}
+ private void testHTMLEvent(String id) {
+ List<String> event = new ArrayList<String>();
+ event.add("onclick");
+ event.add("onmousedown");
+ event.add("onmousemove");
+ event.add("onmouseout");
+ event.add("onmouseover");
+ event.add("onmouseup");
+
+ clickById(id);
+ selenium.mouseDown(id);
+ selenium.mouseMove(id);
+ selenium.mouseOut(id);
+ selenium.mouseOver(id);
+ selenium.mouseUp(id);
+
+ assertEvents(event);
+
+ }
+
private void testRendering() {
assertClassNames(dataScrollerId,new String []
{"dr-dscr",
Show replies by date