Author: jjamrich
Date: 2011-11-06 20:18:47 -0500 (Sun, 06 Nov 2011)
New Revision: 22888
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteFiltering.java
Log:
RFPL-1233: add tests for filtering into autocomplete
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteFiltering.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteFiltering.java
(rev 0)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocompleteFiltering.java 2011-11-07
01:18:47 UTC (rev 22888)
@@ -0,0 +1,42 @@
+/**
+ *
+ */
+package org.richfaces.tests.metamer.ftest.richAutocomplete;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static
org.richfaces.tests.metamer.ftest.attributes.AttributeList.autocompleteAttributes;
+import static
org.richfaces.tests.metamer.ftest.richAutocomplete.AutocompleteAttributes.clientFilterFunction;
+import static
org.richfaces.tests.metamer.ftest.richAutocomplete.AutocompleteAttributes.mode;
+import static org.testng.Assert.assertTrue;
+
+import java.net.URL;
+
+import org.testng.annotations.Test;
+
+/**
+ * @author jjamrich
+ *
+ */
+public class TestAutocompleteFiltering extends AbstractAutocompleteTest {
+
+ private static final String CLIENT_FILTER_FUNCTION_NAME =
"customClientFilterFunction";
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath,
"faces/components/richAutocomplete/filtering.xhtml");
+ }
+
+ @Test
+ public void testClientFilterFunction() {
+ autocompleteAttributes.set(mode, "client");
+ autocompleteAttributes.set(clientFilterFunction, CLIENT_FILTER_FUNCTION_NAME);
+
+ autocomplete.typeKeys("No");
+
+ assertTrue(autocomplete.isLabeledOptionAvailable("Springfield of
Illinois"));
+ assertTrue(autocomplete.isLabeledOptionAvailable("Raleigh of North
Carolina"));
+ assertTrue(autocomplete.isLabeledOptionAvailable("Bismarck of North
Dakota"));
+
+ }
+
+}
Show replies by date