Author: konstantin.mishin
Date: 2009-03-10 10:46:13 -0400 (Tue, 10 Mar 2009)
New Revision: 12907
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/HotKeyBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/hotKey/hotKey.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/HotKeyTest.java
Log:
RF-6290
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/HotKeyBean.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/HotKeyBean.java 2009-03-10
13:37:08 UTC (rev 12906)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/HotKeyBean.java 2009-03-10
14:46:13 UTC (rev 12907)
@@ -4,8 +4,11 @@
private String key;
+ private String timing;
+
public void init() {
key = null;
+ timing = "immediate";
}
public void setKey(String key) {
@@ -15,4 +18,12 @@
public String getKey() {
return key;
}
+
+ public void setTiming(String timing) {
+ this.timing = timing;
+ }
+
+ public String getTiming() {
+ return timing;
+ }
}
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/hotKey/hotKey.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/hotKey/hotKey.xhtml 2009-03-10
13:37:08 UTC (rev 12906)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/hotKey/hotKey.xhtml 2009-03-10
14:46:13 UTC (rev 12907)
@@ -13,9 +13,14 @@
<h:inputText id="key" value="#{hotKey.key}">
<a4j:support event="onchange" reRender="panelGroup"/>
</h:inputText>
+ <h:outputText value="timing" />
+ <h:inputText id="timing" value="#{hotKey.timing}">
+ <a4j:support event="onchange" reRender="panelGroup"/>
+ </h:inputText>
</h:form>
<h:panelGroup id="panelGroup">
- <rich:hotKey id="hotKey" key="#{hotKey.key}"
handler="document.getElementById('input').value =
'#{hotKey.key}'"/>
+ <rich:hotKey id="hotKey" timing="#{hotKey.timing}"
key="#{hotKey.key}"
+ handler="document.getElementById('input').value =
'#{hotKey.key}'"/>
<input id="input" />
</h:panelGroup>
</ui:define>
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/HotKeyTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/HotKeyTest.java 2009-03-10
13:37:08 UTC (rev 12906)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/HotKeyTest.java 2009-03-10
14:46:13 UTC (rev 12907)
@@ -9,14 +9,17 @@
private String key;
+ private String timing;
+
private String hotKey;
private String input;
private void init(Template template) {
- renderPage(null, template, "#{dataList.init}");
+ renderPage(null, template, "#{hotKey.init}");
String attrForm = getParentId() + "attrForm";
key = attrForm + ":key";
+ timing = attrForm + ":timing";
hotKey = getParentId() + "hotKey";
input = "input";
}
@@ -115,6 +118,25 @@
Assert.assertEquals(selenium.getValue(input), keySequence);
}
+ /**
+ * Define hotKey component with timing="onregistercall" and check that it
does not work
+ */
+ @Test
+ public void testOnRegisterCall(Template template) {
+ init(template);
+ String keySequence = "return";
+ selenium.type(key, keySequence);
+ waitForAjaxCompletion();
+ selenium.type(timing, "onregistercall");
+ waitForAjaxCompletion();
+ selenium.runScript("var hotKey = document.getElementById('" + hotKey +
"').component");
+ selenium.keyDown(input, "\\13");
+ Assert.assertEquals(selenium.getValue(input), "");
+ selenium.runScript("hotKey.enable()");
+ selenium.keyDown(input, "\\13");
+ Assert.assertEquals(selenium.getValue(input), keySequence);
+ }
+
@Override
public String getTestUrl() {
return "pages/hotKey/hotKey.xhtml";
Show replies by date