Author: ppitonak(a)redhat.com
Date: 2011-10-13 05:51:18 -0400 (Thu, 13 Oct 2011)
New Revision: 22795
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/TestPickList.java
Log:
tests for pick list fixed
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/TestPickList.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/TestPickList.java 2011-10-13
09:23:47 UTC (rev 22794)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/TestPickList.java 2011-10-13
09:51:18 UTC (rev 22795)
@@ -32,7 +32,9 @@
import java.net.URL;
+import org.atmosphere.client.JavascriptClientFilter;
import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.encapsulated.JavaScript;
import org.jboss.test.selenium.locator.Attribute;
import org.jboss.test.selenium.locator.ElementLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
@@ -405,7 +407,14 @@
@Test
@IssueTracking("https://issues.jboss.org/browse/RF-11322")
public void testOnsourceblur() {
- testFireEvent(Event.BLUR, pickListSource, "sourceblur");
+ ElementLocator<?> eventInput =
pjq("input[id$=onsourceblurInput]");
+ String value = "metamerEvents += \"blur \"";
+
+ guardHttp(selenium).type(eventInput, value);
+ selenium.click(pickListSrcItems);
+ selenium.click(pickListTargetItems);
+
+ waitGui.failWith("Attribute onsourceblur does not work
correctly").until(new EventFiredCondition(Event.BLUR));
}
@Test
@@ -421,25 +430,57 @@
@Test
@IssueTracking("https://issues.jboss.org/browse/RF-11322")
public void testOnsourcefocus() {
- testFireEvent(Event.FOCUS, pickListSource, "sourcefocus");
+ ElementLocator<?> eventInput =
pjq("input[id$=onsourcefocusInput]");
+ String value = "metamerEvents += \"focus \"";
+
+ guardHttp(selenium).type(eventInput, value);
+ selenium.click(pickListSrcItems);
+
+ waitGui.failWith("Attribute onsourcefocus does not work
correctly").until(new EventFiredCondition(Event.FOCUS));
}
@Test
@IssueTracking({ "https://issues.jboss.org/browse/RFPL-1659",
"https://issues.jboss.org/browse/RF-11322" })
public void testOnsourcekeydown() {
- testFireEvent(Event.KEYDOWN, pickListSource, "sourcekeydown");
+ ElementLocator<?> eventInput =
pjq("input[id$=onsourcekeydownInput]");
+ String value = "metamerEvents += \"keydown \"";
+
+ guardHttp(selenium).type(eventInput, value);
+ selenium.fireEvent(pickListSrcItems, Event.KEYDOWN);
+ JavaScript script = new
JavaScript("window.jQuery('div[id$=pickListSourceItems]').keydown()");
+ selenium.getEval(script);
+
+ waitGui.failWith("Attribute onsourcekeydown does not work
correctly").until(
+ new EventFiredCondition(Event.KEYDOWN));
}
@Test
@IssueTracking({ "https://issues.jboss.org/browse/RFPL-1659",
"https://issues.jboss.org/browse/RF-11322" })
public void testOnsourcekeypress() {
- testFireEvent(Event.KEYPRESS, pickListSource, "sourcekeypress");
+ ElementLocator<?> eventInput =
pjq("input[id$=onsourcekeypressInput]");
+ String value = "metamerEvents += \"keypress \"";
+
+ guardHttp(selenium).type(eventInput, value);
+ selenium.fireEvent(pickListSrcItems, Event.KEYPRESS);
+ JavaScript script = new
JavaScript("window.jQuery('div[id$=pickListSourceItems]').keypress()");
+ selenium.getEval(script);
+
+ waitGui.failWith("Attribute onsourcekeypress does not work
correctly").until(
+ new EventFiredCondition(Event.KEYPRESS));
}
@Test
@IssueTracking({ "https://issues.jboss.org/browse/RFPL-1659",
"https://issues.jboss.org/browse/RF-11322" })
public void testOnsourcekeyup() {
- testFireEvent(Event.KEYUP, pickListSource, "sourcekeyup");
+ ElementLocator<?> eventInput =
pjq("input[id$=onsourcekeyupInput]");
+ String value = "metamerEvents += \"keyup \"";
+
+ guardHttp(selenium).type(eventInput, value);
+ selenium.fireEvent(pickListSrcItems, Event.KEYUP);
+ JavaScript script = new
JavaScript("window.jQuery('div[id$=pickListSourceItems]').keyup()");
+ selenium.getEval(script);
+
+ waitGui.failWith("Attribute onsourcekeyup does not work
correctly").until(new EventFiredCondition(Event.KEYUP));
}
@Test
@@ -470,7 +511,14 @@
@Test
@IssueTracking("https://issues.jboss.org/browse/RF-11322")
public void testOntargetblur() {
- testFireEvent(Event.BLUR, pickListTarget, "targetblur");
+ ElementLocator<?> eventInput =
pjq("input[id$=ontargetblurInput]");
+ String value = "metamerEvents += \"blur \"";
+
+ guardHttp(selenium).type(eventInput, value);
+ selenium.click(pickListTargetItems);
+ selenium.click(pickListSrcItems);
+
+ waitGui.failWith("Attribute ontargetblur does not work
correctly").until(new EventFiredCondition(Event.BLUR));
}
@Test
@@ -486,25 +534,57 @@
@Test
@IssueTracking("https://issues.jboss.org/browse/RF-11322")
public void testOntargetfocus() {
- testFireEvent(Event.FOCUS, pickListTarget, "targetfocus");
+ ElementLocator<?> eventInput =
pjq("input[id$=ontargetfocusInput]");
+ String value = "metamerEvents += \"focus \"";
+
+ guardHttp(selenium).type(eventInput, value);
+ selenium.click(pickListTargetItems);
+
+ waitGui.failWith("Attribute ontargetfocus does not work
correctly").until(new EventFiredCondition(Event.FOCUS));
}
@Test
@IssueTracking({ "https://issues.jboss.org/browse/RFPL-1659",
"https://issues.jboss.org/browse/RF-11322" })
public void testOntargetkeydown() {
- testFireEvent(Event.KEYDOWN, pickListTarget, "targetkeydown");
+ ElementLocator<?> eventInput =
pjq("input[id$=ontargetkeydownInput]");
+ String value = "metamerEvents += \"keydown \"";
+
+ guardHttp(selenium).type(eventInput, value);
+ selenium.fireEvent(pickListTargetItems, Event.KEYDOWN);
+ JavaScript script = new
JavaScript("window.jQuery('div[id$=pickListTargetItems]').keydown()");
+ selenium.getEval(script);
+
+ waitGui.failWith("Attribute ontargetkeydown does not work
correctly").until(
+ new EventFiredCondition(Event.KEYDOWN));
}
@Test
@IssueTracking({ "https://issues.jboss.org/browse/RFPL-1659",
"https://issues.jboss.org/browse/RF-11322" })
public void testOntargetkeypress() {
- testFireEvent(Event.KEYPRESS, pickListTarget, "targetkeypress");
+ ElementLocator<?> eventInput =
pjq("input[id$=ontargetkeypressInput]");
+ String value = "metamerEvents += \"keypress \"";
+
+ guardHttp(selenium).type(eventInput, value);
+ selenium.fireEvent(pickListTargetItems, Event.KEYPRESS);
+ JavaScript script = new
JavaScript("window.jQuery('div[id$=pickListTargetItems]').keypress()");
+ selenium.getEval(script);
+
+ waitGui.failWith("Attribute ontargetkeypress does not work
correctly").until(
+ new EventFiredCondition(Event.KEYPRESS));
}
@Test
@IssueTracking({ "https://issues.jboss.org/browse/RFPL-1659",
"https://issues.jboss.org/browse/RF-11322" })
public void testOntargetkeyup() {
- testFireEvent(Event.KEYUP, pickListTarget, "targetkeyup");
+ ElementLocator<?> eventInput =
pjq("input[id$=ontargetkeyupInput]");
+ String value = "metamerEvents += \"keyup \"";
+
+ guardHttp(selenium).type(eventInput, value);
+ selenium.fireEvent(pickListTargetItems, Event.KEYUP);
+ JavaScript script = new
JavaScript("window.jQuery('div[id$=pickListTargetItems]').keyup()");
+ selenium.getEval(script);
+
+ waitGui.failWith("Attribute ontargetkeyup does not work
correctly").until(new EventFiredCondition(Event.KEYUP));
}
@Test