Author: konstantin.mishin
Date: 2009-02-26 08:40:12 -0500 (Thu, 26 Feb 2009)
New Revision: 12757
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/separator/
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/separator/separatorAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SeparatorTest.java
Log:
RF-6187
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/separator/separatorAutoTest.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/separator/separatorAutoTest.xhtml
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/separator/separatorAutoTest.xhtml 2009-02-26
13:40:12 UTC (rev 12757)
@@ -0,0 +1,24 @@
+<!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:separator id="componentId"
rendered="#{autoTestBean.rendered}"
+ 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')"
+ style="width: 100%; color: yellow;" styleClass="noname" />
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Added:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SeparatorTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SeparatorTest.java
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SeparatorTest.java 2009-02-26
13:40:12 UTC (rev 12757)
@@ -0,0 +1,44 @@
+package org.richfaces.testng;
+
+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;
+
+public class SeparatorTest extends SeleniumTestBase {
+
+ /**
+ * component with rendered = false is not present on the page,
+ * style and classes, standard HTML attributes are output to client
+ */
+ @Test
+ public void testStandardAttributes(Template template) {
+ AutoTester autoTester = getAutoTester(this);
+ autoTester.renderPage(template, null);
+ autoTester.testRendered();
+ Map<String, String> styleAttributes = new HashMap<String, String>();
+ styleAttributes.put("width", "100%");
+ styleAttributes.put("color", "yellow");
+ autoTester.testHTMLEvents();
+ Assert.assertTrue(selenium.getAttribute("xpath=id('"
+ + autoTester.getClientId(AutoTester.COMPONENT_ID) + "')/div@class")
+ .indexOf("noname") != -1);
+ Assert.assertTrue(selenium.getAttribute("xpath=id('"
+ + autoTester.getClientId(AutoTester.COMPONENT_ID) +
"')/div(a)style").toLowerCase()
+ .indexOf("color: yellow") != -1);
+ }
+
+ @Override
+ public String getTestUrl() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getAutoTestUrl() {
+ return "pages/separator/separatorAutoTest.xhtml";
+ }
+}