Author: dsvyatobatsko
Date: 2008-11-19 11:12:10 -0500 (Wed, 19 Nov 2008)
New Revision: 11237
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TreeTest.java
Log:
https://jira.jboss.org/jira/browse/RF-4820
https://jira.jboss.org/jira/browse/RF-4821
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-19
14:31:29 UTC (rev 11236)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TreeTest.java 2008-11-19
16:12:10 UTC (rev 11237)
@@ -42,6 +42,7 @@
tester.reset();
tester.setupControl(TestSetupEntry.ajaxSingle, Boolean.TRUE);
tester.clickLoad();
+ //navigate to the first child
String compId = getAutoTester(this).getClientId(AutoTester.COMPONENT_ID);
clickAjaxCommandAndWait("//*[@id='"+ compId +
":childs']/table[1]/tbody/tr/td/div/a");
clickAjaxCommandAndWait("//*[@id='"+ compId +
":childs']/div/table[1]/tbody/tr/td/div/a");
@@ -61,9 +62,11 @@
tester.reset();
tester.setupControl(TestSetupEntry.ajaxSingle, Boolean.TRUE);
tester.clickLoad();
+ writeStatus("Navigate to the first child");
String compId = getAutoTester(this).getClientId(AutoTester.COMPONENT_ID);
clickAjaxCommandAndWait("//*[@id='"+ compId +
":childs']/table[1]/tbody/tr/td/div/a");
clickAjaxCommandAndWait("//*[@id='"+ compId +
":childs']/div/table[1]/tbody/tr/td/div/a");
+ writeStatus("Set a new invalid value for the child");
type("//*[@id='"+ compId +
":childs']/div/div/table[1]/tbody/tr/td[3]/input", "");
tester.startTracing();
writeStatus("Test ajaxSingle attribute in case of invalid component
state");
@@ -72,6 +75,49 @@
tester.checkNodeExpandedListener(false);
}
+ @Test
+ public void testImmediate(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+ tester.reset();
+ tester.setupControl(TestSetupEntry.immediate, Boolean.TRUE);
+ tester.clickLoad();
+ writeStatus("Navigate to the first child");
+ String compId = getAutoTester(this).getClientId(AutoTester.COMPONENT_ID);
+ clickAjaxCommandAndWait("//*[@id='"+ compId +
":childs']/table[1]/tbody/tr/td/div/a");
+ clickAjaxCommandAndWait("//*[@id='"+ compId +
":childs']/div/table[1]/tbody/tr/td/div/a");
+ writeStatus("Set a new value for the child");
+ type("//*[@id='"+ compId +
":childs']/div/div/table[1]/tbody/tr/td[3]/input", "New");
+ tester.startTracing();
+ writeStatus("Test immediate attribute");
+ clickAjaxCommandAndWait("//*[@id='"+ compId +
":childs']/div/table[1]/tbody/tr/td/div/a");
+ tester.checkUpdateModel(true);
+ tester.checkNodeExpandedListener(true);
+ }
+
+ @Test
+ public void testImmediateWithExternalValidationFailed(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+ tester.reset();
+ tester.setupControl(TestSetupEntry.immediate, Boolean.TRUE);
+ tester.clickLoad();
+ tester.startTracing();
+ writeStatus("Navigate to the first child");
+ String compId = getAutoTester(this).getClientId(AutoTester.COMPONENT_ID);
+ clickAjaxCommandAndWait("//*[@id='"+ compId +
":childs']/table[1]/tbody/tr/td/div/a");
+ clickAjaxCommandAndWait("//*[@id='"+ compId +
":childs']/div/table[1]/tbody/tr/td/div/a");
+ writeStatus("set a new value for the child");
+ type("//*[@id='"+ compId +
":childs']/div/div/table[1]/tbody/tr/td[3]/input", "New");
+ writeStatus("Set external validation to fail");
+ tester.setExtrenalValidationFailed();
+ tester.startTracing();
+ writeStatus("Test immediate attribute with external validation
failed");
+ clickAjaxCommandAndWait("//*[@id='"+ compId +
":childs']/div/table[1]/tbody/tr/td/div/a");
+ tester.checkUpdateModel(false);
+ tester.checkNodeExpandedListener(true);
+ }
+
@Override
public void sendAjax() {
AutoTester tester = getAutoTester(this);
@@ -89,4 +135,5 @@
public String getAutoTestUrl() {
return "pages/tree/treeAutoTest.xhtml";
}
+
}