Author: andrei_exadel
Date: 2009-02-13 08:42:30 -0500 (Fri, 13 Feb 2009)
New Revision: 12654
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/bean/AutoTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestControls.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestNavigationPage.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/layout.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxCommandLink/testListenerAndNavigation.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.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:
RF-6049, RF-6048, RF-6044, RF-6045
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/bean/AutoTestBean.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/bean/AutoTestBean.java 2009-02-13
13:33:28 UTC (rev 12653)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/bean/AutoTestBean.java 2009-02-13
13:42:30 UTC (rev 12654)
@@ -107,6 +107,8 @@
private String processInput;
private boolean processSet = false;
+
+ private boolean processExternalValidationSet = false;
private boolean required;
@@ -510,7 +512,7 @@
}
public String getProcess() {
- return (processSet) ? "_auto_process_input" : "_auto_input";
+ return (processSet) ? "_auto_process_input" :
(processExternalValidationSet) ? "_auto_input" : null;
}
/**
@@ -529,4 +531,14 @@
this.required = required;
}
+ public boolean isProcessExternalValidationSet() {
+ return processExternalValidationSet;
+ }
+
+ public void setProcessExternalValidationSet(boolean processExternalValidationSet) {
+ this.processExternalValidationSet = processExternalValidationSet;
+ }
+
+
+
}
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestControls.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestControls.xhtml 2009-02-13
13:33:28 UTC (rev 12653)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestControls.xhtml 2009-02-13
13:42:30 UTC (rev 12654)
@@ -67,6 +67,12 @@
</td>
</tr>
<tr>
+ <td>Process ext valid. fail:</td>
+ <td>
+ <h:selectBooleanCheckbox id="_auto_processExtValid"
value="#{autoTestBean.processExternalValidationSet}"></h:selectBooleanCheckbox>
+ </td>
+ </tr>
+ <tr>
<td>Required:</td>
<td>
<h:selectBooleanCheckbox id="_auto_required"
value="#{autoTestBean.required}"></h:selectBooleanCheckbox>
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestNavigationPage.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestNavigationPage.xhtml 2009-02-13
13:33:28 UTC (rev 12653)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestNavigationPage.xhtml 2009-02-13
13:42:30 UTC (rev 12654)
@@ -7,8 +7,10 @@
<ui:composition template="#{templateBean.autoTestTemplate}">
<ui:define name="component">
<p id="_auto_test_navigation">Navigation successfully</p>
+ </ui:define>
+ <ui:define name="footer">
<script>
- window.done=true;
+ window.done = true;
</script>
</ui:define>
</ui:composition>
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/layout.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxCommandLink/testListenerAndNavigation.xhtml
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxCommandLink/testListenerAndNavigation.xhtml 2009-02-13
13:33:28 UTC (rev 12653)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxCommandLink/testListenerAndNavigation.xhtml 2009-02-13
13:42:30 UTC (rev 12654)
@@ -13,6 +13,8 @@
actionListener="#{autoTestBean.actionListener}"
immediate="#{autoTestBean.immediate}"
ajaxSingle="#{autoTestBean.ajaxSingle}"
+ process="#{autoTestBean.process}"
+ reRender="#{autoTestBean.reRender}"
value="Link"
<f:actionListener
type="org.ajax4jsf.autotest.bean.AutoTestListener" />
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 2009-02-13
13:33:28 UTC (rev 12653)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java 2009-02-13
13:42:30 UTC (rev 12654)
@@ -73,15 +73,6 @@
this.base = base;
}
- public void navigate() {
- base.navigate();
-
base.waiteForCondition("document.getElementById('_auto_test_navigation') !=
null", 10000);
-
- if (!"Navigation
successfully".equals(base.getTextById("_auto_test_navigation"))) {
- Assert.fail("Navigation has not been occurred");
- }
- }
-
public void renderPage(Template template, String resetMethodName) {
base.renderAutoTestPage(template, resetMethodName);
}
@@ -138,9 +129,10 @@
reset();
clickLoad();
- navigate();
+ base.sendAjax();
checkAction(true);
+ checkNavigation(true);
}
public void testExtrenalValidationFailure() {
@@ -170,6 +162,7 @@
public void testAjaxSingleWithProcesExternalValidation(boolean checkListener) {
reset();
setupControl(TestSetupEntry.ajaxSingle, Boolean.TRUE);
+ setupControl(TestSetupEntry.processExternalValidation, Boolean.TRUE);
clickLoad();
setExtrenalValidationFailed();
@@ -610,6 +603,12 @@
}
}
+ public void checkNavigation(boolean passed) {
+ if (!"Navigation
successfully".equals(base.getTextById("_auto_test_navigation"))) {
+ Assert.fail("Navigation has not been occurred");
+ }
+ }
+
public void checkProcessInputChangeListener(boolean passed) {
String status = getStatus();
if (passed && status != null &&
status.indexOf(AutoTestBean.PROCESS_INPUT_CHANGE_LISTENER) == -1) {
@@ -727,6 +726,8 @@
public static final TestSetupEntry converter = new
TestSetupEntry("converter", Boolean.class, Boolean.FALSE);
public static final TestSetupEntry process = new
TestSetupEntry("process", Boolean.class, Boolean.FALSE);
+
+ public static final TestSetupEntry processExternalValidation = new
TestSetupEntry("processExtValid", Boolean.class, Boolean.FALSE);
public static final TestSetupEntry required = new
TestSetupEntry("required", Boolean.class, Boolean.FALSE);
@@ -742,6 +743,7 @@
list.add(oncomplete);
list.add(converter);
list.add(process);
+ list.add(processExternalValidation);
list.add(required);
}
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 2009-02-13
13:33:28 UTC (rev 12653)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2009-02-13
13:42:30 UTC (rev 12654)
@@ -1467,7 +1467,7 @@
}
public String getHTMLById(String id) {
- return runScript(getElementById(id) + ".innerHTML");
+ return runScript("document.getElementById('"+id+"')" +
".innerHTML");
}
public String getStyleAttributeString (String id, String attr) {
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 2009-02-13
13:33:28 UTC (rev 12653)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxCommandLinkTest.java 2009-02-13
13:42:30 UTC (rev 12654)
@@ -79,6 +79,32 @@
}
@Test
+ public void testWithExternalValidation(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(TEST_NAVIGATION_URL, template, null);
+
+ tester.testExtrenalValidationFailure();
+ }
+
+
+ @Test
+ public void testAjaxSingleWithProcessExternalValidation(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(TEST_NAVIGATION_URL, template, null);
+
+ tester.testAjaxSingleWithProcesExternalValidation(true);
+ }
+
+ @Test
+ public void testAjaxSingle(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(TEST_NAVIGATION_URL, template, null);
+
+ tester.testAjaxSingle();
+ }
+
+
+ @Test
public void testOutput(Template template) {
AutoTester tester = getAutoTester(this);
tester.renderPage(template, null);
@@ -100,18 +126,9 @@
AutoTester tester = getAutoTester(this);
tester.renderPage(TEST_NAVIGATION_URL, template, null);
- // Set ajaxSingle mode
- tester.reset();
- tester.setupControl(AutoTester.TestSetupEntry.ajaxSingle, true);
- tester.clickLoad();
-
- tester.setExtrenalValidationFailed();
- tester.navigate();
-
- tester.checkAction(true);
- tester.checkActionListener(true);
- tester.checkNestedActionListener(true);
- tester.checkUpdateModel(false);
+ tester.testAjaxSingle();
+ tester.checkNavigation(true);
+ tester.checkAction(true);
}
@Test
@@ -119,17 +136,9 @@
AutoTester tester = getAutoTester(this);
tester.renderPage(TEST_NAVIGATION_URL, template, null);
- // Set immediate mode
- tester.reset();
- tester.setupControl(AutoTester.TestSetupEntry.immediate, true);
- tester.clickLoad();
-
- tester.navigate();
-
+ tester.testImmediate();
tester.checkAction(true);
- tester.checkActionListener(true);
- tester.checkNestedActionListener(true);
- tester.checkUpdateModel(false);
+ tester.checkNavigation(true);
}
@Test
@@ -298,12 +307,5 @@
public void sendAjax() {
clickAjaxCommandAndWait(getAutoTester(this).getClientId(AutoTester.COMPONENT_ID));
}
-
- @Override
- public void navigate() {
- clickById(getAutoTester(this).getClientId(AutoTester.COMPONENT_ID));
- }
-
-
-
+
}