org.alfresco.webdrone.share.site.document
Class DocumentDetailsPage

java.lang.Object
  extended by org.alfresco.webdrone.Page
      extended by org.alfresco.webdrone.share.SharePage
          extended by org.alfresco.webdrone.share.site.SitePage
              extended by org.alfresco.webdrone.share.site.document.DocumentDetailsPage
All Implemented Interfaces:
HtmlPage

public class DocumentDetailsPage
extends SitePage

Site document library page object, holds all element of the HTML page relating to share's site document library page.

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
DocumentDetailsPage(WebDrone drone)
          Constructor
DocumentDetailsPage(WebDrone drone, Double documentVersion)
          Constructor
 
Method Summary
 DocumentDetailsPage addComment(String comment)
          Adding a comment to a document by selecting add to prompt the input field, as this is based on a rich editor JavaScript was used to enter the comment.
 DocumentLibraryPage delete()
          Mimics the action of deleting a document detail.
 List<String> getComments()
          Get all the comments that are displayed on the page.
 String getCommentsOfLastCommit()
          Get the comments of the last commit from the revision history panel
 String getDocumentTitle()
          Gets the document detail title.
 String getDocumentVersion()
          Gets the version number of the document.
 String getLikeCount()
          Checks for the number of positive votes.
 org.openqa.selenium.WebElement getRevisionPanel()
          Locates the revision history DIV.
 boolean isDocumentDetailsPage()
          Verify if the page viewed is the document details page.
 DocumentDetailsPage removeComment(String comment)
          Removes the comment on document detail page.
 DocumentDetailsPage render()
          Page renderer verifies the page has rendered by checking java script page loaded status is complete.
 DocumentDetailsPage render(long time)
          Page renderer verifies the page has rendered by checking all elements are visible and loaded by the max limit time set.
 DocumentDetailsPage render(RenderTime timer)
          Verifies if the page has rendered completely by checking the page load is complete and in addition it will observe key HTML elements have rendered.
 DocumentDetailsPage selectLike()
          Mimics the action of selecting the thumbs up icon on the document page.
 UpdateFilePage uploadNewVersion()
          Mimics the action of clicking on the upload a new version button.
 
Methods inherited from class org.alfresco.webdrone.share.site.SitePage
getSiteNav, isSitePage
 
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
 

Constructor Detail

DocumentDetailsPage

public DocumentDetailsPage(WebDrone drone)
Constructor


DocumentDetailsPage

public DocumentDetailsPage(WebDrone drone,
                           Double documentVersion)
Constructor

Method Detail

render

public DocumentDetailsPage render(RenderTime timer)
                           throws PageException,
                                  PageRenderTimeException
Verifies if the page has rendered completely by checking the page load is complete and in addition it will observe key HTML elements have rendered.

Parameters:
timer - Max time to wait
Returns:
DocumentDetailsPage
Throws:
PageException - if page has not rendered
PageRenderTimeException

render

public DocumentDetailsPage render()
                           throws PageException
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
Throws:
PageException

render

public DocumentDetailsPage 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.

Returns:
HtmlPage page object response
Throws:
PageException

isDocumentDetailsPage

public boolean isDocumentDetailsPage()
Verify if the page viewed is the document details page.


delete

public DocumentLibraryPage delete()
Mimics the action of deleting a document detail.


getDocumentTitle

public String getDocumentTitle()
Gets the document detail title.

Returns:
String document detail page title

getDocumentVersion

public String getDocumentVersion()
Gets the version number of the document.

Returns:
String version identifier

uploadNewVersion

public UpdateFilePage uploadNewVersion()
                                throws Exception
Mimics the action of clicking on the upload a new version button.

Returns:
HtmlPage page response object
Throws:
Exception - if error

getRevisionPanel

public org.openqa.selenium.WebElement getRevisionPanel()
Locates the revision history DIV.

Returns:
WebElement represent revision history

getCommentsOfLastCommit

public String getCommentsOfLastCommit()
Get the comments of the last commit from the revision history panel

Parameters:
name - String the file name
revision - String version number
Returns:
String comments

addComment

public DocumentDetailsPage addComment(String comment)
Adding a comment to a document by selecting add to prompt the input field, as this is based on a rich editor JavaScript was used to enter the comment.

Parameters:
comment - String user comment
Returns:
HtmlPage page response

getComments

public List<String> getComments()
Get all the comments that are displayed on the page.

Returns:
List collection of comments

selectLike

public DocumentDetailsPage selectLike()
Mimics the action of selecting the thumbs up icon on the document page.


getLikeCount

public String getLikeCount()
Checks for the number of positive votes.

Returns:
String number of votes

removeComment

public DocumentDetailsPage removeComment(String comment)
Removes the comment on document detail page.

Parameters:
string - comment to remove
Returns:
DocumentDetailsPage page object response


Copyright © 2012. All Rights Reserved.