Author: konstantin.mishin
Date: 2009-02-27 13:41:08 -0500 (Fri, 27 Feb 2009)
New Revision: 12775
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/gmap/
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/gmap/gmapAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/GmapTest.java
Log:
RF-6283
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/gmap/gmapAutoTest.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/gmap/gmapAutoTest.xhtml
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/gmap/gmapAutoTest.xhtml 2009-02-27
18:41:08 UTC (rev 12775)
@@ -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:gmap 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/GmapTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/GmapTest.java
(rev 0)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/GmapTest.java 2009-02-27
18:41:08 UTC (rev 12775)
@@ -0,0 +1,50 @@
+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 GmapTest extends SeleniumTestBase {
+
+ /**
+ * component is present on the page together with map images and there are no JS
errors
+ */
+ @Test
+ public void testImages(Template template) {
+ AutoTester autoTester = getAutoTester(this);
+ autoTester.renderPage(template, null);
+ Assert.assertTrue(selenium.getXpathCount("id('" +
autoTester.getClientId(AutoTester.COMPONENT_ID) + "')//img").intValue() !=
0);
+ runScript("map.setZoom(1)");
+ }
+
+ /**
+ * 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.testStyleAndClasses(new String[]{"noname"}, styleAttributes);
+ autoTester.testHTMLEvents();
+ }
+
+ @Override
+ public String getTestUrl() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getAutoTestUrl() {
+ return "pages/gmap/gmapAutoTest.xhtml";
+ }
+}