Author: konstantin.mishin
Date: 2009-01-30 12:17:05 -0500 (Fri, 30 Jan 2009)
New Revision: 12507
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataGrid/dataGridAutoTest.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataGridTest.java
Log:
RF-5683
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataGrid/dataGridAutoTest.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataGrid/dataGridAutoTest.xhtml
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataGrid/dataGridAutoTest.xhtml 2009-01-30
17:17:05 UTC (rev 12507)
@@ -0,0 +1,30 @@
+<!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:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition template="#{templateBean.autoTestTemplate}">
+ <ui:define name="component">
+ <rich:dataGrid id="componentId" value="#{dataGrid.model}"
var="element"
+ style="width: 100%; color: yellow"
+ styleClass="noname"
+ onclick="EventQueue.fire('onclick')"
+ onmousedown="EventQueue.fire('onmousedown')"
+ onmousemove="EventQueue.fire('onmousemove')"
+ onmouseup="EventQueue.fire('onmouseup')"
+ onmouseout="EventQueue.fire('onmouseout')"
+ onmouseover="EventQueue.fire('onmouseover')"
+ onkeydown="EventQueue.fire('onkeydown')"
+ onkeypress="EventQueue.fire('onkeypress')"
+ onkeyup="EventQueue.fire('onkeyup')"
+ >
+ <h:panelGroup>
+ <h:inputText id="inputText" value="#{element.cell2}"
validator="#{dataGrid.validate}"></h:inputText>
+ </h:panelGroup>
+ </rich:dataGrid>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataGridTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataGridTest.java 2009-01-30
16:55:31 UTC (rev 12506)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataGridTest.java 2009-01-30
17:17:05 UTC (rev 12507)
@@ -1,8 +1,11 @@
package org.richfaces.testng;
import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
import org.ajax4jsf.template.Template;
+import org.richfaces.AutoTester;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
import org.testng.annotations.Test;
@@ -123,6 +126,20 @@
Assert.assertFalse(selenium.isElementPresent(dataGrid));
}
+ /**
+ * style and classes, standard HTML attributes are output to client
+ */
+ @Test
+ public void testStandardAttributes(Template template) {
+ AutoTester autoTester = getAutoTester(this);
+ autoTester.renderPage(template, "#{dataGrid.init}");
+ Map<String, String> styleAttributes = new HashMap<String, String>();
+ styleAttributes.put("width", "100%");
+ styleAttributes.put("color", "yellow");
+ autoTester.testStyleAndClasses(new String[]{"noname"}, styleAttributes);
+ autoTester.testHTMLEvents();
+ }
+
private void chekStructure(int ... notEqualRows) {
String dataTableRowLocator = "id('"+ dataTable +
"')/tbody/tr";
int count = selenium.getXpathCount(dataTableRowLocator).intValue();
@@ -142,4 +159,9 @@
public String getTestUrl() {
return "pages/dataGrid/dataGrid.xhtml";
}
+
+ @Override
+ public String getAutoTestUrl() {
+ return "pages/dataGrid/dataGridAutoTest.xhtml";
+ }
}