Author: alevkovsky
Date: 2009-01-20 08:44:58 -0500 (Tue, 20 Jan 2009)
New Revision: 12350
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/toolBar/toolBarAutoTest.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ToolBarTest.java
Log:
Tool bar selenium tests
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/toolBar/toolBarAutoTest.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/toolBar/toolBarAutoTest.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ToolBarTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ToolBarTest.java 2009-01-20
12:41:33 UTC (rev 12349)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ToolBarTest.java 2009-01-20
13:44:58 UTC (rev 12350)
@@ -20,18 +20,23 @@
*/
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.annotations.Test;
public class ToolBarTest extends SeleniumTestBase {
+
+ static final Map<String, String> TOOL_BAR_STYLES = new HashMap<String,
String>();
+ static {
+ TOOL_BAR_STYLES.put("font-size", "16px");
+ }
private static final String TOOLBAR = "toolbar";
- private final static String RESULT_FAILED_TEXT = "No";
-
- private final static String RESULT_PASSED_TEXT = "Passed";
-
/* Tab panel group/item separator constants */
private final static String LINE_SEPARATOR = "line";
@@ -67,38 +72,33 @@
clickAjaxCommandAndWait(id + "gis_" + SQUARE_SEPARATOR);
clickAjaxCommandAndWait(id + "gis_" + NONE_SEPARATOR);
}
-
+
@Test
- public void testToolBarEvents(Template template) {
- renderPage(template);
+ public void testRendered(Template template){
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+
+ tester.testRendered();
+ }
+
+ @Test
+ public void testStylesAndClassesAndHtmlAttributes(Template template){
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+
+ tester.testStyleAndClasses(new String [] {"rich-toolbar",
"styleClass"}, TOOL_BAR_STYLES);
+ tester.testHTMLEvents();
+ }
- writeStatus("Check component event triggering");
- String toolbar = getParentId() + TOOLBAR + "_click";
- testOnclickEvent(toolbar, toolbar + "_result", RESULT_FAILED_TEXT,
RESULT_PASSED_TEXT);
-
- toolbar = getParentId() + TOOLBAR + "_dblclick";
- testOnDblclickEvent(toolbar, toolbar + "_result", RESULT_FAILED_TEXT,
RESULT_PASSED_TEXT);
-
- toolbar = getParentId() + TOOLBAR + "_mousedown";
- testOnmousedownEvent(toolbar, toolbar + "_result", RESULT_FAILED_TEXT,
RESULT_PASSED_TEXT);
-
- toolbar = getParentId() + TOOLBAR + "_mousemove";
- testOnmousemoveEvent(toolbar, toolbar + "_result", RESULT_FAILED_TEXT,
RESULT_PASSED_TEXT);
-
- toolbar = getParentId() + TOOLBAR + "_mouseout";
- testOnmouseoutEvent(toolbar, toolbar + "_result", RESULT_FAILED_TEXT,
RESULT_PASSED_TEXT);
-
- toolbar = getParentId() + TOOLBAR + "_mouseover";
- testOnmouseoverEvent(toolbar, toolbar + "_result", RESULT_FAILED_TEXT,
RESULT_PASSED_TEXT);
-
- toolbar = getParentId() + TOOLBAR + "_mouseup";
- testOnmouseupEvent(toolbar, toolbar + "_result", RESULT_FAILED_TEXT,
RESULT_PASSED_TEXT);
- }
-
@Override
public String getTestUrl() {
return "pages/toolBar/toolBarTest.xhtml";
}
+
+ @Override
+ public String getAutoTestUrl() {
+ return "pages/toolBar/toolBarAutoTest.xhtml";
+ }
}
Show replies by date