Class ViewContentBean
java.lang.Object
com.atlassian.confluence.it.content.ViewContentBean
Represents a View page for a Page or News.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionaddTextComment(String comment) voidvoidvoidvoidstatic ViewContentBean.Builderbuilder()static ViewContentBean.Builderbuilder(net.sourceforge.jwebunit.junit.WebTester tester) booleanDeprecated.since 5.9.0.booleanDeprecated.since 5.9.0.booleanReturns true if the Add Comment link is present.booleanDeprecated.since 5.9.0.booleancanEdit()booleancanRemoveComment(String commentId) booleanReturns true if the request access button link is present.booleancontainsLinkTo(String spaceKey, long pageId, String pageTitle) booleancontainsLinkTo(String spaceKey, String pageTitle) copy()Deprecated.since 5.9.0 useEditContentBean.CreateByUrlBuilderinstead.Deprecated.since 5.9.0 useEditContentBean.CreateByUrlBuilderinstead.edit()editComment(String commentId) voidReturns the first 20 child page titles (if any) on the current page in the order they appear.Gets the first 20 top-level comments (if any) on the current page.longgetTitle()booleanbooleanDeprecated.Since 5.6 UseassertHasViewPermission()orassertHasNoViewPermission()booleanReturns true if the unfavourite link is present, and false if the favourite link is present.booleanbooleanReturns true if the page restrictions link is present.booleanDeprecated.since 5.6 UseassertHasNoViewPermission()orassertHasViewPermission()booleanReturns true if the "Page Not Found" screen is presented.voidremove()voidremoveComment(String commentId) replyToComment(String commentId) voidMarks this page as a favourite.static ViewContentBeanFactory method to return a ViewContentBean pointing at the current location of the web tester.static ViewContentBeanviewBlogPost(long contentId) Factory method to return a ViewContentBean for the blog post with the given content ID.static ViewContentBeanviewBlogPost(long contentId, net.sourceforge.jwebunit.junit.WebTester webTester) Factory method to return a ViewContentBean for the blog post with the given content ID.static ViewContentBeanviewBlogPost(BlogPost blogPost) static ViewContentBeanviewBlogPost(BlogPost blogPost, net.sourceforge.jwebunit.junit.WebTester webTester) static ViewContentBeanviewBlogPost(String spaceKey, String postTitle) Deprecated.Since 5.6.static ViewContentBeanviewBlogPost(String spaceKey, String postTitle, Date postDate) Factory method to return a ViewContentBean for the given post and space.static ViewContentBeanviewBlogPost(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 ViewContentBeanviewBlogPost(String spaceKey, String postTitle, net.sourceforge.jwebunit.junit.WebTester webTester) Deprecated.Since 5.6.static ViewContentBeanviewBlogPost(net.sourceforge.jwebunit.junit.WebTester webTester) static ViewContentBeanviewBlogPostRespectingDate(BlogPost blogPost) When viewing the blog actually respect the date set on the blog.static ViewContentBeanviewBlogPostRespectingDate(BlogPost blogPost, net.sourceforge.jwebunit.junit.WebTester webTester) When viewing the blog actually respect the date set on the blog.viewInfo()static ViewContentBeanviewPage()Factory method to return a ViewContentBean pointing at the current location of the web tester.static ViewContentBeanviewPage(long contentId) Factory method to return a ViewContentBean for the page with the given content ID.static ViewContentBeanviewPage(long contentId, net.sourceforge.jwebunit.junit.WebTester webTester) Factory method to return a ViewContentBean for the page with the given content ID.static ViewContentBeanstatic ViewContentBeanstatic ViewContentBeanView the home page of the given space.static ViewContentBeanFactory method to return a ViewContentBean for the given page and space.static ViewContentBeanstatic ViewContentBeanstatic ViewContentBeanFactory method to return a ViewContentBean for the homepage of the given space.static ViewContentBeanFactory method to return a ViewContentBean for the given page and space.static ViewContentBeanFactory method to return a ViewContentBean for the given page and space, with comments specifically requested on or off.static ViewContentBeanviewPage(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 ViewContentBeanstatic ViewContentBeanFactory method to return a ViewContentBean for the homepage of the given space.static ViewContentBeanviewPage(net.sourceforge.jwebunit.junit.WebTester webTester) static ViewContentBeanviewPersonalSpace(String username) static ViewContentBeanviewPersonalSpace(String username, net.sourceforge.jwebunit.junit.WebTester webTester) static ViewContentBeanviewSpaceHomePage(Space space) static ViewContentBeanviewSpaceHomePage(Space space, net.sourceforge.jwebunit.junit.WebTester webTester) static ViewContentBeanstatic ViewContentBeanvoid
-
Field Details
-
VIEW_SOURCE_LINK_ID
- See Also:
-
SHOW_COMMENTS_ID
- See Also:
-
REMOVE_CONTENT_MENU_LINK
- See Also:
-
VIEW_PAGE_INFO_LINK_ID
- See Also:
-
-
Method Details
-
viewPage
Factory method to return a ViewContentBean pointing at the current location of the web tester. -
viewPage
-
viewBlogPost
Factory method to return a ViewContentBean pointing at the current location of the web tester. -
viewBlogPost
-
viewBlogPost
Deprecated.Since 5.6. This method is flaky as dates can change during test runs. UseviewBlogPost(com.atlassian.confluence.it.BlogPost)instead.Factory method to return a ViewContentBean for the given post and space. The post is assumed to be posted today. -
viewBlogPost
@Deprecated public static ViewContentBean viewBlogPost(String spaceKey, String postTitle, net.sourceforge.jwebunit.junit.WebTester webTester) Deprecated.Since 5.6. This method is flaky as dates can change during test runs. UseviewBlogPost(com.atlassian.confluence.it.BlogPost)instead.Factory method to return a ViewContentBean for the given post and space. The post is assumed to be posted today. -
viewBlogPost
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
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
-
viewBlogPost
public static ViewContentBean viewBlogPost(BlogPost blogPost, net.sourceforge.jwebunit.junit.WebTester webTester) -
viewBlogPostRespectingDate
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
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
Factory method to return a ViewContentBean for the homepage of the given space. -
viewPage
Factory method to return a ViewContentBean for the given page and space. -
viewPage
public static ViewContentBean viewPage(Space space, String pageTitle, net.sourceforge.jwebunit.junit.WebTester tester) -
viewPage
public static ViewContentBean viewPage(String spaceKey, String pageTitle, net.sourceforge.jwebunit.junit.WebTester webTester) -
viewPage
Factory method to return a ViewContentBean for the given page and space. -
viewPage
-
viewPage
-
viewPage
View the home page of the given space.- Parameters:
space- of which the home page will be visited- Returns:
- a
ViewContentBeanviewing the home page of the space.
-
viewPage
public static ViewContentBean viewPage(Space space, net.sourceforge.jwebunit.junit.WebTester tester) -
viewPage
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
-
viewPersonalSpace
public static ViewContentBean viewPersonalSpace(String username, net.sourceforge.jwebunit.junit.WebTester webTester) -
viewSpaceHomePage
-
viewSpaceHomePage
public static ViewContentBean viewSpaceHomePage(Space space, net.sourceforge.jwebunit.junit.WebTester webTester) -
viewUrl
-
viewUrl
public static ViewContentBean viewUrl(String url, net.sourceforge.jwebunit.junit.WebTester webTester) -
builder
-
builder
-
getTitle
-
getContent
-
createPage
Deprecated.since 5.9.0 useEditContentBean.CreateByUrlBuilderinstead. -
createBlogPost
Deprecated.since 5.9.0 useEditContentBean.CreateByUrlBuilderinstead. -
edit
-
editBlogPost
-
remove
public void remove() -
addTextComment
-
addComment
-
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:
-
replyToComment
-
editComment
-
removeComment
-
viewAttachments
-
viewInfo
-
ensureCommentsAreShown
public void ensureCommentsAreShown() -
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-1005As of CONFDEV-22698 the default sidebar setting will be pagetree, which will not play nicely with this method as-is. The following can be used as a temporary workaround to switch spaces to use the old child pages view:
rpc.executeAuthPluginXmlRpc("space-sidebar", "setOption", TEST_SPACE.getKey(), "nav-type", "pages");
-
viewWikiMarkup
public void viewWikiMarkup() -
getPageId
public long getPageId() -
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
-
canRequestAccess
public boolean canRequestAccess()Returns true if the request access button link is present.- Returns:
- true if there are page restrictions on the current page
-
canAddPage
Deprecated.since 5.9.0. -
canAddBlogPost
Deprecated.since 5.9.0. -
canAddComment
public boolean canAddComment()Returns true if the Add Comment link is present. -
canRemoveComment
-
canAddAttachment
Deprecated.since 5.9.0. -
canEdit
public boolean canEdit() -
pageNotFound
public boolean pageNotFound()Returns true if the "Page Not Found" screen is presented. -
hasNoPermission
Deprecated.Since 5.6 UseassertHasViewPermission()orassertHasNoViewPermission() -
assertHasNoViewPermission
public void assertHasNoViewPermission() -
assertHasViewPermission
public void assertHasViewPermission() -
assertCanEdit
public void assertCanEdit() -
assertCanAddComment
public void assertCanAddComment() -
isNotPermitted
public boolean isNotPermitted() -
getRequestTime
-
getFocusedComment
-
isViewable
Deprecated.since 5.6 UseassertHasNoViewPermission()orassertHasViewPermission() -
containsLinkTo
-
containsLinkTo
-
copy
-
hasLabel
-
getPageMetadata
-