Author: dsvyatobatsko
Date: 2008-05-13 02:21:19 -0400 (Tue, 13 May 2008)
New Revision: 8535
Added:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DropDownMenuTestBean.java
trunk/test-applications/seleniumTest/src/main/webapp/pages/dropDownMenu/
trunk/test-applications/seleniumTest/src/main/webapp/pages/dropDownMenu/dropDownMenuTest.xhtml
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DropDownMenuTest.java
Modified:
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
Log:
DropDownMenu component test
Added:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DropDownMenuTestBean.java
===================================================================
---
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DropDownMenuTestBean.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DropDownMenuTestBean.java 2008-05-13
06:21:19 UTC (rev 8535)
@@ -0,0 +1,53 @@
+package org.ajax4jsf;
+
+public class DropDownMenuTestBean {
+
+ private String actionName = "";
+
+ /**
+ * Gets value of actionName field.
+ * @return value of actionName field
+ */
+ public String getActionName() {
+ return actionName;
+ }
+
+ /**
+ * Set a new value for actionName field.
+ * @param actionName a new value for actionName field
+ */
+ public void setActionName(String actionName) {
+ this.actionName = actionName;
+ }
+
+ public String doNew() {
+ setActionName("New");
+ return null;
+ }
+
+ public String doOpen() {
+ setActionName("Open");
+ return null;
+ }
+
+ public String doSave() {
+ setActionName("Save");
+ return null;
+ }
+
+ public String doSaveAll() {
+ setActionName("Save All");
+ return null;
+ }
+
+ public String doClose() {
+ setActionName("Close");
+ return null;
+ }
+
+ public String doExit() {
+ setActionName("Exit");
+ return null;
+ }
+
+}
Property changes on:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/DropDownMenuTestBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-05-12
19:51:17 UTC (rev 8534)
+++
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-05-13
06:21:19 UTC (rev 8535)
@@ -76,7 +76,13 @@
<managed-bean-name>comboBean</managed-bean-name>
<managed-bean-class>org.ajax4jsf.ComboBoxTestBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
- </managed-bean>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>ddmenuBean</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.DropDownMenuTestBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
<managed-bean>
<managed-bean-name>contextMenuBean</managed-bean-name>
<managed-bean-class>org.ajax4jsf.ContextMenuTestBean</managed-bean-class>
Added:
trunk/test-applications/seleniumTest/src/main/webapp/pages/dropDownMenu/dropDownMenuTest.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/test-applications/seleniumTest/src/main/webapp/pages/dropDownMenu/dropDownMenuTest.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DropDownMenuTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DropDownMenuTest.java
(rev 0)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DropDownMenuTest.java 2008-05-13
06:21:19 UTC (rev 8535)
@@ -0,0 +1,88 @@
+package org.richfaces;
+
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.ajax4jsf.test.base.Templates;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class DropDownMenuTest extends SeleniumTestBase {
+
+ public DropDownMenuTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * This method are invoking before selenium tests started
+ */
+ @BeforeTest
+ @Parameters( { "browser" })
+ public void startSelenium(String browser) {
+ super.startSelenium(browser);
+ }
+
+ /**
+ * This method are invoking after selenium tests completed
+ */
+ @AfterTest
+ public void stopSelenium() {
+ super.stopSelenium();
+ }
+
+ @Test
+ public void testDropDownMenuComponent() throws Exception {
+ _testDropDownMenuComponent(Templates.SIMPLE);
+ _testDropDownMenuComponent(Templates.DATATABLE);
+ }
+
+ private void _testDropDownMenuComponent(Templates template) {
+ renderPage("/faces/pages/dropDownMenu/dropDownMenuTest.xhtml",
template);
+
+ String parentId = getParentId() + "_form:";
+ String file = parentId + "file";
+ String open = parentId + "open:anchor";
+ String saveAs = parentId + "saveAs:anchor";
+ String save = parentId + "save:anchor";
+ String saveAll = parentId + "saveAll:anchor";
+ String close = parentId + "close:anchor";
+ String exit = parentId + "exit:anchor";
+ String operation = parentId + "operation";
+
+ writeStatus("Check menu item in ajax mode");
+
+ selenium.mouseOver(file);
+ selenium.mouseOver(saveAs);
+ clickById(saveAll);
+
+ AssertTextEquals(operation, "Save All");
+
+ selenium.mouseOver(file);
+ selenium.mouseOver(saveAs);
+ clickById(save);
+
+ AssertTextEquals(operation, "Save");
+
+ writeStatus("Check the drop down menu closed");
+
+ AssertNotVisible(save);
+ AssertNotVisible(saveAs);
+
+ writeStatus("Check menu item in server mode");
+
+ selenium.mouseOver(file);
+ clickCommandAndWait(close);
+
+ AssertTextEquals(operation, "Close");
+
+ writeStatus("Check menu item in \\'none\\' mode");
+
+ selenium.mouseOver(file);
+ selenium.mouseOver(exit);
+ clickById(exit);
+
+ AssertTextEquals(operation, "Close");
+ AssertNotVisible(exit);
+
+ }
+}
Property changes on:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/DropDownMenuTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Show replies by date