Author: jjamrich
Date: 2011-08-17 19:41:40 -0400 (Wed, 17 Aug 2011)
New Revision: 22651
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/RichPickListComponentAttribute.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/TestPickList.java
Log:
RFPL-1612: add tests for various *class attributes and immediate for pickList
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/RichPickListComponentAttribute.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/RichPickListComponentAttribute.java 2011-08-17
23:41:22 UTC (rev 22650)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/RichPickListComponentAttribute.java 2011-08-17
23:41:40 UTC (rev 22651)
@@ -64,7 +64,7 @@
setProperty("headerClass", headerClass);
}
- public void setImmediate(String immediate) {
+ public void setImmediate(Boolean immediate) {
setProperty("immediate", immediate);
}
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/TestPickList.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/TestPickList.java 2011-08-17
23:41:22 UTC (rev 22650)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPickList/TestPickList.java 2011-08-17
23:41:40 UTC (rev 22651)
@@ -181,25 +181,46 @@
}
- // @Test
+ @Test
public void testDisabledClass() {
- // TODO JJa 2011-08-05: ask Brian about this attr:
- // attributes.setDisabledClass(disabledClass);
+ String disabledClass = "my-cool-disabled-class";
+ attributes.setDisabledClass(disabledClass);
+
+ String found = selenium.getAttribute(pickListTop.getAttribute(classAttr));
+ assertTrue(found != null);
+ assertTrue(found.contains(disabledClass));
}
- // @Test
+ @Test
public void testHeaderClass() {
- // attributes.setHeaderClass(headerClass);
+ String headerClass = "my-cool-header-class";
+ attributes.setHeaderClass(headerClass);
+
+ String found = selenium.getAttribute(pickListTop.getAttribute(classAttr));
+ assertTrue(found != null);
+ assertTrue(found.contains(headerClass));
}
- // @Test
+ @Test
public void testImmediate() {
- // attributes.setImmediate(immediate);
+ attributes.setImmediate(Boolean.TRUE);
+ addItem("richfaces");
+ selenium.click(a4jSubmit);
+
+ // for immediate submit is record in 3rd line
+ waitModel.until(textEquals.locator(phaseListenerFormat.format(2))
+ .text(format(phaseListenerLogFormat, "[]",
"[richfaces]")));
+
}
- // @Test
+ @Test
public void testItemClass() {
- // attributes.setItemClass(itemClass);
+ String itemClass = "xxx";
+ attributes.setItemClass(itemClass);
+
+ String classVal =
selenium.getAttribute(pickListSrcItemByText.format("richfaces").getAttribute(classAttr));
+ assertTrue(classVal != null);
+ assertTrue(classVal.contains(itemClass));
}
// @Test
Show replies by date