com.atlassian.confluence.it.content
Class ViewContentBean

java.lang.Object
  extended by com.atlassian.confluence.it.content.ViewContentBean

public class ViewContentBean
extends Object

Represents a View page for a Page or News.


Nested Class Summary
static class ViewContentBean.Builder
           
 
Field Summary
static String ADD_MENU_LINK_ID
           
static String CANNOT_VIEW_PAGE_MESSAGE
           
static String REMOVE_CONTENT_MENU_LINK
           
static String SHOW_COMMENTS_ID
           
static String VIEW_PAGE_INFO_LINK_ID
           
static String VIEW_SOURCE_LINK_ID
           
 
Method Summary
 EditContentBean addComment()
           
 ViewContentBean addTextComment(String comment)
           
static ViewContentBean.Builder builder()
           
 boolean canAddAttachment()
           
 boolean canAddBlogPost()
          Returns true if the Add Blogpost link is present.
 boolean canAddComment()
          Returns true if the Add Comment link is present.
 boolean canAddPage()
          Returns true if the Add Page link is present.
 boolean canEdit()
           
 boolean canRemoveComment(String commentId)
           
 boolean containsLinkTo(String spaceKey, String pageTitle)
           
 EditContentBean createBlogPost()
           
 EditContentBean createPage()
           
 EditContentBean edit()
           
 EditContentBean editBlogPost()
           
 EditContentBean editComment(String commentId)
           
 void ensureCommentsAreShown()
           
 List<String> getChildren()
          Returns the first 20 child page titles (if any) on the current page in the order they appear.
 List<CommentBean> getComments()
          Gets the first 20 top-level comments (if any) on the current page.
 String getContent()
           
 CommentBean getFocusedComment()
           
 long getPageId()
           
 PageMetadata getPageMetadata()
           
 Date getRequestTime()
           
 String getTitle()
           
 boolean hasLabel(String label)
           
 boolean isFavourite()
          Returns true if the unfavourite link is present, and false if the favourite link is present.
 boolean isRestricted()
          Returns true if the page restrictions link is present.
 boolean isViewable()
           
 boolean isWatching()
          Returns true if the unwatch link is present, and false if the watch link is present.
 boolean isWatchingSpace()
          Returns true if the space containing the content is being watched.
 boolean notPermitted()
           
 boolean pageNotFound()
          Returns true if the "Page Not Found" screen is presented.
 void remove()
           
 void removeComment(String commentId)
           
 EditContentBean replyToComment(String commentId)
           
 void setAsFavourite()
          Marks this page as a favourite.
 void toggleWatch()
          Clicks the "Watch" link.
 ViewAttachmentsBean viewAttachments()
           
static ViewContentBean viewBlogPost()
          Factory method to return a ViewContentBean pointing at the current location of the web tester.
static ViewContentBean viewBlogPost(BlogPost blogPost)
          The blog post is assumed to be today.
static ViewContentBean viewBlogPost(BlogPost blogPost, net.sourceforge.jwebunit.junit.WebTester webTester)
          The blog post is assumed to be today.
static ViewContentBean viewBlogPost(long contentId)
          Factory method to return a ViewContentBean for the blog post with the given content ID.
static ViewContentBean viewBlogPost(long contentId, net.sourceforge.jwebunit.junit.WebTester webTester)
          Factory method to return a ViewContentBean for the blog post with the given content ID.
static ViewContentBean viewBlogPost(String spaceKey, String postTitle)
          Factory method to return a ViewContentBean for the given post and space.
static ViewContentBean viewBlogPost(String spaceKey, String postTitle, Date postDate)
          Factory method to return a ViewContentBean for the given post and space.
static ViewContentBean viewBlogPost(String spaceKey, String postTitle, Date postDate, net.sourceforge.jwebunit.junit.WebTester webTester)
          Factory method to return a ViewContentBean for the given post and space.
static ViewContentBean viewBlogPost(String spaceKey, String postTitle, net.sourceforge.jwebunit.junit.WebTester webTester)
          Factory method to return a ViewContentBean for the given post and space.
static ViewContentBean viewBlogPost(net.sourceforge.jwebunit.junit.WebTester webTester)
           
static ViewContentBean viewBlogPostRespectingDate(BlogPost blogPost)
          When viewing the blog actually respect the date set on the blog.
static ViewContentBean viewBlogPostRespectingDate(BlogPost blogPost, net.sourceforge.jwebunit.junit.WebTester webTester)
          When viewing the blog actually respect the date set on the blog.
 ContentInfoBean viewInfo()
           
static ViewContentBean viewPage()
          Factory method to return a ViewContentBean pointing at the current location of the web tester.
static ViewContentBean viewPage(long contentId)
          Factory method to return a ViewContentBean for the page with the given content ID.
static ViewContentBean viewPage(long contentId, net.sourceforge.jwebunit.junit.WebTester webTester)
          Factory method to return a ViewContentBean for the page with the given content ID.
static ViewContentBean viewPage(Page page)
           
static ViewContentBean viewPage(Space space)
          View the home page of the given space.
static ViewContentBean viewPage(Space space, String pageTitle)
          Factory method to return a ViewContentBean for the given page and space.
static ViewContentBean viewPage(String spaceKey)
          Factory method to return a ViewContentBean for the homepage of the given space.
static ViewContentBean viewPage(String spaceKey, String pageTitle)
          Factory method to return a ViewContentBean for the given page and space.
static ViewContentBean viewPage(String spaceKey, String pageTitle, boolean commentsOn)
          Factory method to return a ViewContentBean for the given page and space, with comments specifically requested on or off.
static ViewContentBean viewPage(String spaceKey, String pageTitle, boolean commentsOn, net.sourceforge.jwebunit.junit.WebTester webTester)
          Factory method to return a ViewContentBean for the given page and space, with comments specifically requested on or off.
static ViewContentBean viewPage(String spaceKey, String pageTitle, net.sourceforge.jwebunit.junit.WebTester webTester)
           
static ViewContentBean viewPage(String spaceKey, net.sourceforge.jwebunit.junit.WebTester webTester)
          Factory method to return a ViewContentBean for the homepage of the given space.
static ViewContentBean viewPage(net.sourceforge.jwebunit.junit.WebTester webTester)
           
static ViewContentBean viewPageWithNoDecorators(long pageId)
           
static ViewContentBean viewPageWithNoDecorators(long pageId, net.sourceforge.jwebunit.junit.WebTester webTester)
           
static ViewContentBean viewPageWithNoDecorators(Page page)
           
static ViewContentBean viewPageWithNoDecorators(Page page, net.sourceforge.jwebunit.junit.WebTester webTester)
           
static ViewContentBean viewPersonalSpace(String username)
           
static ViewContentBean viewPersonalSpace(String username, net.sourceforge.jwebunit.junit.WebTester webTester)
           
static ViewContentBean viewSpaceHomePage(Space space)
           
static ViewContentBean viewSpaceHomePage(Space space, net.sourceforge.jwebunit.junit.WebTester webTester)
           
 void viewWatchingSpace()
          Clicks the "Watching Space" link on the Tools menu, which loads the Space Advanced page where space-level watching is administered.
 void viewWikiMarkup()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CANNOT_VIEW_PAGE_MESSAGE

public static final String CANNOT_VIEW_PAGE_MESSAGE
See Also:
Constant Field Values

VIEW_SOURCE_LINK_ID

public static final String VIEW_SOURCE_LINK_ID
See Also:
Constant Field Values

SHOW_COMMENTS_ID

public static final String SHOW_COMMENTS_ID
See Also:
Constant Field Values

ADD_MENU_LINK_ID

public static final String ADD_MENU_LINK_ID
See Also:
Constant Field Values

REMOVE_CONTENT_MENU_LINK

public static final String REMOVE_CONTENT_MENU_LINK
See Also:
Constant Field Values

VIEW_PAGE_INFO_LINK_ID

public static final String VIEW_PAGE_INFO_LINK_ID
See Also:
Constant Field Values
Method Detail

viewPage

public static ViewContentBean viewPage()
Factory method to return a ViewContentBean pointing at the current location of the web tester.


viewPage

public static ViewContentBean viewPage(net.sourceforge.jwebunit.junit.WebTester webTester)

viewBlogPost

public static ViewContentBean viewBlogPost()
Factory method to return a ViewContentBean pointing at the current location of the web tester.


viewBlogPost

public static ViewContentBean viewBlogPost(net.sourceforge.jwebunit.junit.WebTester webTester)

viewBlogPost

public static ViewContentBean viewBlogPost(String spaceKey,
                                           String postTitle)
Factory method to return a ViewContentBean for the given post and space. The post is assumed to be posted today.


viewBlogPost

public static ViewContentBean viewBlogPost(String spaceKey,
                                           String postTitle,
                                           net.sourceforge.jwebunit.junit.WebTester webTester)
Factory method to return a ViewContentBean for the given post and space. The post is assumed to be posted today.


viewBlogPost

public static ViewContentBean viewBlogPost(String spaceKey,
                                           String postTitle,
                                           Date postDate)
Factory method to return a ViewContentBean for the given post and space. The date in the post is used.


viewBlogPost

public static ViewContentBean viewBlogPost(String spaceKey,
                                           String postTitle,
                                           Date postDate,
                                           net.sourceforge.jwebunit.junit.WebTester webTester)
Factory method to return a ViewContentBean for the given post and space. The date in the post is used.


viewBlogPost

public static ViewContentBean viewBlogPost(long contentId)
Factory method to return a ViewContentBean for the blog post with the given content ID.


viewBlogPost

public static ViewContentBean viewBlogPost(long contentId,
                                           net.sourceforge.jwebunit.junit.WebTester webTester)
Factory method to return a ViewContentBean for the blog post with the given content ID.


viewBlogPost

public static ViewContentBean viewBlogPost(BlogPost blogPost)
The blog post is assumed to be today.


viewBlogPost

public static ViewContentBean viewBlogPost(BlogPost blogPost,
                                           net.sourceforge.jwebunit.junit.WebTester webTester)
The blog post is assumed to be today.


viewBlogPostRespectingDate

public static ViewContentBean viewBlogPostRespectingDate(BlogPost blogPost)
When viewing the blog actually respect the date set on the blog.


viewBlogPostRespectingDate

public static ViewContentBean viewBlogPostRespectingDate(BlogPost blogPost,
                                                         net.sourceforge.jwebunit.junit.WebTester webTester)
When viewing the blog actually respect the date set on the blog.


viewPage

public static ViewContentBean viewPage(long contentId)
Factory method to return a ViewContentBean for the page with the given content ID.


viewPage

public static ViewContentBean viewPage(long contentId,
                                       net.sourceforge.jwebunit.junit.WebTester webTester)
Factory method to return a ViewContentBean for the page with the given content ID.


viewPage

public static ViewContentBean viewPage(String spaceKey,
                                       net.sourceforge.jwebunit.junit.WebTester webTester)
Factory method to return a ViewContentBean for the homepage of the given space.


viewPage

public static ViewContentBean viewPage(String spaceKey)
Factory method to return a ViewContentBean for the homepage of the given space.


viewPage

public static ViewContentBean viewPage(Space space,
                                       String pageTitle)
Factory method to return a ViewContentBean for the given page and space.


viewPage

public static ViewContentBean viewPage(String spaceKey,
                                       String pageTitle,
                                       net.sourceforge.jwebunit.junit.WebTester webTester)

viewPage

public static ViewContentBean viewPage(String spaceKey,
                                       String pageTitle)
Factory method to return a ViewContentBean for the given page and space.


viewPage

public static ViewContentBean viewPage(Page page)

viewPageWithNoDecorators

public static ViewContentBean viewPageWithNoDecorators(Page page)

viewPageWithNoDecorators

public static ViewContentBean viewPageWithNoDecorators(Page page,
                                                       net.sourceforge.jwebunit.junit.WebTester webTester)

viewPageWithNoDecorators

public static ViewContentBean viewPageWithNoDecorators(long pageId)

viewPageWithNoDecorators

public static ViewContentBean viewPageWithNoDecorators(long pageId,
                                                       net.sourceforge.jwebunit.junit.WebTester webTester)

viewPage

public static ViewContentBean viewPage(Space space)
View the home page of the given space.

Parameters:
space - of which the home page will be visited
Returns:
a ViewContentBean viewing the home page of the space.

viewPage

public static ViewContentBean viewPage(String spaceKey,
                                       String pageTitle,
                                       boolean commentsOn)
Factory method to return a ViewContentBean for the given page and space, with comments specifically requested on or off.

Parameters:
commentsOn - specifies value of the showComments parameter

viewPage

public static ViewContentBean viewPage(String spaceKey,
                                       String pageTitle,
                                       boolean commentsOn,
                                       net.sourceforge.jwebunit.junit.WebTester webTester)
Factory method to return a ViewContentBean for the given page and space, with comments specifically requested on or off.

Parameters:
commentsOn - specifies value of the showComments parameter

viewPersonalSpace

public static ViewContentBean viewPersonalSpace(String username)

viewPersonalSpace

public static ViewContentBean viewPersonalSpace(String username,
                                                net.sourceforge.jwebunit.junit.WebTester webTester)

viewSpaceHomePage

public static ViewContentBean viewSpaceHomePage(Space space)

viewSpaceHomePage

public static ViewContentBean viewSpaceHomePage(Space space,
                                                net.sourceforge.jwebunit.junit.WebTester webTester)

builder

public static ViewContentBean.Builder builder()

getTitle

public String getTitle()

getContent

public String getContent()

createPage

public EditContentBean createPage()

createBlogPost

public EditContentBean createBlogPost()

edit

public EditContentBean edit()

editBlogPost

public EditContentBean editBlogPost()

remove

public void remove()

addTextComment

public ViewContentBean addTextComment(String comment)

addComment

public EditContentBean addComment()

getComments

public List<CommentBean> getComments()
Gets the first 20 top-level comments (if any) on the current page.

Ensures the comments are shown before trying to retrieve anything, so may result in a page reload.

See Also:
TODO threading.

replyToComment

public EditContentBean replyToComment(String commentId)

editComment

public EditContentBean editComment(String commentId)

removeComment

public void removeComment(String commentId)

viewAttachments

public ViewAttachmentsBean viewAttachments()

viewInfo

public ContentInfoBean viewInfo()

ensureCommentsAreShown

public void ensureCommentsAreShown()

getChildren

public List<String> getChildren()
Returns the first 20 child page titles (if any) on the current page in the order they appear. Relies on the child page section being already expanded. If you want to test showing/hiding the children, you will need to use Selenium as this is done with javascript as of CONFDEV-1005


viewWikiMarkup

public void viewWikiMarkup()

getPageId

public long getPageId()

toggleWatch

public void toggleWatch()
Clicks the "Watch" link.


viewWatchingSpace

public void viewWatchingSpace()
Clicks the "Watching Space" link on the Tools menu, which loads the Space Advanced page where space-level watching is administered.


isWatching

public boolean isWatching()
Returns true if the unwatch link is present, and false if the watch link is present. This does not include space-level watching.

Throws:
AssertionError - if neither link is present (eg if space is watched).

isWatchingSpace

public boolean isWatchingSpace()
Returns true if the space containing the content is being watched. ie. Watching Space link present


isFavourite

public boolean isFavourite()
Returns true if the unfavourite link is present, and false if the favourite link is present.

Throws:
AssertionError - if neither link is present.

setAsFavourite

public void setAsFavourite()
Marks this page as a favourite.


isRestricted

public boolean isRestricted()
Returns true if the page restrictions link is present.

Returns:
true if there are page restrictions on the current page

canAddPage

public boolean canAddPage()
Returns true if the Add Page link is present.


canAddBlogPost

public boolean canAddBlogPost()
Returns true if the Add Blogpost link is present.


canAddComment

public boolean canAddComment()
Returns true if the Add Comment link is present.


canRemoveComment

public boolean canRemoveComment(String commentId)

canAddAttachment

public boolean canAddAttachment()

canEdit

public boolean canEdit()

pageNotFound

public boolean pageNotFound()
Returns true if the "Page Not Found" screen is presented.


notPermitted

public boolean notPermitted()

getRequestTime

public Date getRequestTime()

getFocusedComment

public CommentBean getFocusedComment()

isViewable

public boolean isViewable()

containsLinkTo

public boolean containsLinkTo(String spaceKey,
                              String pageTitle)

hasLabel

public boolean hasLabel(String label)

getPageMetadata

public PageMetadata getPageMetadata()


Copyright © 2003-2013 Atlassian. All Rights Reserved.