diff --git a/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java b/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java index ffa698f0b30ce66d618b81b0f2ab5bbe138b7e6b..5cbad11d1b97d19f58f1dee99fe0fa409f51013a 100644 --- a/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java +++ b/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java @@ -318,6 +318,16 @@ public abstract class HudsonTestCase extends TestCase { new BufferedReader(new InputStreamReader(System.in)).readLine(); } + /** + * Performs a search from the search box. + */ + protected Page search(String q) throws Exception { + HtmlPage top = new WebClient().goTo(""); + HtmlForm search = top.getFormByName("search"); + search.getInputByName("q").setValueAttribute(q); + return search.submit(null); + } + /** * Asserts that the outcome of the build is a specific outcome. */