|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.confluence.selenium.client.TinyMce
public class TinyMce
Nested Class Summary | |
---|---|
static class |
TinyMce.Bookmark
Represents a TinyMCE bookmark. |
static class |
TinyMce.Format
|
static class |
TinyMce.Position
|
static class |
TinyMce.ShortCut
|
static class |
TinyMce.SimpleToolbarButton
|
Field Summary | |
---|---|
static char |
NBSP
|
static java.lang.String |
TINYMCE_LOCATOR
|
static java.lang.String |
TOOLBAR_LOCATOR
|
Constructor Summary | |
---|---|
TinyMce(ConfluenceSeleniumClient client,
Editor editor)
|
Method Summary | |
---|---|
void |
clickFormatMenuLink()
|
void |
clickHorizontalRuler()
|
InsertCharacterDialog |
clickInsertCharacter()
|
EmoticonPickerPopup |
clickInsertEmoticon()
|
InsertTablePopup |
clickInsertTable()
|
void |
clickOutsideEditor()
Used for clicking something outside of the TinyMCE editor that is (currently) known to not have any click-handler on it. |
void |
clickSelectedColor()
|
KeyboardShortcutHelpDialog |
clickShortcutHelpDialog()
|
void |
clickToolbarButton(TinyMce.SimpleToolbarButton button)
|
void |
copyAndPaste(java.lang.String selector)
Copies the content specified by the selector, and pastes it before the content. |
void |
dispatchClickEventForSelector(java.lang.String selector)
Triggers ed.onClick.dispatch on TinyMCE |
void |
editorContentFocus()
|
java.lang.String |
getAttributeForSelector(java.lang.String selector,
java.lang.String attribute)
Returns the value of the given attribute for the given selector. |
TinyMce.Bookmark |
getBookmark()
|
ConfluenceSeleniumClient |
getClient()
|
java.lang.String |
getContent()
Returns the current content of the Editor as HTML. |
java.lang.String |
getContent(java.lang.String selector,
boolean removeNewLines)
Returns the current content specified by the selector from the Editor as HTML. |
java.lang.String |
getContentIncludingNode(java.lang.String selector)
Returns the current content specified by the selector from the Editor as HTML, including the selector itself. |
java.lang.String |
getCssAttributeForSelector(java.lang.String selector,
java.lang.String attribute)
Returns the value of the given attribute for the given selector. |
java.lang.String |
getCurrentSelectionText()
Returns the text of the current editor selection. |
java.lang.String |
getExpressionValue(java.lang.String expression)
Makes the TinyMCE doc available to the passed expression and evaluates it, returning the string result. |
java.lang.String |
getFirstRowSelector()
|
java.lang.String |
getFirstTextColor()
Gets the color of the first span with color in the style attribute. |
java.lang.String |
getImageSelector(boolean thumbnail)
Returns the TinyMce selector for images in the editor. |
java.lang.String |
getLastRowSelector()
|
static java.lang.String |
getLocatorForTags(java.lang.String tagNames,
com.atlassian.selenium.Browser browser)
Returns a selenium locator or jQuery selector for the specified html tag in the TinyMCE editor. |
java.lang.String |
getMacroBodyText(java.lang.String macroName)
Returns the body text of the macro. |
int |
getNumberOfCols()
|
int |
getNumberOfRows()
|
java.lang.String |
getRowSelector(int row)
|
java.lang.String |
getSelectedColor()
|
java.lang.String |
getSelectedColorDisplayColor()
|
int |
getSelectorCount(java.lang.String selector)
Returns the number of elements present in the editor specified by the given selector. |
java.lang.String |
getSelectorPresentScript(java.lang.String selector)
Returns a javascript function that checks for the presence of an element with given jquery selector in the TinyMCE editor. |
java.lang.String |
getSelectorScript(java.lang.String selector)
Returns a javascript function that checks for the presence of an element with given jquery selector in the TinyMCE editor. |
java.lang.String |
getTextAfterMacro(java.lang.String macroName)
Returns the text in the Paragraph element after the macro (or its wrapper). |
java.lang.String |
getTextBeforeMacro(java.lang.String macroName)
Returns the text in the Paragraph element before the macro (or its wrapper). |
java.lang.String |
getTextInTableCell(int row,
int col)
|
java.lang.String |
getToolbarButtonId(TinyMce.SimpleToolbarButton button)
|
boolean |
isAutocompleteDropdownPresent()
Checks whether the autocomplete dropdown is present. |
boolean |
isCellHighlighted(int row,
int column,
java.lang.String colour)
Checks if the row and column is highlighted. |
boolean |
isColumnHeading(int column)
Checks if the nth column is column row. |
boolean |
isExternalImagePresent(java.lang.String image)
Returns true if the given attachment is present in the RTE. |
boolean |
isImagePresent(Attachment attachment)
Returns true if the given attachment is present in the RTE. |
boolean |
isLeftAligned(java.lang.String selector)
Checks that the given selector is left-aligned in the editor. |
boolean |
isMacroPresent(Macro macro)
Returns true if a macro with given name is present in the editor. |
boolean |
isMacroPresent(java.lang.String macroName)
|
boolean |
isMacroPresent(java.lang.String macroName,
java.lang.String parameters)
|
boolean |
isMacroPresent(java.lang.String macroName,
java.lang.String parameters,
java.lang.String bodyText)
|
boolean |
isMacroPresent(java.lang.String macroName,
java.lang.String parameters,
java.lang.String bodyText,
java.lang.String defaultParameter)
Returns true if the macro with given parameters and body text, is present in the editor. |
boolean |
isMacroPropertyPanelPresent()
|
boolean |
isRightAligned(java.lang.String selector)
Checks that the given selector is right-aligned in the editor. |
boolean |
isRowHeading(int row)
Checks if the nth row is a heading row |
boolean |
isRowHighlighted()
Checks if the first row in the table is a heading row |
boolean |
isSelectorPresent(java.lang.String selector)
|
boolean |
isTableHeaderRow(int row)
|
boolean |
isTableNormalRow(int row)
|
boolean |
isTablePresent()
|
boolean |
isToolbarButtonActive(TinyMce.SimpleToolbarButton button)
|
boolean |
isToolbarButtonEnabled(TinyMce.SimpleToolbarButton button)
|
EditorInsertMenu |
openInsertMenu()
|
EditorMoreMenu |
openMoreMenu()
|
void |
pasteContent(java.lang.String html)
Pastes the content as though it came from the clipboard. |
void |
placeCursor(java.lang.String selector,
int position)
Positions the cursor at the specified position in the first matched element for the provided CSS selector. |
void |
placeCursorAtStart(java.lang.String selector)
Positions the cursor at the start of the first matched element for the provided CSS selector. |
void |
pressBackspace()
Types the "Backspace" key at the current cursor position. |
void |
pressDown()
Types the "Down arrow" key at the current cursor position. |
void |
pressEnter()
Types the "Enter" key at the current cursor position. |
void |
pressEscape()
Types the "Escape" key at the current cursor position. |
void |
pressShortcut(TinyMce.ShortCut shortCut)
|
void |
pressShortcut(TinyMce.SimpleToolbarButton button)
|
void |
pressUp()
Types the "Up arrow" key at the current cursor position. |
void |
putCursorAtStartOfElementWithSelectorAndIndex(java.lang.String selector,
int elementIndex)
Place the cursor at the start of the element matching the given selector and index. |
void |
putCursorAtStartOfFirstElementWithSelector(java.lang.String selector)
Place the cursor at the start of the first element matching the given selector. |
void |
scrollTopTo(int scrollTop)
Scroll the RTE vertically to a certain position. |
void |
selectEditorFrame()
Selects the TinyMCE iframe. |
void |
selectElementWithSelectorAndIndex(java.lang.String selector,
int elementIndex)
Select the nth element matching the given selector. |
void |
selectEmptyFirstParagraph()
|
void |
selectFirstElementWithSelector(java.lang.String selector)
Select the first element matching the given selector. |
void |
selectFirstParagraph()
|
void |
selectFormat(TinyMce.Format format)
|
MacroPropertyPanel |
selectMacro(java.lang.String macroName)
|
MacroPropertyPanel |
selectMacro(java.lang.String macroName,
java.lang.Runnable waitFor)
|
void |
selectMainFrame()
Selects the main/top frame for Confluence. |
void |
selectTextColor(java.lang.String rgbColor)
|
void |
setContent(java.lang.String content)
|
void |
setContentForSelector(java.lang.String selector,
java.lang.String text)
Sets the passed text in the RTE element matching the selector. |
void |
setHtmlContent(java.lang.String html)
Used by tests rather than to replicate user behaviour. |
void |
toggleSourceMode()
|
EditorAutocomplete |
triggerAutocomplete(TinyMce.ShortCut shortCut)
Launches the autocomplete by pressing a shortcut key combination at the current cursor position. |
void |
type(java.lang.String content)
Only works for Firefox, and period doesn't work. |
void |
typeWithFullKeyEvents(java.lang.String content)
Only works for Firefox, and period doesn't work. |
void |
waitForImage(Attachment image)
Wait for the specified image to load. |
void |
waitForMacroPresent(java.lang.String macroName)
|
void |
waitForSelectorCount(java.lang.String selector,
int count)
|
void |
waitForSelectorPresent(java.lang.String selector)
Wait for the given jQuery selector to be present in the TinyMCE editor. |
void |
waitForSelectorPresentWithText(java.lang.String selector,
int index,
java.lang.String bodyText)
|
void |
waitForSelectorPresentWithText(java.lang.String selector,
java.lang.String bodyText)
|
void |
waitForTableCellPresent()
|
void |
waitForTableHeadingCellPresent()
|
java.lang.Boolean |
wasInsertedCorrectDirection(TinyMce.Position pos,
int selectedRow)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TINYMCE_LOCATOR
public static final java.lang.String TOOLBAR_LOCATOR
public static final char NBSP
Constructor Detail |
---|
public TinyMce(ConfluenceSeleniumClient client, Editor editor)
Method Detail |
---|
public ConfluenceSeleniumClient getClient()
public static java.lang.String getLocatorForTags(java.lang.String tagNames, com.atlassian.selenium.Browser browser)
public void selectEditorFrame()
selectMainFrame()
to reselect the main outer frame.
public void selectMainFrame()
public void selectFormat(TinyMce.Format format)
public void clickFormatMenuLink()
public java.lang.String getToolbarButtonId(TinyMce.SimpleToolbarButton button)
public boolean isToolbarButtonEnabled(TinyMce.SimpleToolbarButton button)
public boolean isToolbarButtonActive(TinyMce.SimpleToolbarButton button)
public void clickToolbarButton(TinyMce.SimpleToolbarButton button)
public void pressShortcut(TinyMce.SimpleToolbarButton button)
public void pressShortcut(TinyMce.ShortCut shortCut)
public void clickHorizontalRuler()
public InsertTablePopup clickInsertTable()
public EmoticonPickerPopup clickInsertEmoticon()
public InsertCharacterDialog clickInsertCharacter()
public void clickSelectedColor()
public java.lang.String getSelectedColor()
public java.lang.String getSelectedColorDisplayColor()
public void selectTextColor(java.lang.String rgbColor)
public java.lang.String getFirstTextColor()
public boolean isRightAligned(java.lang.String selector)
selector
- The selector to check the style for.
public boolean isLeftAligned(java.lang.String selector)
selector
- The selector to check the style for.
public boolean isAutocompleteDropdownPresent()
public KeyboardShortcutHelpDialog clickShortcutHelpDialog()
public void waitForTableHeadingCellPresent()
public void waitForTableCellPresent()
public int getNumberOfRows()
public java.lang.String getFirstRowSelector()
public java.lang.String getLastRowSelector()
public java.lang.String getRowSelector(int row)
public int getNumberOfCols()
public boolean isTableHeaderRow(int row)
public boolean isTableNormalRow(int row)
public java.lang.String getTextInTableCell(int row, int col)
public java.lang.Boolean wasInsertedCorrectDirection(TinyMce.Position pos, int selectedRow)
public void setContent(java.lang.String content)
public void setHtmlContent(java.lang.String html)
html
- valid HTML (not blank)public java.lang.String getContent()
public java.lang.String getContent(java.lang.String selector, boolean removeNewLines)
public java.lang.String getContentIncludingNode(java.lang.String selector)
public void editorContentFocus()
public void type(java.lang.String content)
public void typeWithFullKeyEvents(java.lang.String content)
SeleniumClient.typeWithFullKeyEvents(String, String)
public void selectFirstElementWithSelector(java.lang.String selector)
selector
- see tiny_mce_src.DOMUtils.selectpublic void selectElementWithSelectorAndIndex(java.lang.String selector, int elementIndex)
selector
- see tiny_mce_src.DOMUtils.selectelementIndex
- index of matched element to select, 0-indexedpublic java.lang.String getCurrentSelectionText()
public void putCursorAtStartOfElementWithSelectorAndIndex(java.lang.String selector, int elementIndex)
putCursorAtStartOfFirstElementWithSelector(String)
into it.
selector
- see tiny_mce_src.DOMUtils.selectelementIndex
- index of matched element to select, 0-indexedpublic void putCursorAtStartOfFirstElementWithSelector(java.lang.String selector)
selector
- see tiny_mce_src.DOMUtils.selectpublic void placeCursorAtStart(java.lang.String selector)
public void placeCursor(java.lang.String selector, int position)
public void selectEmptyFirstParagraph()
public void selectFirstParagraph()
public boolean isMacroPropertyPanelPresent()
public MacroPropertyPanel selectMacro(java.lang.String macroName, java.lang.Runnable waitFor)
public MacroPropertyPanel selectMacro(java.lang.String macroName)
public boolean isTablePresent()
public boolean isRowHighlighted()
public boolean isRowHeading(int row)
row
- - the position of the row in the table (the first row == 1)
public boolean isColumnHeading(int column)
column
- - the position of the column in the table (the first column == 1)
public boolean isCellHighlighted(int row, int column, java.lang.String colour)
row
- - the position of the row in the table (the first row == 1)column
- - the position of the column in the table (the first column == 1)colour
- - highlight colour
public void waitForMacroPresent(java.lang.String macroName)
public boolean isMacroPresent(java.lang.String macroName)
isMacroPresent(String, String, String, String)
public boolean isMacroPresent(java.lang.String macroName, java.lang.String parameters)
isMacroPresent(String, String, String, String)
public boolean isMacroPresent(java.lang.String macroName, java.lang.String parameters, java.lang.String bodyText)
isMacroPresent(String, String, String, String)
public boolean isMacroPresent(java.lang.String macroName, java.lang.String parameters, java.lang.String bodyText, java.lang.String defaultParameter)
macroName
- name of the macroparameters
- String in the wiki markup format key=value|key=value with keys in alphabetical order.bodyText
- expected raw text of the macro bodypublic boolean isMacroPresent(Macro macro)
macro
- instance of Macropublic java.lang.String getMacroBodyText(java.lang.String macroName)
macroName
- name of macro with body
public void waitForSelectorPresentWithText(java.lang.String selector, java.lang.String bodyText)
public void waitForSelectorPresentWithText(java.lang.String selector, int index, java.lang.String bodyText)
public java.lang.String getTextBeforeMacro(java.lang.String macroName)
public java.lang.String getTextAfterMacro(java.lang.String macroName)
public boolean isImagePresent(Attachment attachment)
public boolean isExternalImagePresent(java.lang.String image)
public void pressBackspace()
public void pressEnter()
public void pressEscape()
public void pressDown()
public void pressUp()
public void dispatchClickEventForSelector(java.lang.String selector)
selector
- jQuery selector for element to click, should only select one elementpublic void waitForSelectorPresent(java.lang.String selector)
public java.lang.String getSelectorPresentScript(java.lang.String selector)
public boolean isSelectorPresent(java.lang.String selector)
selector
- jquery selector to check for
public void waitForImage(Attachment image)
image
- The image that should be present in the editor.public int getSelectorCount(java.lang.String selector)
selector
- jQuery selectorpublic java.lang.String getExpressionValue(java.lang.String expression)
expression
- a JavaScript expression, can assume "doc" is the TinyMCE document.
public void waitForSelectorCount(java.lang.String selector, int count)
public java.lang.String getAttributeForSelector(java.lang.String selector, java.lang.String attribute)
public java.lang.String getCssAttributeForSelector(java.lang.String selector, java.lang.String attribute)
public void setContentForSelector(java.lang.String selector, java.lang.String text)
public java.lang.String getSelectorScript(java.lang.String selector)
public TinyMce.Bookmark getBookmark()
public EditorInsertMenu openInsertMenu()
public EditorMoreMenu openMoreMenu()
public void scrollTopTo(int scrollTop)
public void clickOutsideEditor()
public EditorAutocomplete triggerAutocomplete(TinyMce.ShortCut shortCut)
public void toggleSourceMode()
public java.lang.String getImageSelector(boolean thumbnail)
thumbnail
- true, then the selector applies to image thumbnails, false it does not
public void copyAndPaste(java.lang.String selector)
selector
- public void pasteContent(java.lang.String html)
html
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |