com.atlassian.confluence.selenium.client
Class Editor

java.lang.Object
  extended by com.atlassian.confluence.selenium.client.Editor

public class Editor
extends java.lang.Object


Field Summary
static int EDITOR_TIMEOUT_MILLIS
           
static java.lang.String MARKUP_EDITOR_ID
           
 
Constructor Summary
Editor(ConfluenceSeleniumClient client, Confluence confluence)
           
 
Method Summary
 void addComment(Page page)
           
 void cancel()
           
 void createBlogPost(Space space)
           
 void createPage(Space space)
           
 void discardDraft()
           
 void edit(ContentEntity contentEntity)
           
 long getAttachmentSourceContentId()
           
 long getContentId()
           
 Location getLocation()
           
 long getMarkupEditorPositionTop()
           
 java.lang.String getPreviewContent()
           
 java.lang.String getRichTextContent()
           
 TinyMce getTinyMce()
           
 java.lang.String getTitle()
          Gets the value in the editor Title field.
 java.lang.String getWikiMarkupContent()
           
 boolean hasContentChanged()
          Returns true if Confluence considers the editor content to have changed.
 InsertImageDialog insertImage()
           
 boolean isRichTextMode()
           
 boolean isWikiMarkupMode()
           
 void logInAndAddComment(User user, Page page)
           
 void logInAndCreateBlogPost(User user, Space space)
           
 void logInAndCreateChildPage(User user, Space space, long parentPageId)
           
 void logInAndCreatePage(User user, Space space)
           
 void logInAndEdit(User user, ContentEntity contentEntity)
           
 void logInAndEditMarkup(User user, ContentEntity contentEntity, java.lang.String newContent)
           
 void merge()
          Click the link to merge an existing draft with the current editor content.
 InsertImagePopup openImagePopup()
           
 LinkBrowser openLinkBrowser()
           
 MovePageDialog openLocationEditor()
           
 MacroBrowser openMacroBrowser()
           
 MacroBrowser openMacroBrowserViaShortcut()
           
 PagePermissionsEditor openPermissionsEditor()
           
 void overwriteDraft()
          Click the link to overwrite a conflicting draft with the current editor content.
 void resumeDraft()
           
 PageView save()
           
 void selectFirstParagraph()
           
 void selectMarkupText(java.lang.String text)
          Selects the first occurrence of the given string in the Wiki Markup editor.
 void setContent(java.lang.String content)
           
 void setCursorPosition(int pos)
          Sets the cursor position in the markup editor.
 void setCursorPositionToEnd()
          Puts the cursor at the end of the Wiki Markup editor.
 void setTitle(java.lang.String title)
           
 void setWikiMarkupContent(java.lang.String markup)
           
 void switchToMarkup()
           
 void switchToPreview()
           
 TinyMce switchToRichText()
           
 void triggerDraftAndCheckNoUserDrafts(Page page)
          Leaves a unmodified page and checks that the draft screen does NOT contain a draft with the title of the given page.
 void triggerDraftAndCheckUserDrafts()
           
 void triggerDraftAndCheckUserDrafts(BlogPost blogpost)
           
 void triggerDraftAndCheckUserDrafts(Page page)
          Triggers a draft to be saved.
 void triggerDraftAndEdit(Page page)
          Triggers a draft to be saved.
 void viewConflict()
          Click the link to resolve a conflict between an existing draft and the current editor content.
 void waitForEditorPageLoad()
          Waits for the page to load with the configured editor page load timeout.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MARKUP_EDITOR_ID

public static final java.lang.String MARKUP_EDITOR_ID
See Also:
Constant Field Values

EDITOR_TIMEOUT_MILLIS

public static final int EDITOR_TIMEOUT_MILLIS
Constructor Detail

Editor

public Editor(ConfluenceSeleniumClient client,
              Confluence confluence)
Method Detail

waitForEditorPageLoad

public void waitForEditorPageLoad()
Waits for the page to load with the configured editor page load timeout. Loading editor pages is quite slow, so it should be higher than the other configured timeouts.


logInAndCreatePage

public void logInAndCreatePage(User user,
                               Space space)

logInAndCreateChildPage

public void logInAndCreateChildPage(User user,
                                    Space space,
                                    long parentPageId)

logInAndCreateBlogPost

public void logInAndCreateBlogPost(User user,
                                   Space space)

logInAndEdit

public void logInAndEdit(User user,
                         ContentEntity contentEntity)

logInAndAddComment

public void logInAndAddComment(User user,
                               Page page)

logInAndEditMarkup

public void logInAndEditMarkup(User user,
                               ContentEntity contentEntity,
                               java.lang.String newContent)

edit

public void edit(ContentEntity contentEntity)

addComment

public void addComment(Page page)

createPage

public void createPage(Space space)

createBlogPost

public void createBlogPost(Space space)

getRichTextContent

public java.lang.String getRichTextContent()

getWikiMarkupContent

public java.lang.String getWikiMarkupContent()

getTitle

public java.lang.String getTitle()
Gets the value in the editor Title field. If the field is showing the default greyed-text title an empty string will be returned.


getPreviewContent

public java.lang.String getPreviewContent()

setWikiMarkupContent

public void setWikiMarkupContent(java.lang.String markup)

setContent

public void setContent(java.lang.String content)

selectFirstParagraph

public void selectFirstParagraph()

selectMarkupText

public void selectMarkupText(java.lang.String text)
Selects the first occurrence of the given string in the Wiki Markup editor.


switchToMarkup

public void switchToMarkup()

switchToRichText

public TinyMce switchToRichText()

switchToPreview

public void switchToPreview()

triggerDraftAndCheckUserDrafts

public void triggerDraftAndCheckUserDrafts(Page page)
Triggers a draft to be saved. It checks that the draft screen contains a draft with the title of the given page.


triggerDraftAndCheckUserDrafts

public void triggerDraftAndCheckUserDrafts(BlogPost blogpost)

triggerDraftAndCheckUserDrafts

public void triggerDraftAndCheckUserDrafts()

triggerDraftAndCheckNoUserDrafts

public void triggerDraftAndCheckNoUserDrafts(Page page)
Leaves a unmodified page and checks that the draft screen does NOT contain a draft with the title of the given page.


triggerDraftAndEdit

public void triggerDraftAndEdit(Page page)
Triggers a draft to be saved. It checks that the draft screen contains a draft with the title of the given page and then returns to the edit page screen.


save

public PageView save()

cancel

public void cancel()

resumeDraft

public void resumeDraft()

discardDraft

public void discardDraft()

openPermissionsEditor

public PagePermissionsEditor openPermissionsEditor()

setTitle

public void setTitle(java.lang.String title)

merge

public void merge()
Click the link to merge an existing draft with the current editor content.


viewConflict

public void viewConflict()
Click the link to resolve a conflict between an existing draft and the current editor content.


overwriteDraft

public void overwriteDraft()
Click the link to overwrite a conflicting draft with the current editor content.


setCursorPosition

public void setCursorPosition(int pos)
Sets the cursor position in the markup editor.


setCursorPositionToEnd

public void setCursorPositionToEnd()
Puts the cursor at the end of the Wiki Markup editor.


hasContentChanged

public boolean hasContentChanged()
Returns true if Confluence considers the editor content to have changed. Checks RTE and Wiki markup.


getTinyMce

public TinyMce getTinyMce()

isWikiMarkupMode

public boolean isWikiMarkupMode()

isRichTextMode

public boolean isRichTextMode()

openLocationEditor

public MovePageDialog openLocationEditor()

openImagePopup

public InsertImagePopup openImagePopup()

openMacroBrowserViaShortcut

public MacroBrowser openMacroBrowserViaShortcut()

openMacroBrowser

public MacroBrowser openMacroBrowser()

openLinkBrowser

public LinkBrowser openLinkBrowser()

insertImage

public InsertImageDialog insertImage()

getContentId

public long getContentId()

getAttachmentSourceContentId

public long getAttachmentSourceContentId()

getLocation

public Location getLocation()

getMarkupEditorPositionTop

public long getMarkupEditorPositionTop()


Copyright © 2003-2010 Atlassian. All Rights Reserved.