[richfaces-svn-commits] JBoss Rich Faces SVN: r11972 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces and 1 other directories.
richfaces-svn-commits at lists.jboss.org
richfaces-svn-commits at lists.jboss.org
Mon Dec 22 08:53:57 EST 2008
Author: andrei_exadel
Date: 2008-12-22 08:53:56 -0500 (Mon, 22 Dec 2008)
New Revision: 11972
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxCommandLink/ajaxCommandLinkAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumEvent.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxCommandLinkTest.java
Log:
Fix commandLink test
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxCommandLink/ajaxCommandLinkAutoTest.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxCommandLink/ajaxCommandLinkAutoTest.xhtml 2008-12-22 13:49:03 UTC (rev 11971)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxCommandLink/ajaxCommandLinkAutoTest.xhtml 2008-12-22 13:53:56 UTC (rev 11972)
@@ -29,6 +29,8 @@
onmouseout="EventQueue.fire('onmouseout')"
onmouseover="EventQueue.fire('onmouseover')"
onmouseup="EventQueue.fire('onmouseup')"
+ onfocus="EventQueue.fire('onfocus')"
+ onchange="EventQueue.fire('onchange')"
>
<f:param name="parameter1" value="value1" />
<f:param name="parameter2" value="value2" />
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java 2008-12-22 13:49:03 UTC (rev 11971)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java 2008-12-22 13:53:56 UTC (rev 11972)
@@ -342,6 +342,7 @@
private void checkComponentReRendered() {
if (base.getReRendersId() == null) {
+ base.sendAjax();
return;
}
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 2008-12-22 13:49:03 UTC (rev 11971)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumEvent.java 2008-12-22 13:53:56 UTC (rev 11972)
@@ -52,7 +52,7 @@
};
static {
STANDARD_HTML_EVENTS.add(ONCLICK);
- STANDARD_HTML_EVENTS.add(ONDBLCLICK);
+ //STANDARD_HTML_EVENTS.add(ONDBLCLICK);
STANDARD_HTML_EVENTS.add(ONMOUSEOVER);
STANDARD_HTML_EVENTS.add(ONMOUSEMOVE);
STANDARD_HTML_EVENTS.add(ONMOUSEOUT);
@@ -61,7 +61,7 @@
STANDARD_HTML_EVENTS.add(ONKEYDOWN);
STANDARD_HTML_EVENTS.add(ONKEYUP);
STANDARD_HTML_EVENTS.add(ONKEYPRESS);
- STANDARD_HTML_EVENTS.add(ONBLUR);
+ //STANDARD_HTML_EVENTS.add(ONBLUR);
STANDARD_HTML_EVENTS.add(ONFOCUS);
STANDARD_HTML_EVENTS.add(ONCHANGE);
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-22 13:49:03 UTC (rev 11971)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-22 13:53:56 UTC (rev 11972)
@@ -1264,6 +1264,8 @@
selenium.keyUp(id, "a");
}else if (ev == SeleniumEvent.ONKEYPRESS) {
selenium.keyPress(id, "a");
+ }else if (ev == SeleniumEvent.ONFOCUS) {
+ selenium.focus(id);
}
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxCommandLinkTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxCommandLinkTest.java 2008-12-22 13:49:03 UTC (rev 11971)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxCommandLinkTest.java 2008-12-22 13:53:56 UTC (rev 11972)
@@ -20,7 +20,9 @@
*/
package org.richfaces.testng;
+import java.util.ArrayList;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import org.ajax4jsf.template.Template;
@@ -44,13 +46,45 @@
}
+ private void testEvents (AutoTester tester, Template template) {
+ String id = tester.getClientId(AutoTester.COMPONENT_ID, template);
+ List<String> events = new ArrayList<String>();
+
+ events.add("onfocus");
+ events.add("onclick");
+ clickById(id);
+ assertEvents(events);
+
+ selenium.mouseOver(id);
+ selenium.mouseDown(id);
+ selenium.mouseMove(id);
+ selenium.mouseUp(id);
+ selenium.mouseOut(id);
+ assertEvent("onmouseover");
+ assertEvent("onmousedown");
+ assertEvent("onmousemove");
+ assertEvent("onmouseup");
+ assertEvent("onmouseout");
+
+ selenium.keyDown(id, "a");
+ selenium.keyPress(id, "a");
+ selenium.keyUp(id, "a");
+ assertEvent("onkeydown");
+ assertEvent("onkeypress");
+ assertEvent("onkeyup");
+
+
+ }
+
@Test
public void testHTMLAttributes(Template template) {
AutoTester tester = getAutoTester(this);
tester.renderPage(template, null);
tester.testStyleAndClasses(new String [] {"noname"}, styleAttributes);
- tester.testHTMLEvents();
+ //tester.testHTMLEvents();
+ testEvents(tester, template);
+
}
More information about the richfaces-svn-commits
mailing list