Author: dsvyatobatsko
Date: 2009-01-22 09:13:07 -0500 (Thu, 22 Jan 2009)
New Revision: 12367
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/tabPanel/invisibleTabChildrenProcessingTest.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/RichPanelTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TabPanelTest.java
Log:
https://jira.jboss.org/jira/browse/RF-5558
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/RichPanelTestBean.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/RichPanelTestBean.java 2009-01-22
10:45:54 UTC (rev 12366)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/RichPanelTestBean.java 2009-01-22
14:13:07 UTC (rev 12367)
@@ -78,6 +78,12 @@
reset();
}
+ public void resetAndSelectTab() {
+ String tab = getSelectedTab();
+ reset();
+ setSelectedTab(tab);
+ }
+
/**
* Gets value of switchType field.
*
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/tabPanel/invisibleTabChildrenProcessingTest.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/tabPanel/invisibleTabChildrenProcessingTest.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TabPanelTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TabPanelTest.java 2009-01-22
10:45:54 UTC (rev 12366)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TabPanelTest.java 2009-01-22
14:13:07 UTC (rev 12367)
@@ -54,7 +54,9 @@
private final static String TAB_FACET_TEST_URL =
"pages/tabPanel/tabFacetTest.xhtml";
private final static String DISABLED_TAB_URL =
"pages/tabPanel/testDisabledTab.xhtml";
-
+
+ private final static String INVISIBLE_TAB_TEST_URL =
"pages/tabPanel/invisibleTabChildrenProcessingTest.xhtml";
+
private final static String IMMEDIATE_TAB_URL =
"pages/tabPanel/immediateTabTest.xhtml";
private final static String SERVER_AWARE_MODE_URL =
"pages/tabPanel/testTabServerMode.xhtml";
@@ -70,12 +72,11 @@
params.put("parameter2", "value2");
params.put("parameter3", "value3");
}
-
- static final Map<String, String> TAB_PANEL_STYLES = new HashMap<String,
String>();
- static {
- TAB_PANEL_STYLES.put("font-size", "16px");
- }
+ static final Map<String, String> TAB_PANEL_STYLES = new HashMap<String,
String>();
+ static {
+ TAB_PANEL_STYLES.put("font-size", "16px");
+ }
@Test
public void testRichTabPanelComponent(Template template) {
@@ -466,6 +467,47 @@
autoTester.testRendered();
}
+ @Test
+ public void
testChildrenComponentsAreNotProcessedForServerAwareModesAndInvisibleTabs(Template
template) {
+ renderPage(INVISIBLE_TAB_TEST_URL, template, RESET_METHOD);
+ writeStatus("Check children components aren't processed for server-aware
modes and invisible tabs");
+ String parentId = getParentId();
+ String selectedTabInputId = parentId + CONTROLS_FORM_ID + "selected";
+ String resetApplyButtonId = parentId + CONTROLS_FORM_ID +
"reset_apply";
+ String submitButtonId = parentId + FORM_ID + "submit";
+ String _inputsId = parentId + FORM_ID + "_inputs";
+
+ writeStatus("Check all invisible server-aware tabs are not processed. The
others are processed.");
+
+ clickCommandAndWait(submitButtonId);
+ String _inputs = selenium.getText(_inputsId);
+
+ Assert.assertTrue(_inputs.contains("1"), "Visible server-aware
tabs (tab1) must be processed");
+ Assert.assertFalse(_inputs.contains("2"), "invisible server-aware
tabs (tab2) must not be processed");
+ Assert.assertTrue(_inputs.contains("3"), "Non-server-aware tabs
(tab3,tab4) have to be processed anyway");
+ Assert.assertTrue(_inputs.contains("4"), "Non-server-aware tabs
(tab3,tab4) have to be processed anyway");
+
+ setValueById(selectedTabInputId, "tab2");
+ clickCommandAndWait(resetApplyButtonId);
+ clickCommandAndWait(submitButtonId);
+ _inputs = selenium.getText(_inputsId);
+
+ Assert.assertFalse(_inputs.contains("1"), "invisible server-aware
tabs (tab1) must not be processed");
+ Assert.assertTrue(_inputs.contains("2"), "Visible server-aware
tabs (tab2) must be processed");
+ Assert.assertTrue(_inputs.contains("3"), "Non-server-aware tabs
(tab3,tab4) have to be processed anyway");
+ Assert.assertTrue(_inputs.contains("4"), "Non-server-aware tabs
(tab3,tab4) have to be processed anyway");
+
+ setValueById(selectedTabInputId, "tab3");
+ clickCommandAndWait(resetApplyButtonId);
+ clickCommandAndWait(submitButtonId);
+ _inputs = selenium.getText(_inputsId);
+
+ Assert.assertFalse(_inputs.contains("1"), "invisible server-aware
tabs (tab1) must not be processed");
+ Assert.assertFalse(_inputs.contains("2"), "invisible server-aware
tabs (tab2) must not be processed");
+ Assert.assertTrue(_inputs.contains("3"), "Non-server-aware tabs
(tab3,tab4) have to be processed anyway");
+ Assert.assertTrue(_inputs.contains("4"), "Non-server-aware tabs
(tab3,tab4) have to be processed anyway");
+ }
+
private void testListener(String parentId) {
String linkId = parentId + FORM_ID + "tab2_lbl";