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.SearchResultsPage
All Implemented Interfaces:
HtmlPage
Direct Known Subclasses:
AllSitesResultsPage, RepositoryResultsPage, SiteResultsPage

public abstract class SearchResultsPage
extends SharePage

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.share.SharePage
dojoSupport, WAIT_TIME_3000
 
Fields inherited from class org.alfresco.webdrone.Page
drone, maxPageLoadingTime, version
 
Constructor Summary
SearchResultsPage(WebDrone drone)
          Constructor.
 
Method Summary
protected  boolean completedSearch()
          Resolves if searching message is displayed.
 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.
 int getPaginationPosition()
          Displays the position the page is in the pagination, if there is only one page then it will return the value 1
 List<SearchResultItem> getResults()
          Gets the search results as a collection of SearResultItems.
 boolean hasNextPage()
          Checks for next page button on the pagination bar.
 boolean hasPrevioudPage()
          Checks for previous page button on the pagination bar.
 boolean hasResults()
          Verify search yielded results.
 int paginationCount()
          The total number of pages in pagination bar.
 boolean paginationDisplayed()
          Verify pagination is displayed.
 HtmlPage paginationSelect(int position)
          Selects and opens the paginated page based on the required position.
 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.
protected  void searchFor(String term)
          Performs the search by entering the term into search field and submitting the search form on the result page.
 String searchType()
          Gets the search type description on the search that has been performed.
 HtmlPage selectFirstResult()
          Selects the first result from page.
 HtmlPage selectItem(Integer number)
          Select a particular search result item link based on the count.
 HtmlPage selectItem(String title)
          Select a particular search result item link based on the match of the title.
 HtmlPage selectNextPage()
          Action of selecting next page on pagination bar.
 HtmlPage selectOnAllSites(String text)
          Selects All sites option and searches against all sites in alfresco share.
 HtmlPage selectOnlyOnSite(String text)
          Selects search within a specific site and performs the search,
 HtmlPage selectPreviousPage()
          Action of selecting previous page on pagination bar.
 HtmlPage selectRepository()
          Select repository option search and performs search against repository.
 
Methods inherited from class org.alfresco.webdrone.share.SharePage
basicRender, canResume, canResume, disbaleFileUploadFlash, findButton, getCopyRight, getLogin, getNav, getPageTitle, getSearch, isJSMessageDisplayed, isLoggedIn, isLogoPresent, isTitlePresent, panelExists
 
Methods inherited from class org.alfresco.webdrone.Page
close, getDrone, getScreenShot, getTitle, isBrowserTitle, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SearchResultsPage

public SearchResultsPage(WebDrone drone)
Constructor.

Method Detail

render

public SearchResultsPage render(RenderTime timer)
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.

Parameters:
timer - RenderTime time to wait
Returns:
HtmlPage page object response

render

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

Returns:
HtmlPage object response

render

public SearchResultsPage render(long time)
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.

Parameters:
time - waiting time
Returns:
HtmlPage page object response

completedSearch

protected boolean completedSearch()
Resolves if searching message is displayed.

Returns:
true if visible

hasResults

public boolean hasResults()
Verify search yielded results.

Returns:
true if results returned

paginationDisplayed

public boolean paginationDisplayed()
Verify pagination is displayed.

Returns:
true if results returned

count

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

Returns:
Integer number of results

selectFirstResult

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


selectOnlyOnSite

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

Parameters:
text - String to search
Returns:
HtmlPage results page object

selectOnAllSites

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

Parameters:
text - String search text
Returns:
HtmlPage results page object

selectRepository

public HtmlPage selectRepository()
Select repository option search and performs search against repository.

Parameters:
text - String search text
Returns:
HtmlPage results page object

doSearch

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

Parameters:
text - String search text
Returns:
HtmlPage results page object

searchType

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

Returns:
String search type

getPaginationPosition

public int getPaginationPosition()
Displays the position the page is in the pagination, if there is only one page then it will return the value 1

Returns:
int current page position

hasNextPage

public boolean hasNextPage()
Checks for next page button on the pagination bar.

Returns:
if visible and clickable

hasPrevioudPage

public boolean hasPrevioudPage()
Checks for previous page button on the pagination bar.

Returns:
if visible and clickable

selectNextPage

public HtmlPage selectNextPage()
Action of selecting next page on pagination bar.

Returns:
results of the next page

selectPreviousPage

public HtmlPage selectPreviousPage()
Action of selecting previous page on pagination bar.

Returns:
results of the next page

paginationCount

public int paginationCount()
The total number of pages in pagination bar.

Returns:
int total pages of pagiantion

paginationSelect

public HtmlPage paginationSelect(int position)
Selects and opens the paginated page based on the required position.

Parameters:
int - pagination page position
Returns:
the select paginated page

getResults

public List<SearchResultItem> getResults()
Gets the search results as a collection of SearResultItems.

Returns:
Collections of serach result

selectItem

public HtmlPage selectItem(String title)
Select a particular search result item link based on the match of the title.

Parameters:
title - String Search result item title
Returns:
HtmlPage page response

selectItem

public HtmlPage selectItem(Integer number)
Select a particular search result item link based on the count.

Parameters:
number - Integer Search result item title
Returns:
HtmlPage page response

searchFor

protected void searchFor(String term)
Performs the search by entering the term into search field and submitting the search form on the result page.

Parameters:
term - String term to search


Copyright © 2013. All Rights Reserved.