Author: dsvyatobatsko
Date: 2008-05-19 12:38:09 -0400 (Mon, 19 May 2008)
New Revision: 8635
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ComboBoxTest.java
Log:
combobox component test extension
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ComboBoxTest.java
===================================================================
---
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ComboBoxTest.java 2008-05-19
16:09:43 UTC (rev 8634)
+++
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ComboBoxTest.java 2008-05-19
16:38:09 UTC (rev 8635)
@@ -42,16 +42,41 @@
String parentId = getParentId() + "_form:";
- String predefinedCBId = parentId + "predefinedcomboboxField";
- String selectItemsCBId = parentId + "selectItemscomboboxField";
- String suggestionValuesCBId = parentId +
"suggestionValuescomboboxField";
+ String predefinedCBId = parentId + "predefined";
+ String selectItemsCBId = parentId + "selectItems";
+ String suggestionValuesCBId = parentId + "suggestionValues";
writeStatus("check components\\' default labels");
- getTextById(predefinedCBId).startsWith("Select a");
- getTextById(selectItemsCBId).startsWith("Select a");
- getTextById(suggestionValuesCBId).startsWith("Select a");
+ getTextById(predefinedCBId + "comboboxField").startsWith("Select
a");
+ getTextById(selectItemsCBId + "comboboxField").startsWith("Select
a");
+ getTextById(suggestionValuesCBId +
"comboboxField").startsWith("Select a");
+ writeStatus("check a combobox with predefined suggestions");
+
+ clickById(predefinedCBId);
+ writeStatus("type \"Hunt\"");
+
+ selenium.type(predefinedCBId + "comboboxField", "Hunt");
+ selenium.typeKeys(predefinedCBId + "comboboxField", "Hunt");
+
+ Assert.assertTrue(isVisibleById(predefinedCBId + "list"),
"Component pop-up should show up on click");
+
+ clickById(predefinedCBId + "list");
+
+ Assert.assertFalse(isVisibleById(predefinedCBId + "list"),
"Component pop-up has to be closed");
+ Assert.assertEquals(getValue(predefinedCBId), "Hunter");
+
+ delay(2000);
}
+ /**
+ * Gets component value.
+ * @param clientId
+ * @return
+ */
+ private String getValue(String clientId) {
+ return runScript("$('" + clientId +
"comboboxValue').value;");
+ }
+
}