Author: dsvyatobatsko
Date: 2009-02-27 11:30:04 -0500 (Fri, 27 Feb 2009)
New Revision: 12772
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxForm/ajaxFormTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxFormTest.java
Log:
RF-6122
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxForm/ajaxFormTest.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxFormTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxFormTest.java 2009-02-27
14:41:15 UTC (rev 12771)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxFormTest.java 2009-02-27
16:30:04 UTC (rev 12772)
@@ -58,26 +58,24 @@
private final static String LINK_ID = "link";
+ private final static String RESET_METHOD = "#{formBean.reset}";
+
@Test
public void testAttrAjaxSubmit(Template template) throws Exception {
- renderPage(template);
+ renderPage(template, RESET_METHOD);
// clickOnCheckbox(CHECK_ID_AJAXSUBMIT, BUTTON_ID);
test(BUTTON_ID, INNER_INPUT_ID,
STANDART_FORM.concat(":").concat(OUTER_INPUT_ID), TEST_FIELD_ID, true, null,
null, null, "testAttrAjaxSubmit");
-
- resetTestData();
}
@Test
public void testAttrPrependId(Template template) {
- renderPage(template);
+ renderPage(template, RESET_METHOD);
if (!PREV_TEXT.equals(getValueById(getFullComponentId(INNER_INPUT_ID,
"1")))) {
assertFail(null, null, true, null, "testAttrPrependId");
}
-
- resetTestData();
}
/*
@@ -92,7 +90,7 @@
@Test
public void testProcessingLinks(Template template) {
- renderPage(template);
+ renderPage(template, RESET_METHOD);
clickOnCheckbox(CHECK_ID_RENDERED, BUTTON_ID, "2");
clickById(getParentId() + LINK_ID.concat("2"));
@@ -100,8 +98,6 @@
if (!NEXT_TEXT.equals(getTextById(getParentId() +
TEST_FIELD_ID.concat("2")))) {
assertFail(null, null, null, null, "testProcessingLinks");
}
-
- resetTestData();
}
@Test
@@ -153,6 +149,31 @@
assertEvent("onsubmit");
}
+ @Test
+ public void testMainFeature(Template template) {
+ renderPage(template, RESET_METHOD);
+ writeStatus("Check that a4j:form with a4j:htmlCommandLink fix the problem of
h:commandLink component");
+ writeStatus("that cannot be re-rendered without re-rendering the whole form
it belongs to.");
+
+ String parentId = getParentId() + "mainFeatureForm:";
+ String updateNonAjaxLinkId = parentId + "update_non_ajax_link";
+ String nonAjaxSubmit = parentId + "non_ajax_submit";
+ String resultId = parentId + "result";
+
+ writeStatus("First of all check a jsf non-ajax link works in
general");
+ AssertTextEquals(resultId, "before submit");
+ clickCommandAndWait(nonAjaxSubmit);
+ AssertTextEquals(resultId, "after submit");
+
+ writeStatus("Rerender non-ajax link.");
+ clickAjaxCommandAndWait(updateNonAjaxLinkId);
+
+ writeStatus("Check that it still works");
+ AssertTextEquals(resultId, "before submit");
+ clickCommandAndWait(nonAjaxSubmit);
+ AssertTextEquals(resultId, "after submit");
+ }
+
private String getFullComponentId(String componentId, String index) {
return getParentId() + FORM_ID + index + ":" + componentId + index;
}
Show replies by date