Author: sergeyhalipov
Date: 2008-05-30 09:05:52 -0400 (Fri, 30 May 2008)
New Revision: 8843
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelMenuTest.java
Log:
Panel menu test: JS API tests added.
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelMenuTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelMenuTest.java 2008-05-30
12:32:42 UTC (rev 8842)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/PanelMenuTest.java 2008-05-30
13:05:52 UTC (rev 8843)
@@ -46,11 +46,58 @@
_testPanelMenuItemAction(Templates.SIMPLE);
_testPanelMenuItemAction(Templates.DATATABLE);
_testPanelMenuItemAction(Templates.MODALPANEL);
-
+
+ _testPanelMenuClientAPI(Templates.SIMPLE);
+ _testPanelMenuClientAPI(Templates.DATATABLE);
+ _testPanelMenuClientAPI(Templates.MODALPANEL);
}
+ private void _testPanelMenuClientAPI(Templates template) {
+ renderPage(template);
+
+ String form1 = getParentId() + "_form1:";
+ String form2 = getParentId() + "_form2:";
+
+ String group = form1 + "pGroup3";
+ String sigleGroup = form2 + "pGroup3_single";
+
+ String ajaxItem = "tablehide" + form1 + "pItem1";
+ String serverItem = "tablehide" + form1 + "pItem2";
+ String clientItem = "tablehide" + form1 + "pItem3";
+
+ writeStatus("Test expand JS API method for ajax multiple panel menu.");
+ selenium.runScript("$('" + group +
"').component.expand()");
+ Assert.assertFalse(isVisibleById(ajaxItem));
+ Assert.assertFalse(isVisibleById(serverItem));
+ Assert.assertTrue(isVisibleById(clientItem));
+
+ writeStatus("Test collapse JS API method for ajax multiple panel
menu.");
+ selenium.runScript("$('" + group +
"').component.collapse()");
+ Assert.assertFalse(isVisibleById(ajaxItem));
+ Assert.assertFalse(isVisibleById(serverItem));
+ Assert.assertFalse(isVisibleById(clientItem));
+
+ ajaxItem = "tablehide" + form2 + "pItem1_single";
+ serverItem = "tablehide" + form2 + "pItem2_single";
+ clientItem = "tablehide" + form2 + "pItem3_single";
+
+ writeStatus("Test expand JS API method for ajax single panel menu.");
+ selenium.runScript("$('" + sigleGroup +
"').component.expand()");
+ Assert.assertFalse(isVisibleById(ajaxItem));
+ Assert.assertFalse(isVisibleById(serverItem));
+ Assert.assertTrue(isVisibleById(clientItem));
+
+ writeStatus("Test collapse JS API method for ajax single panel
menu.");
+ selenium.runScript("$('" + sigleGroup +
"').component.collapse()");
+ Assert.assertFalse(isVisibleById(ajaxItem));
+ Assert.assertFalse(isVisibleById(serverItem));
+ Assert.assertFalse(isVisibleById(clientItem));
+
+ tearDown();
+ }
+
private void _testPanelMenuComponent(Templates template) {
- renderPage(getTestUrl(), template);
+ renderPage(template);
String parentId = getParentId() + "_form1:";
String value1Id = getParentId() + "_value";
@@ -121,7 +168,7 @@
}
private void _testPanelMenuComponentSingleMode(Templates template) {
- renderPage(getTestUrl(), template);
+ renderPage(template);
String parentId = getParentId() + "_form2:";
String value1Id = getParentId() + "_value";
@@ -191,7 +238,7 @@
}
private void _testPanelMenuItemAction(Templates template) {
- renderPage(getTestUrl(), template);
+ renderPage(template);
String parentId = getParentId() + "_form";
String value1Id = getParentId() + "_value";
Show replies by date