Author: lfryc(a)redhat.com
Date: 2011-01-24 10:56:11 -0500 (Mon, 24 Jan 2011)
New Revision: 21177
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java
Log:
AbstractComponentAttributes - fixed behavior for enums (where enum in the attribute value
fits exactly the name of enum value)
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java 2011-01-24
15:55:36 UTC (rev 21176)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java 2011-01-24
15:56:11 UTC (rev 21177)
@@ -87,10 +87,12 @@
String valueAsString = value.toString();
if (value.getClass().isEnum()) {
- valueAsString = valueAsString.toLowerCase();
- valueAsString = WordUtils.capitalizeFully(valueAsString, new char[] {
'_' });
- valueAsString = valueAsString.replace("_", "");
- valueAsString = StringUtils.uncapitalize(valueAsString);
+ if ("select".equals(inputType) &&
!selenium.getSelectOptions(locator).contains(valueAsString)) {
+ valueAsString = valueAsString.toLowerCase();
+ valueAsString = WordUtils.capitalizeFully(valueAsString, new char[] {
'_' });
+ valueAsString = valueAsString.replace("_", "");
+ valueAsString = StringUtils.uncapitalize(valueAsString);
+ }
}
if ("text".equals(inputType)) {
@@ -139,7 +141,7 @@
OptionValueLocator optionLocator = new OptionValueLocator(value);
guard(selenium, requestType).select(locator, optionLocator);
}
-
+
public void setOncomplete(String oncomplete) {
setProperty("oncomplete", oncomplete);
}