|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.confluence.selenium.client.Editor
public class Editor
Nested Class Summary | |
---|---|
static class |
Editor.EditorMode
|
Field Summary | |
---|---|
static String |
EDITOR_ID
|
static int |
EDITOR_TIMEOUT_MILLIS
|
Constructor Summary | |
---|---|
Editor(ConfluenceSeleniumClient client,
Suite suite)
|
Method Summary | |
---|---|
void |
addComment(Page page)
|
void |
addComment(PageView pageView)
Add a comment from a page view. |
void |
addErrorMessage(String id,
String message,
boolean showInAllModes)
Adds the specified error message to the screen. |
PageView |
cancel()
|
void |
clickSave()
Click the save button but perform no waits or assertions. |
PageTemplateWizard |
clickSelectTemplate()
|
void |
closeCalanderPickerByClickInEditor()
Has the unfortunate side effect of losing your cursor position, blame tinymce. |
void |
closeDraftMessage()
|
void |
createBlogPost(Space space)
|
void |
createPage(Space space)
|
PageTemplateWizard |
createPageFromTemplate(Space space)
|
PageTemplateWizard |
createPageFromTemplate(Space space,
long parentPageId)
|
void |
discardDraft()
|
TinyMce |
edit(ContentEntity contentEntity)
|
long |
getAttachmentSourceContentId()
|
String |
getContent()
|
long |
getContentId()
|
EditorPreview |
getEditorPreview()
|
String |
getFirstMatchingPreviewNodeText(String selector)
|
String |
getHtmlSourceContent()
|
Location |
getLocation()
|
MacroBrowser |
getMacroBrowser()
For use when opening the macro browser manually, e.g. |
Map<String,String> |
getMacroParameters(String name)
Retrieve a macro's parameters from the editor. |
String |
getNormalisedContent()
Returns a version of getContent() that should be the same in all browsers. |
String |
getPreviewContent()
|
String |
getPreviewSelectorScript(String selector)
|
String |
getPreviewTableCellText(int row,
int column)
|
String |
getRichTextContent()
Deprecated. since 4.0 Use getContent() instead |
TinyMce |
getTinyMce()
|
String |
getTitle()
Gets the value in the editor Title field. |
long |
getToolbarPositionTop()
|
String |
getWikiMarkupContent()
Deprecated. |
boolean |
hasContentChanged()
Returns true if Confluence considers the editor content to have changed. |
InsertImageDialog |
insertImage()
Opens the image dialog if in RTE mode. |
void |
insertImage(Attachment attachment)
|
boolean |
isBlogPost()
|
boolean |
isCreatePage()
|
boolean |
isHeartbeatMessageVisible()
|
boolean |
isMacroPresent(String name,
Map<String,String> parameters)
Encapsulate the editor representation of macros in a single place for testing. |
boolean |
isPermisionsEditorPresent()
|
boolean |
isPermissionsSet()
Returns true if permissions have been set in the editor. |
boolean |
isPresent()
|
boolean |
isRichTextMode()
|
boolean |
isSourceMode()
|
boolean |
isTitleEditable()
|
TinyMce |
logInAndAddComment(User user,
BlogPost blogpost)
|
TinyMce |
logInAndAddComment(User user,
Page page)
|
TinyMce |
logInAndCopyPage(User user,
Page page)
|
TinyMce |
logInAndCreateBlogPost(User user,
Space space)
|
TinyMce |
logInAndCreateChildPage(User user,
Space space,
long parentPageId)
|
TinyMce |
logInAndCreateEditorTemplate(User user,
Space space)
|
TinyMce |
logInAndCreatePage(User user,
Space space)
|
TinyMce |
logInAndEdit(User user,
ContentEntity contentEntity)
|
TinyMce |
logInAndEditInRTE(User user,
ContentEntity contentEntity)
Logs the given user in, edits the given content and switches to the RTE. |
void |
merge()
Click the link to merge an existing draft with the current editor content. |
void |
openCalenderPicker()
|
LinkBrowser |
openLinkBrowser()
|
MacroBrowser |
openMacroBrowser()
|
MacroBrowser |
openMacroBrowserViaShortcut()
|
PagePermissionsEditor |
openPermissionsEditor()
|
void |
overwriteDraft()
Click the link to overwrite a conflicting draft with the current editor content. |
void |
replyToComment(Comment comment)
Opens the reply page for the given comment |
void |
resumeDraft()
|
PageView |
save()
|
PageView |
save(MovePageDialog dialog)
|
String |
saveAndExpectAlert()
Clicks save but expects an alert mesage without leaving the page. |
Editor |
saveAndExpectToFail()
Saves the page and expects to return to the editor. |
void |
saveDraft()
|
PageView |
saveWithKeyboardShortcut()
|
MovePageDialog |
saveWithLocation()
Note that this is only available as a dark feature now. |
void |
selectFirstParagraph()
|
void |
setContent(String content)
Note: Be careful with \n characters as they behave differently in IE and FF at the moment. |
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 |
setHtmlContent(String htmlContent)
|
void |
setHtmlSource(String source)
|
void |
setTitle(String title)
|
void |
setVersionComment(String versionComment)
|
void |
setWikiMarkupContent(String markup)
Deprecated. Try setHtmlContent(java.lang.String) for injecting content into the Editor without typing. |
void |
switchToMarkup()
Deprecated. No more markup editor. |
EditorPreview |
switchToPreview()
|
TinyMce |
switchToRichText()
|
void |
swtichToSource()
|
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 and then checks that the draft screen contains a draft with the title of the given page. |
void |
triggerDraftAndEdit(Page page)
Triggers a draft to be saved. |
void |
triggerDraftAutoSave()
Triggers a draft by switching to preview mode. |
void |
viewConflict()
Click the link to resolve a conflict between an existing draft and the current editor content. |
void |
waitForCalanderPickerClose()
|
void |
waitForCalendarPicker()
|
void |
waitForDraftAutoSavedMessage()
|
void |
waitForEditorPageLoad()
Waits for the page to load with the configured editor page load timeout. |
void |
waitForHeartbeatMessage()
Waits for the heartbeat message container to appear. |
void |
waitForPreviewToLoad()
Wait until the preview is loaded |
void |
waitUntilEditorIsVisible()
Wait until the RTE is visible after switching back from the preview |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String EDITOR_ID
public static final int EDITOR_TIMEOUT_MILLIS
Constructor Detail |
---|
public Editor(ConfluenceSeleniumClient client, Suite suite)
Method Detail |
---|
public void waitForEditorPageLoad()
public TinyMce logInAndCopyPage(User user, Page page)
public TinyMce logInAndCreatePage(User user, Space space)
public TinyMce logInAndCreateChildPage(User user, Space space, long parentPageId)
public TinyMce logInAndCreateBlogPost(User user, Space space)
public TinyMce logInAndEdit(User user, ContentEntity contentEntity)
public TinyMce logInAndCreateEditorTemplate(User user, Space space)
public TinyMce logInAndAddComment(User user, Page page)
public TinyMce logInAndAddComment(User user, BlogPost blogpost)
public TinyMce logInAndEditInRTE(User user, ContentEntity contentEntity)
public TinyMce edit(ContentEntity contentEntity)
public void addComment(Page page)
public void addComment(PageView pageView)
public void replyToComment(Comment comment)
comment
- The comment to reply to. It must have an id and page id set.public void createPage(Space space)
public PageTemplateWizard createPageFromTemplate(Space space)
public PageTemplateWizard createPageFromTemplate(Space space, long parentPageId)
public void createBlogPost(Space space)
public boolean isPresent()
@Deprecated public String getRichTextContent()
getContent()
instead
@Deprecated public String getWikiMarkupContent()
public String getHtmlSourceContent()
public String getTitle()
public String getPreviewContent()
public String getPreviewTableCellText(int row, int column)
public String getFirstMatchingPreviewNodeText(String selector)
public String getPreviewSelectorScript(String selector)
@Deprecated public void setWikiMarkupContent(String markup)
setHtmlContent(java.lang.String)
for injecting content into the Editor without typing.
public void setHtmlContent(String htmlContent)
public void setContent(String content)
public void setHtmlSource(String source)
public void setVersionComment(String versionComment)
public String getContent()
public String getNormalisedContent()
getContent()
that should be the same in all browsers.
The content is:
public void selectFirstParagraph()
@Deprecated public void switchToMarkup()
public TinyMce switchToRichText()
public EditorPreview switchToPreview()
public EditorPreview getEditorPreview()
public void swtichToSource()
public void triggerDraftAutoSave()
public void waitForDraftAutoSavedMessage()
public void closeDraftMessage()
public void triggerDraftAndCheckUserDrafts(Page page)
public void triggerDraftAndCheckUserDrafts(BlogPost blogpost)
public void triggerDraftAndCheckUserDrafts()
public void triggerDraftAndCheckNoUserDrafts(Page page)
public void triggerDraftAndEdit(Page page)
public void clickSave()
public PageView save()
public PageView save(MovePageDialog dialog)
public PageView saveWithKeyboardShortcut()
public Editor saveAndExpectToFail()
save()
in that uses the editor
timeout instead of the normal page view timeout and also fails if there is no editor on the page that shows
after save.
public String saveAndExpectAlert()
public PageView cancel()
public void resumeDraft()
public void discardDraft()
public PagePermissionsEditor openPermissionsEditor()
public boolean isPermissionsSet()
public boolean isPermisionsEditorPresent()
public void setTitle(String title)
public boolean isTitleEditable()
public void merge()
public void viewConflict()
public void overwriteDraft()
public void setCursorPosition(int pos)
public void setCursorPositionToEnd()
public boolean hasContentChanged()
public TinyMce getTinyMce()
public boolean isRichTextMode()
public boolean isSourceMode()
public MovePageDialog saveWithLocation()
public MacroBrowser openMacroBrowserViaShortcut()
public MacroBrowser openMacroBrowser()
public LinkBrowser openLinkBrowser()
public MacroBrowser getMacroBrowser()
public void waitForPreviewToLoad()
public void waitUntilEditorIsVisible()
public InsertImageDialog insertImage()
public void insertImage(Attachment attachment)
public long getContentId()
public long getAttachmentSourceContentId()
public boolean isCreatePage()
public boolean isBlogPost()
public Location getLocation()
public long getToolbarPositionTop()
public void openCalenderPicker()
public void waitForCalendarPicker()
public void closeCalanderPickerByClickInEditor()
public void waitForCalanderPickerClose()
public void waitForHeartbeatMessage()
public boolean isHeartbeatMessageVisible()
public PageTemplateWizard clickSelectTemplate()
public Map<String,String> getMacroParameters(String name)
name
- the name of the macro to be checked for
com.thoughtworks.selenium.SeleniumException
- if the macro doesn't exist.public boolean isMacroPresent(String name, Map<String,String> parameters)
name
- the name of the macro to be checked forparameters
- the parameters to be checked for or null if there are none.
public void addErrorMessage(String id, String message, boolean showInAllModes)
id
- the element id for the error to be addedmessage
- the message to displayshowInAllModes
- true will show the error in both editor and preview modes, false only in editor mode.public void saveDraft()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |