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
Direct Known Subclasses:
DocumentEditOfflinePage

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
protected static String ACTION_SET_ID
           
protected static String CHECKEDOUT_MESSAGE_PLACEHOLDER
           
static String DOCUMENT_VERSION_PLACEHOLDER
           
 
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
DocumentDetailsPage(WebDrone drone)
          Constructor
DocumentDetailsPage(WebDrone drone, String previousVersion)
          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.
 Integer getCommentCount()
          The number of comments value displayed on the span comment count.
 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 getDocumentSize()
          Get the file size from the properties section of the document details page.
 String getDocumentTitle()
          Gets the document detail title.
 String getDocumentVersion()
          Gets document version value from top of the details page
 String getLikeCount()
          Checks for the number of positive votes.
 Map<String,String> getProperties()
          Get the document properties from view.
 org.openqa.selenium.WebElement getRevisionPanel()
          Locates the revision history DIV.
 boolean isCheckedOut()
          Verifies if document is locked for offline editing.
 boolean isDocumentDetailsPage()
          Verify if the page viewed is the document details page.
 boolean isEditOfflineDisplayed()
          Check for edit offline banner that appears on the top of the page when document is locked by edit off line.
 boolean isEditOfflineLinkDisplayed()
          Verify if the action to edit offline is available
 boolean isUploadNewVersionDisplayed()
          Verify if button on version history view is displayed
 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.
 HtmlPage selectDownload(File file)
          Downloads the document shown by the current page, optionally doing it by clicking the link in the browser (no control) or by doing a URL-based download.
 HtmlPage selectEditOffLine(File file)
          Select the edit off line link.
 EditDocumentPropertiesPage selectEditProperties()
          Mimics the action of selecting edit properties on the document details page.
 DocumentDetailsPage selectLike()
          Mimics the action of selecting the thumbs up icon on the document page.
 UpdateFilePage selectUploadNewVersion()
          Mimics the action of clicking on the upload new version button.
 
Methods inherited from class org.alfresco.webdrone.share.site.SitePage
getSiteNav, isSite, isSitePage
 
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
 

Field Detail

CHECKEDOUT_MESSAGE_PLACEHOLDER

protected static final String CHECKEDOUT_MESSAGE_PLACEHOLDER
See Also:
Constant Field Values

ACTION_SET_ID

protected static final String ACTION_SET_ID
See Also:
Constant Field Values

DOCUMENT_VERSION_PLACEHOLDER

public static final String DOCUMENT_VERSION_PLACEHOLDER
See Also:
Constant Field Values
Constructor Detail

DocumentDetailsPage

public DocumentDetailsPage(WebDrone drone)
Constructor


DocumentDetailsPage

public DocumentDetailsPage(WebDrone drone,
                           String previousVersion)
Constructor

Method Detail

render

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

Parameters:
timer - Max time to wait
Returns:
DocumentDetailsPage

getDocumentVersion

public String getDocumentVersion()
Gets document version value from top of the details page

Returns:
String value of document version

isUploadNewVersionDisplayed

public boolean isUploadNewVersionDisplayed()
Verify if button on version history view is displayed

Returns:
true if visible on the page

isEditOfflineLinkDisplayed

public boolean isEditOfflineLinkDisplayed()
Verify if the action to edit offline is available

Returns:
true if visible on the page

isEditOfflineDisplayed

public boolean isEditOfflineDisplayed()
Check for edit offline banner that appears on the top of the page when document is locked by edit off line.

Returns:
returns false always

render

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

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

selectUploadNewVersion

public UpdateFilePage selectUploadNewVersion()
Mimics the action of clicking on the upload new version button.

Returns:
HtmlPage page response object

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

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

getCommentCount

public Integer getCommentCount()
The number of comments value displayed on the span comment count.

Returns:
Integer total number of comments

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:
comment - to remove
Returns:
DocumentDetailsPage page object response

isCheckedOut

public boolean isCheckedOut()
Verifies if document is locked for offline editing.

Returns:
true if locked for offline editing

selectEditOffLine

public HtmlPage selectEditOffLine(File file)
Select the edit off line link.

Returns:
HtmlPage edit off line page.

selectDownload

public HtmlPage selectDownload(File file)
Downloads the document shown by the current page, optionally doing it by clicking the link in the browser (no control) or by doing a URL-based download.

Parameters:
file - optional file to download to. When given the link will not be clicked but the file will be downloaded directly from the server.
Returns:
HtmlPage page response

getDocumentSize

public String getDocumentSize()
Get the file size from the properties section of the document details page.

Returns:
String size

getProperties

public Map<String,String> getProperties()
Get the document properties from view.

Returns:
DocumentProperties value

selectEditProperties

public EditDocumentPropertiesPage selectEditProperties()
Mimics the action of selecting edit properties on the document details page.



Copyright © 2013. All Rights Reserved.