Author: abelevich
Date: 2009-03-23 12:40:48 -0400 (Mon, 23 Mar 2009)
New Revision: 13113
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataScrollerTest.java
Log:
create ajax attributes autotests, fix limitToList test
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataScrollerTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataScrollerTest.java 2009-03-23
16:37:30 UTC (rev 13112)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataScrollerTest.java 2009-03-23
16:40:48 UTC (rev 13113)
@@ -122,18 +122,146 @@
}
+ @Test
+ public void testRendered(Template template){
+ AutoTester autoTester = getAutoTester(this);
+ dataScrollerTableId = autoTester.getClientId(AutoTester.COMPONENT_ID +
"_table", template);
+ autoTester.renderPage(template, RESET_METHOD_ME);
+ autoTester.testRendered();
+
+ }
@Test
- public void testAutoAjaxAttributes(Template template) {
+ public void testReRendered(Template template) {
AutoTester autoTester = getAutoTester(this);
+ dataScrollerTableId = autoTester.getClientId(AutoTester.COMPONENT_ID +
"_table", template);
+ autoTester.renderPage(template, RESET_METHOD_ME);
+ autoTester.testReRender();
+ }
+
+ @Test
+ public void testActionListener(Template template) {
+ AutoTester autoTester = getAutoTester(this);
dataScrollerTableId = autoTester.getClientId(AutoTester.COMPONENT_ID +
"_table", template);
-
autoTester.renderPage(template, RESET_METHOD_ME);
- autoTester.testAllAjaxAttributes();
-
+ autoTester.testActionListener();
}
+ @Test
+ public void testAjaxSingle(Template template) {
+ AutoTester autoTester = getAutoTester(this);
+ dataScrollerTableId = autoTester.getClientId(AutoTester.COMPONENT_ID +
"_table", template);
+ autoTester.renderPage(template, RESET_METHOD_ME);
+ autoTester.testAjaxSingle();
+ }
+
+ @Test
+ public void testImmediate(Template template) {
+ AutoTester autoTester = getAutoTester(this);
+ dataScrollerTableId = autoTester.getClientId(AutoTester.COMPONENT_ID +
"_table", template);
+ autoTester.renderPage(template, RESET_METHOD_ME);
+ autoTester.testImmediate();
+ }
+
+ @Test
+ public void testImmediateWithExternalValidation(Template template) {
+ AutoTester autoTester = getAutoTester(this);
+ dataScrollerTableId = autoTester.getClientId(AutoTester.COMPONENT_ID +
"_table", template);
+ autoTester.renderPage(template, RESET_METHOD_ME);
+ autoTester.testImmediateWithExternalValidationFailed();
+ }
+
+ @Test
+ public void testBypassUpdate(Template template) {
+ AutoTester autoTester = getAutoTester(this);
+ dataScrollerTableId = autoTester.getClientId(AutoTester.COMPONENT_ID +
"_table", template);
+ autoTester.renderPage(template, RESET_METHOD_ME);
+ autoTester.testBypassUpdate();
+ }
+
+ @Test
+ public void testExtrenalValidationFailure(Template template) {
+ AutoTester autoTester = getAutoTester(this);
+ dataScrollerTableId = autoTester.getClientId(AutoTester.COMPONENT_ID +
"_table", template);
+ autoTester.renderPage(template, RESET_METHOD_ME);
+ autoTester.testExtrenalValidationFailure();
+ }
+
+ @Test
+ public void testAjaxSingleWithExtrenalValidationFailure(Template template) {
+ AutoTester autoTester = getAutoTester(this);
+ dataScrollerTableId = autoTester.getClientId(AutoTester.COMPONENT_ID +
"_table", template);
+ autoTester.renderPage(template, RESET_METHOD_ME);
+ autoTester.testAjaxSingleWithProcesExternalValidation(true);
+ }
+
+ @Test
+ public void testLimitToList(Template template) {
+ renderPage(template,RESET_METHOD_ME);
+ String parentId = getParentId();
+ String formId = parentId + "_data:";
+
+ // init id's
+ String limitCheckBox = formId + "limit_checkbox";
+ String singleCheckBox = formId + "single_checkbox";
+ String limitApplyButton = formId + "limit_apply";
+ String limitResetButton = formId + "limit_reset_button";
+ String limitContentInput1 = formId + "limit_content_input1";
+ String limitContentListener1 = formId + "limit_content_listener1";
+ String limitContentInput2 = formId + "limit_content_input2";
+ String limitContentListener2 = formId + "limit_content_listener2";
+
+ dataScrollerTableId = formId + "scroller_table";
+
+ // reset listeners status
+ AssertRendered(limitResetButton);
+ clickAjaxCommandAndWait(limitResetButton);
+
+ //ajaxSingle='false'
+ clickById(singleCheckBox);
+ clickAjaxCommandAndWait(limitApplyButton);
+
+ // check listeners default status
+ AssertRendered(limitContentListener1);
+ AssertTextEquals(limitContentListener1, "reset");
+
+ AssertRendered(limitContentListener2);
+ AssertTextEquals(limitContentListener2, "reset");
+
+ // change value
+ AssertRendered(limitContentInput1);
+ type(limitContentInput1, "content11");
+
+ AssertRendered(limitContentInput2);
+ type(limitContentInput2, "content22");
+
+ clickControl(8,dataScrollerTableId);
+
+ AssertTextEquals(limitContentListener1, "invoked");
+ AssertTextEquals(limitContentListener2, "invoked");
+
+ //reset listeners status again
+ clickAjaxCommandAndWait(limitResetButton);
+
+ //set limitToList='true'
+ clickById(limitCheckBox);
+
+ // change value
+ AssertRendered(limitContentInput1);
+ type(limitContentInput1, "content11");
+
+ AssertRendered(limitContentInput2);
+ type(limitContentInput2, "content22");
+
+ clickControl(9,dataScrollerTableId);
+
+ AssertTextEquals(limitContentListener1, "invoked");
+ AssertTextEquals(limitContentListener2, "reset");
+
+ }
+
+
@Override
public void sendAjax() {
clickControl(4, dataScrollerTableId);
Show replies by date