Author: andrei_exadel
Date: 2009-01-10 04:56:06 -0500 (Sat, 10 Jan 2009)
New Revision: 12185
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxCommandButton/autoTestCommandButton.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumEvent.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java
Log:
RF-5542
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxCommandButton/autoTestCommandButton.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxCommandButton/autoTestCommandButton.xhtml 2009-01-09
20:29:30 UTC (rev 12184)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxCommandButton/autoTestCommandButton.xhtml 2009-01-10
09:56:06 UTC (rev 12185)
@@ -9,6 +9,20 @@
<ui:composition template="#{templateBean.autoTestTemplate}">
<ui:define name="component">
<a4j:commandButton id="componentId" value="Button"
+ style="font-weight: bold; color: green;"
+ tabindex="1"
+ alt="Command Button alt"
+ title="Command Button title"
+ styleClass="commandStyle"
+ 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')"
actionListener="#{autoTestBean.actionListener}"
reRender="#{autoTestBean.reRender}"
limitToList="#{autoTestBean.limitToList}"
@@ -16,6 +30,7 @@
rendered="#{autoTestBean.rendered}"
</a4j:commandButton>
+ <rich:effect></rich:effect>
</ui:define>
</ui:composition>
</html>
\ No newline at end of file
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumEvent.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumEvent.java 2009-01-09
20:29:30 UTC (rev 12184)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumEvent.java 2009-01-10
09:56:06 UTC (rev 12185)
@@ -62,8 +62,8 @@
STANDARD_HTML_EVENTS.add(ONKEYUP);
STANDARD_HTML_EVENTS.add(ONKEYPRESS);
//STANDARD_HTML_EVENTS.add(ONBLUR);
- STANDARD_HTML_EVENTS.add(ONFOCUS);
- STANDARD_HTML_EVENTS.add(ONCHANGE);
+ //STANDARD_HTML_EVENTS.add(ONFOCUS);
+ //STANDARD_HTML_EVENTS.add(ONCHANGE);
}
private SeleniumEvent(String name) {
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java 2009-01-09
20:29:30 UTC (rev 12184)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxCommandButtonTest.java 2009-01-10
09:56:06 UTC (rev 12185)
@@ -20,6 +20,9 @@
*/
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;
@@ -29,7 +32,32 @@
public class AjaxCommandButtonTest extends SeleniumTestBase {
+ static final String [] CSS_CLASSES = new String [] {"commandStyle"};
+ static final Map<String, String> CSS_STYLES = new HashMap<String,
String>();
+
+ static {
+ CSS_STYLES.put("font-weight", "bold");
+ CSS_STYLES.put("color", "green");
+ }
+
+
@Test
+ public void testStylesClassesAndEvents(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+
+ tester.testStyleAndClasses(CSS_CLASSES, CSS_STYLES);
+
+ String componentId = tester.getClientId(AutoTester.COMPONENT_ID, template);
+ assertAttributeContains(componentId, "title", "Command Button
title", "");
+ assertAttributeContains(componentId, "alt", "Command Button alt",
"");
+ assertAttributeContains(componentId, "tabIndex", "1",
"");
+
+ tester.testHTMLEvents();
+
+ }
+
+ @Test
public void testLimit2ListAttribute(Template template) {
AutoTester tester = getAutoTester(this);
tester.renderPage(template, null);