org.alfresco.webdrone.share.search
Class SearchResultsPage

java.lang.Object
  extended by org.alfresco.webdrone.Page
      extended by org.alfresco.webdrone.share.SharePage
          extended by org.alfresco.webdrone.share.search.Search
              extended by org.alfresco.webdrone.share.search.SearchResultsPage
All Implemented Interfaces:
HtmlPage

public class SearchResultsPage
extends Search
implements HtmlPage

Search results page object, holds all element of the html page relating to share's search results.

Since:
1.0
Author:
Michael Suzuki

Field Summary
 
Fields inherited from class org.alfresco.webdrone.Page
DEFAULT_PAGE_LOADING_TIME_WAIT, drone, version
 
Constructor Summary
SearchResultsPage(WebDrone drone)
          Constructor.
 
Method Summary
 int count()
          Gets number of results displayed on the page.
protected  HtmlPage doSearch(String text)
          Enters the search text and submits the from on basic search page form.
 boolean hasResults()
          Verify search yielded results.
 HtmlPage onlyOnSite(String text)
          Selects search within a specific site and performs the search,
 HtmlPage onRepository(String text)
          Select repository option search and performs search against repository.
 SearchResultsPage render()
          Page renderer verifies the page has rendered by checking java script page loaded status is complete.
 SearchResultsPage render(long time)
          Page renderer verifies the page has rendered by checking all elements are visible and loaded by the max limit time set.
 SearchResultsPage render(RenderTime timer)
          Page renderer verifies the page has rendered by checking all elements are visible and loaded.
 HtmlPage searchOnAllSites(String text)
          Selects All sites option and searches against all sites in alfresco share.
 String searchType()
          Gets the search type description on the search that has been performed.
 HtmlPage selectFirstResult()
          Selects the first result from page.
 
Methods inherited from class org.alfresco.webdrone.share.search.Search
search
 
Methods inherited from class org.alfresco.webdrone.share.SharePage
basicRender, disbaleFileUploadFlash, findButton, getLogin, getNav, getPageTitle, getSearch, isLogoPresent, isTitlePresent, panelExists
 
Methods inherited from class org.alfresco.webdrone.Page
close, getScreenShot, getTitle, isBrowserTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.alfresco.webdrone.HtmlPage
close, getTitle
 

Constructor Detail

SearchResultsPage

public SearchResultsPage(WebDrone drone)
Constructor.

Method Detail

render

public SearchResultsPage render(RenderTime timer)
                         throws PageException
Description copied from interface: HtmlPage
Page renderer verifies the page has rendered by checking all elements are visible and loaded. To verify this assertion every page object that implements the method will contain logic to determine if the page has loaded completely in the given time set by the RenderTime.

Specified by:
render in interface HtmlPage
Overrides:
render in class Search
Parameters:
timer - RenderTime time to wait
Returns:
HtmlPage page object response
Throws:
PageException

render

public SearchResultsPage render()
                         throws PageException
Description copied from interface: HtmlPage
Page renderer verifies the page has rendered by checking java script page loaded status is complete.

Specified by:
render in interface HtmlPage
Overrides:
render in class Search
Returns:
HtmlPage object response
Throws:
PageException

render

public SearchResultsPage render(long time)
                         throws PageException
Description copied from interface: HtmlPage
Page renderer verifies the page has rendered by checking all elements are visible and loaded by the max limit time set.

Specified by:
render in interface HtmlPage
Overrides:
render in class Search
Returns:
HtmlPage page object response
Throws:
PageException

hasResults

public boolean hasResults()
Verify search yielded results.

Returns:
true if results returned
Throws:
InterruptedException

count

public int count()
Gets number of results displayed on the page.

Returns:
Integer number of results
Throws:
InterruptedException

selectFirstResult

public HtmlPage selectFirstResult()
                           throws Exception
Selects the first result from page.

Throws:
Exception

onlyOnSite

public HtmlPage onlyOnSite(String text)
                    throws Exception
Selects search within a specific site and performs the search,

Parameters:
siteId - String site name
Returns:
HtmlPage results page object
Throws:
Exception - if error

searchOnAllSites

public HtmlPage searchOnAllSites(String text)
                          throws Exception
Selects All sites option and searches against all sites in alfresco share.

Parameters:
text - String search text
Returns:
HtmlPage results page object
Throws:
Exception - if error

onRepository

public HtmlPage onRepository(String text)
                      throws Exception
Select repository option search and performs search against repository.

Parameters:
text - String search text
Returns:
HtmlPage results page object
Throws:
Exception - if error

doSearch

protected HtmlPage doSearch(String text)
                     throws Exception
Enters the search text and submits the from on basic search page form.

Parameters:
text - String search text
Returns:
HtmlPage results page object
Throws:
Exception - if error

searchType

public String searchType()
Gets the search type description on the search that has been performed.

Returns:
String search type


Copyright © 2012. All Rights Reserved.