Author: dsvyatobatsko
Date: 2008-11-20 09:45:18 -0500 (Thu, 20 Nov 2008)
New Revision: 11270
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestHiddens.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TreeTest.java
Log:
https://jira.jboss.org/jira/browse/RF-4829,
https://jira.jboss.org/jira/browse/RF-4830
completed
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestHiddens.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestHiddens.xhtml 2008-11-20
13:02:24 UTC (rev 11269)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestHiddens.xhtml 2008-11-20
14:45:18 UTC (rev 11270)
@@ -4,10 +4,10 @@
xmlns:rich="http://richfaces.org/rich"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
- <h:inputHidden id="_auto_input" value="#{autoTestBean.input}"
required="true"></h:inputHidden>
+ <h:inputHidden id="_auto_input" value="#{autoTestBean.input}"
required="true"></h:inputHidden>
<h:outputText id="_auto_status" style="display: none;"
value="#{autoTestBean.status}"></h:outputText>
<h:outputText id="_auto_time" style="display: none;"
value="#{autoTestBean.text}"></h:outputText>
<h:commandButton id="_auto_simple_submit" value="Simple submit"
immediate="#{autoTestBean.immediate}" style="display: none;" />
<a4j:commandButton id="_auto_ajax_submit" value="Ajax submit"
reRender="componentId" immediate="#{autoTestBean.immediate}"
style="display: none;" />
- <a4j:commandButton id="_auto_ajax_reset" value="Ajax reset"
ajaxSingle="true" style="display: none;"
action="#{autoTestBean.reset}" />
+ <a4j:commandButton id="_auto_ajax_reset" value="Ajax reset"
ajaxSingle="true" style="display: none;"
action="#{autoTestBean.reset}" reRender="_auto_status"/>
</html>
\ No newline at end of file
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TreeTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TreeTest.java 2008-11-20
13:02:24 UTC (rev 11269)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TreeTest.java 2008-11-20
14:45:18 UTC (rev 11270)
@@ -128,7 +128,7 @@
tester.renderPage(template, INIT_TOGGLE_ON_CLICK_SERVER_MODE);
tester.reset();
tester.clickLoad();
- writeStatus("Try to toggle a node with server swith type");
+ writeStatus("Try to toggle a node by click with server swith type");
String compId = getAutoTester(this).getClientId(AutoTester.COMPONENT_ID);
selenium.click("//*[@id='"+ compId +
":childs']/table[1]/tbody/tr/td[3]");
waitForPageToLoad();
@@ -140,7 +140,7 @@
writeStatus("Test the same in case of external validation failure");
writeStatus("Set external validation to fail");
tester.setExtrenalValidationFailed();
- selenium.click("//*[@id='"+ compId +
":childs']/div/table[1]/tbody/tr/td[3]");
+ selenium.click("//*[@id='"+ compId +
":childs']/table[1]/tbody/tr/td[3]");
waitForPageToLoad();
writeStatus("Check the node is not collapsed and no listeners are invoked
due to external validation error");
Assert.assertTrue(isPresent("//*[@id='"+ compId +
":childs']/div/table[1]/tbody/tr/td[3]"), "Node has been
collapsed");
@@ -148,6 +148,54 @@
tester.checkUpdateModel(false);
}
+ @Test
+ public void testToggleOnClickTrueWithAjaxMode(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, INIT_TOGGLE_ON_CLICK_AJAX_MODE);
+ tester.reset();
+ tester.clickLoad();
+ writeStatus("Try to toggle a node by click with ajax swith type");
+ String compId = getAutoTester(this).getClientId(AutoTester.COMPONENT_ID);
+ clickAjaxCommandAndWait("//*[@id='"+ compId +
":childs']/table[1]/tbody/tr/td[3]");
+ writeStatus("Check the node is expanded and proper listeners are
invoked");
+ Assert.assertTrue(isPresent("//*[@id='"+ compId +
":childs']/div/table[1]/tbody/tr/td[3]"), "Node has not been
expanded");
+ tester.checkNodeExpandedListener(true);
+ tester.checkUpdateModel(true);
+ tester.startTracing();
+ writeStatus("Test the same in case of external validation failure");
+ writeStatus("Set external validation to fail");
+ tester.setExtrenalValidationFailed();
+ clickAjaxCommandAndWait("//*[@id='"+ compId +
":childs']/table[1]/tbody/tr/td[3]");
+ writeStatus("Check the node is not collapsed and no listeners are invoked
thanks to external validation error");
+ Assert.assertTrue(isPresent("//*[@id='"+ compId +
":childs']/div/table[1]/tbody/tr/td[3]"), "Node has been
collapsed");
+ tester.checkNodeExpandedListener(false);
+ tester.checkUpdateModel(false);
+ }
+
+ @Test
+ public void testToggleOnClickTrueWithClientMode(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, INIT_TOGGLE_ON_CLICK_CLIENT_MODE);
+ tester.reset();
+ tester.clickLoad();
+ writeStatus("Try to toggle a node by click with client swith type");
+ String compId = getAutoTester(this).getClientId(AutoTester.COMPONENT_ID);
+ selenium.click("//*[@id='"+ compId +
":childs']/table[1]/tbody/tr/td[3]");
+ writeStatus("Check the node is expanded and no listeners are
invoked");
+ Assert.assertTrue(isPresent("//*[@id='"+ compId +
":childs']/div/table[1]/tbody/tr/td[3]"), "Node has not been
expanded");
+ tester.checkNodeExpandedListener(false);
+ tester.checkUpdateModel(false);
+ tester.startTracing();
+ writeStatus("Test the same in case of external validation failure");
+ writeStatus("Set external validation to fail");
+ tester.setExtrenalValidationFailed();
+ selenium.click("//*[@id='"+ compId +
":childs']/table[1]/tbody/tr/td[3]");
+ writeStatus("Check the node is collapsed and no listeners are invoked
anyway");
+ Assert.assertTrue(isPresent("//*[@id='"+ compId +
":childs']/div/table[1]/tbody/tr/td[3]"), "Node has not been
collapsed");
+ tester.checkNodeExpandedListener(false);
+ tester.checkUpdateModel(false);
+ }
+
@Override
public void sendAjax() {
AutoTester tester = getAutoTester(this);