Author: konstantin.mishin
Date: 2009-02-16 13:15:41 -0500 (Mon, 16 Feb 2009)
New Revision: 12673
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ComboBoxTest.java
Log:
RF-6069
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ComboBoxTest.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ComboBoxTest.java 2009-02-16
16:42:22 UTC (rev 12672)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ComboBoxTest.java 2009-02-16
18:15:41 UTC (rev 12673)
@@ -31,6 +31,8 @@
public class ComboBoxTest extends SeleniumTestBase {
+ private String comboBox;
+
private String comboboxField;
private String comboboxButton;
@@ -60,7 +62,7 @@
filterNewValues = attrForm + ":filterNewValues";
selectFirstOnUpdate = attrForm + ":selectFirstOnUpdate";
String mainForm = getParentId() + "_form";
- String comboBox = mainForm + ":comboBox";
+ comboBox = mainForm + ":comboBox";
comboboxField = comboBox + "comboboxField";
comboboxButton = comboBox + "comboboxButton";
comboboxList = comboBox + "list";
@@ -252,6 +254,24 @@
Assert.assertFalse(selenium.getAttribute("xpath=id('" + comboboxList +
"')/span[1](a)class").indexOf("selected") != -1);
}
+
+ /**
+ * Check combobox JS API: showList(), hideList(), enable(), disable().
+ */
+ @Test
+ public void testJSAPI(Template template) {
+ init(template);
+ selenium.runScript("var comboBox = document.getElementById('" + comboBox
+ "').component;");
+ selenium.runScript("comboBox.showList();");
+ Assert.assertTrue(selenium.isVisible(comboboxList));
+ selenium.runScript("comboBox.hideList();");
+ Assert.assertFalse(selenium.isVisible(comboboxList));
+ selenium.runScript("comboBox.disable();");
+ Assert.assertFalse(selenium.isEditable(comboboxField));
+ selenium.runScript("comboBox.enable();");
+ Assert.assertTrue(selenium.isEditable(comboboxField));
+ }
+
@Override
public void setValueEmpty() {
selenium.type(getParentId() + "autoTestForm:componentIdcomboboxValue",
"");
Show replies by date