From 5f55f7e4d96fb1981f5539988ce7f1b8eeef44bf Mon Sep 17 00:00:00 2001 From: kohsuke Date: Tue, 30 Dec 2008 15:49:58 +0000 Subject: [PATCH] added a convenience method. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@13980 71c3de6d-444a-0410-be80-ed276b4c234a --- .../java/org/jvnet/hudson/test/HudsonTestCase.java | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 ffa698f0b3..5cbad11d1b 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. */ -- GitLab