com.atlassian.confluence.selenium.client
Class TinyMce

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

public class TinyMce
extends java.lang.Object


Nested Class Summary
static class TinyMce.Bookmark
          Represents a TinyMCE bookmark.
static class TinyMce.Format
           
static class TinyMce.SimpleToolbarButton
           
 
Field Summary
static java.lang.String TINYMCE_LOCATOR
           
 
Constructor Summary
TinyMce(ConfluenceSeleniumClient client, Editor editor)
           
 
Method Summary
 void clickFormatMenuLink()
           
 void clickHorizontalRuler()
           
 InsertCharacterPopup clickInsertCharacter()
           
 void clickInsertColAfter()
           
 void clickInsertColBefore()
           
 EmoticonPickerPopup clickInsertEmoticon()
           
 void clickInsertRowAfter()
           
 void clickInsertRowBefore()
           
 InsertTablePopup clickInsertTable()
           
 ColorPickerPopup clickMoreColors()
           
 void clickSelectedColor()
           
 void clickToolbarButton(TinyMce.SimpleToolbarButton button)
           
 TinyMce.Bookmark getBookmark()
           
 ConfluenceSeleniumClient getClient()
           
 java.lang.String getFirstMatchingNodeText(java.lang.String selector)
          Retrieve the text of the first node that matches the given selector.
 java.lang.String getFullscreenFrameId()
           
static java.lang.String getLocatorForTags(java.lang.String tagNames, com.atlassian.selenium.SeleniumClient.Browser browser)
          Returns a selenium locator for the specified html tag in the TinyMCE editor.
 int getNumberOfCols()
           
 int getNumberOfRows()
           
 int getSelectorCount(java.lang.String 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 getToolbarButtonId(TinyMce.SimpleToolbarButton button)
           
 void hideFullScreen()
          Returns to the normal editor from fullscreen mode and resets the active frame.
 boolean isMacroPresent(java.lang.String macroName)
           
 boolean isToolbarButtonEnabled(TinyMce.SimpleToolbarButton button)
           
 EditorInsertMenu openInsertMenu()
           
 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(boolean addingContent)
          Places the cursor at the begining of the RTE.
 void placeCursorAtStart(java.lang.String selector)
          Positions the cursor at the start of the first matched element for the provided CSS selector.
 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.SimpleToolbarButton button)
           
 void putCursorAtStartOfFirstElementWithSelector(java.lang.String selector)
          Place the cursor at the start of the first element matching the given selector.
 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)
           
 void selectFullscreenFrame()
          Selects the TinyMCE fullscreen iframe.
 void selectMacro(java.lang.String macroName)
           
 void selectMainFrame()
          Selects the main/top frame for Confluence.
 void selectTextColor(java.lang.String rgbColor)
           
 void setContent(java.lang.String content)
           
 void showFullScreen()
          Clicks the fullscreen toolbar icon in the TinyMCE editor.
 void type(java.lang.String content)
          Only works for Firefox, and period doesn't work.
 void typeTextInFullScreen(java.lang.String content)
          Types in the given content in fullscreen mode.
 void typeWithFullKeyEvents(java.lang.String content)
           
 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 waitForTableCellPresent()
           
 void waitForTableHeadingCellPresent()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TINYMCE_LOCATOR

public static final java.lang.String TINYMCE_LOCATOR
See Also:
Constant Field Values
Constructor Detail

TinyMce

public TinyMce(ConfluenceSeleniumClient client,
               Editor editor)
Method Detail

getClient

public ConfluenceSeleniumClient getClient()

getFullscreenFrameId

public java.lang.String getFullscreenFrameId()

getLocatorForTags

public static java.lang.String getLocatorForTags(java.lang.String tagNames,
                                                 com.atlassian.selenium.SeleniumClient.Browser browser)
Returns a selenium locator for the specified html tag in the TinyMCE editor. Depending on the browser, it will return the appropriate locator. This is required as different browsers have different implementations of the executing wywsiwyg commands such as bold, italic etc.


selectEditorFrame

public void selectEditorFrame()
Selects the TinyMCE iframe. You can then use Selenium assert methods normally. Use selectMainFrame() to reselect the main outer frame.


selectFullscreenFrame

public void selectFullscreenFrame()
Selects the TinyMCE fullscreen iframe. You can then use Selenium assert methods normally. Use selectMainFrame() to reselect the main outer frame.


selectMainFrame

public void selectMainFrame()
Selects the main/top frame for Confluence.


showFullScreen

public void showFullScreen()
Clicks the fullscreen toolbar icon in the TinyMCE editor. It also selects the fullscreen editor frame. Be sure to select the main frame again (or use hideFullScreen()) in a finally block.


hideFullScreen

public void hideFullScreen()
Returns to the normal editor from fullscreen mode and resets the active frame.


typeTextInFullScreen

public void typeTextInFullScreen(java.lang.String content)
Types in the given content in fullscreen mode. Note that this method leaves the editor in full screen mode and is only applicable to Firefox.


selectFormat

public void selectFormat(TinyMce.Format format)

clickFormatMenuLink

public void clickFormatMenuLink()

getToolbarButtonId

public java.lang.String getToolbarButtonId(TinyMce.SimpleToolbarButton button)

isToolbarButtonEnabled

public boolean isToolbarButtonEnabled(TinyMce.SimpleToolbarButton button)

clickToolbarButton

public void clickToolbarButton(TinyMce.SimpleToolbarButton button)

pressShortcut

public void pressShortcut(TinyMce.SimpleToolbarButton button)

clickHorizontalRuler

public void clickHorizontalRuler()

clickInsertTable

public InsertTablePopup clickInsertTable()

clickInsertRowBefore

public void clickInsertRowBefore()

clickInsertRowAfter

public void clickInsertRowAfter()

clickInsertColBefore

public void clickInsertColBefore()

clickInsertColAfter

public void clickInsertColAfter()

clickInsertEmoticon

public EmoticonPickerPopup clickInsertEmoticon()

clickInsertCharacter

public InsertCharacterPopup clickInsertCharacter()

clickSelectedColor

public void clickSelectedColor()

selectTextColor

public void selectTextColor(java.lang.String rgbColor)

clickMoreColors

public ColorPickerPopup clickMoreColors()

waitForTableHeadingCellPresent

public void waitForTableHeadingCellPresent()

waitForTableCellPresent

public void waitForTableCellPresent()

getNumberOfRows

public int getNumberOfRows()

getNumberOfCols

public int getNumberOfCols()

setContent

public void setContent(java.lang.String content)

type

public void type(java.lang.String content)
Only works for Firefox, and period doesn't work. http://jira.openqa.org/browse/SEL-521


typeWithFullKeyEvents

public void typeWithFullKeyEvents(java.lang.String content)
See Also:
SeleniumClient#typeWithFullKeyEvents}

selectFirstElementWithSelector

public void selectFirstElementWithSelector(java.lang.String selector)
Select the first element matching the given selector.

Parameters:
selector - see tiny_mce_src.DOMUtils.select

selectElementWithSelectorAndIndex

public void selectElementWithSelectorAndIndex(java.lang.String selector,
                                              int elementIndex)
Select the nth element matching the given selector.

Parameters:
selector - see tiny_mce_src.DOMUtils.select
elementIndex - index of matched element to select, 0-indexed

putCursorAtStartOfFirstElementWithSelector

public void putCursorAtStartOfFirstElementWithSelector(java.lang.String selector)
Place the cursor at the start of the first element matching the given selector.

Parameters:
selector - see tiny_mce_src.DOMUtils.select

placeCursorAtStart

public void placeCursorAtStart(boolean addingContent)
Places the cursor at the begining of the RTE.

Parameters:
addingContent - use true if adding content and there is nothing present in the editor.

placeCursorAtStart

public void placeCursorAtStart(java.lang.String selector)
Positions the cursor at the start of the first matched element for the provided CSS selector.


placeCursor

public 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. Doesn't work for IE very well.


selectEmptyFirstParagraph

public void selectEmptyFirstParagraph()

selectFirstParagraph

public void selectFirstParagraph()

selectMacro

public void selectMacro(java.lang.String macroName)

isMacroPresent

public boolean isMacroPresent(java.lang.String macroName)

pressEnter

public void pressEnter()
Types the "Enter" key at the current cursor position. Known to have problems in IE.


pressEscape

public void pressEscape()
Types the "Escape" key at the current cursor position.


waitForSelectorPresent

public void waitForSelectorPresent(java.lang.String selector)
Wait for the given jQuery selector to be present in the TinyMCE editor.


getSelectorPresentScript

public 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.


getSelectorCount

public int getSelectorCount(java.lang.String selector)

waitForSelectorCount

public void waitForSelectorCount(java.lang.String selector,
                                 int count)

getSelectorScript

public 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.


getFirstMatchingNodeText

public java.lang.String getFirstMatchingNodeText(java.lang.String selector)
Retrieve the text of the first node that matches the given selector.


getBookmark

public TinyMce.Bookmark getBookmark()

openInsertMenu

public EditorInsertMenu openInsertMenu()


Copyright © 2003-2010 Atlassian. All Rights Reserved.