Author: dsvyatobatsko
Date: 2008-10-08 12:19:41 -0400 (Wed, 08 Oct 2008)
New Revision: 10697
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/RichPanelTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/panelMenu/panelMenuTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PanelMenuTest.java
Log:
PanelMenu: icons attributes apply: are output to client and images are accessible +
selectedChild attribute is read on rendering and updated on form submit
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 2008-10-08
13:09:19 UTC (rev 10696)
+++
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/RichPanelTestBean.java 2008-10-08
16:19:41 UTC (rev 10697)
@@ -34,9 +34,12 @@
private String itemAction;
+ private String selectedChild = "Group1";
+
public RichPanelTestBean() {
value = "";
value2 = 0;
+ selectedChild = "Group1";
}
public String getValue() {
@@ -90,6 +93,22 @@
this.itemAction = itemAction;
}
+ /**
+ * Gets value of selectedChild field.
+ * @return value of selectedChild field
+ */
+ public String getSelectedChild() {
+ return selectedChild;
+ }
+
+ /**
+ * Set a new value for selectedChild field.
+ * @param selectedChild a new value for selectedChild field
+ */
+ public void setSelectedChild(String selectedChild) {
+ this.selectedChild = selectedChild;
+ }
+
public void actionListener(ActionEvent event) {
this.value = event.getComponent().getId();
}
@@ -114,11 +133,22 @@
return null;
}
+ public void switchSelectedChild() {
+ if("Group1".equals(selectedChild)) {
+ selectedChild = "Group2";
+ } else if("Group2".equals(selectedChild)) {
+ selectedChild = "Group3";
+ } else {
+ selectedChild = "Group1";
+ }
+ }
+
public void cleanValues() {
value = "";
value2 = 0;
panelValue = null;
panelValue2 = null;
itemAction = "";
+ selectedChild = "Group1";
}
}
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/panelMenu/panelMenuTest.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PanelMenuTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PanelMenuTest.java 2008-10-08
13:09:19 UTC (rev 10696)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PanelMenuTest.java 2008-10-08
16:19:41 UTC (rev 10697)
@@ -251,6 +251,41 @@
AssertTextNotEquals(itemAction, "NOT none", "Nothing is going to
happen");
}
+ @Test
+ public void testIconsAttributesAreApplied(Template template) {
+ renderPage(template, RESET_METHOD_NAME);
+
+ writeStatus("Check icons attributes applied: are output to client and images
are accessible");
+
+ String parentId = getParentId() + "_form3:";
+
+ testIcon("pGroup1_selected", "Triangle");
+ testIcon("pGroup2_selected", "Triangle");
+ testIcon("pGroup3_selected", "Triangle");
+
+ writeStatus("Expose group 2");
+ clickById("tablehide" + parentId + "pGroup2_selected");
+
+ testIcon("pGroup2_selected", "Spacer");
+ testIcon("pItem2_selected", "Chevron");
+ }
+
+ /**
+ * Test an icon.
+ *
+ * @param iconId id of image representing icon to be tested
+ * @param iconName type of icon e. g. Chevron, Triangle
+ */
+ private void testIcon(String iconId, String iconName) {
+ String parentId = getParentId() + "_form3:";
+
+ String iconSrc = selenium.getAttribute("//img[@id='leftIcon" +
parentId + iconId + "']/@src");
+
+ if (null == iconSrc || !iconSrc.matches(".*" + iconName +
".*")) {
+ Assert.fail("It looks as if the icon is not proper. " + iconName +
" icon is expected");
+ }
+ }
+
public String getTestUrl() {
return "pages/panelMenu/panelMenuTest.xhtml";
}
Show replies by date