public abstract class AbstractEditorContentWebDriverTest extends Object
Modifier and Type | Field and Description |
---|---|
CancelAnyAlert |
cancelAnyAlert |
CancelAnyEditorAuiModalDialog |
cancelAnyEditorAuiModalDialog |
protected static Editor |
editor |
protected static EditorContent |
editorContent |
org.junit.rules.Timeout |
globalTimeout |
com.atlassian.webdriver.testing.rule.IgnoreBrowserRule |
ignoreRule |
com.atlassian.webdriver.testing.rule.LogPageSourceRule |
logPageSourceRule |
LogTimeRule |
logTimeRule |
protected static String |
OS_CTRL_KEY |
protected static ConfluenceTestedProduct |
product |
protected static ConfluenceRpc |
rpc |
com.atlassian.webdriver.testing.rule.WebDriverScreenshotRule |
webDriverScreenshotRule |
Constructor and Description |
---|
AbstractEditorContentWebDriverTest() |
Modifier and Type | Method and Description |
---|---|
protected void |
assertEditorHtml(String html)
Asserts that the HTML content of the editor matches the given HTML - use with care, HTML produced by the editor
can be inconsistent across browsers, and HTML content returned by TinyMCE is 'cleaned up'.
|
protected void |
assertEditorHtml(String html,
boolean normalizeSpaces)
Asserts that the HTML content of the editor matches the given HTML - use with care, HTML produced by the editor
can be inconsistent across browsers, and HTML content returned by TinyMCE is 'cleaned up'.
|
protected void |
assertEditorHtmlContains(String html)
Asserts that the HTML content of the editor contains the given HTML - use with care, HTML produced by the editor
can be inconsistent across browsers, and HTML content returned by TinyMCE is 'cleaned up'.
|
protected void |
assertEditorHtmlDoesNotContain(String html)
Asserts that the HTML content of the editor does not contain the given HTML - use with care, HTML
produced by the editor can be inconsistent across browsers.
|
protected void |
assertEditorText(String text)
Asserts that the textual content of the editor matches the given string - use with care, there can be spacing
inconsistencies across browsers.
|
protected void |
assertElementAttributeValue(String selector,
String attributeName,
String expectedAttributeValue)
Deprecated.
|
protected void |
assertElementAttributeValueMatches(String selector,
String attributeName,
org.hamcrest.Matcher<String> attributeValueMatcher) |
protected void |
assertElementNumberOfMatches(int quantity,
String selector)
Asserts that the number of matches for a particular selector query within the editor content is consistent
with the expected quantity
|
protected void |
assertElementText(String text,
String selector)
Asserts that text in the provided selection within the editor content matches the given string.
|
protected void |
assertElementText(String message,
String text,
String selector)
Asserts that text in the provided selection within the editor content matches the given string.
|
protected void |
assertElementTextContains(String text,
String selector)
Asserts that text in the provided selection within the editor content contains the given string.
|
void |
clearContent() |
protected void |
clickOnElement(String selector)
Simulates clicking on the matched element in the editor content.
|
protected void |
ignoreBrowserDecorator(Runnable runnable,
com.atlassian.pageobjects.browser.Browser... ignoredBrowsers)
Used for comet assertions in order to allow specific private assertions to be ignored on certain browsers
|
protected void |
ignoreBrowserDecoratorSetup() |
protected void |
ignoreBrowserDecoratorTearDown() |
protected void |
insertAndWaitForFixture(String fixture)
Sets the content of the editor using the TinyMCE API and waits for the exact same content to be present - if the
content being set in the editor contains any HTML tags it's safer to use
insertAndWaitForFixture(String, String)
instead. |
protected void |
insertAndWaitForFixture(String fixture,
String htmlToWaitFor)
Sets the content of the editor using the TinyMCE API and waits for the specified content to be present.
|
protected boolean |
isEditorV4()
Check if using editor-v4 ( = TinyMCE 4).
|
protected void |
placeCursorAtTheEndOfElement(String selector)
Positions the cursor at the end of the first matched element for the provided CSS selector.
|
protected void |
placeCursorAtTheStartOfElement(String selector)
Positions the cursor at the start of the first matched element for the provided CSS selector.
|
protected void |
pressBackspace()
Simulates pressing backspace on the TinyMCE iframe.
|
protected void |
pressDelete()
Simulates pressing the delete key on the TinyMCE iframe.
|
protected void |
pressDown()
Simulates pressing the down arrow key on the TinyMCE iframe.
|
protected void |
pressEnter()
Simulates pressing the enter key on the TinyMCE iframe.
|
protected void |
pressEsc()
Simulates pressing the escape key on the TinyMCE iframe.
|
protected void |
pressLeft()
Simulates pressing the left arrow key on the TinyMCE iframe.
|
protected void |
pressMultipleKeys(String keysChord)
Simulates pressing multiple keys at once on the TinyMCE iframe.
|
protected void |
pressReturn()
Simulates pressing the return key on the TinyMCE iframe.
|
protected void |
pressRight()
Simulates pressing the right arrow key on the TinyMCE iframe.
|
protected void |
pressTab()
Simulates pressing the tab key on the TinyMCE iframe.
|
protected void |
pressUp()
Simulates pressing the up arrow key on the TinyMCE iframe.
|
static void |
setupEditor() |
static void |
tearDownEditor() |
protected void |
typeInTheEditor(String string)
Simulates typing in the editor.
|
protected void |
undo()
Executes the undo editor command.
|
protected static Editor editor
protected static EditorContent editorContent
protected static ConfluenceTestedProduct product
protected static ConfluenceRpc rpc
protected static final String OS_CTRL_KEY
public com.atlassian.webdriver.testing.rule.IgnoreBrowserRule ignoreRule
public com.atlassian.webdriver.testing.rule.WebDriverScreenshotRule webDriverScreenshotRule
public com.atlassian.webdriver.testing.rule.LogPageSourceRule logPageSourceRule
public LogTimeRule logTimeRule
public org.junit.rules.Timeout globalTimeout
@Inject public CancelAnyEditorAuiModalDialog cancelAnyEditorAuiModalDialog
@Inject public CancelAnyAlert cancelAnyAlert
public static void setupEditor()
public static void tearDownEditor()
public void clearContent()
protected void ignoreBrowserDecorator(Runnable runnable, com.atlassian.pageobjects.browser.Browser... ignoredBrowsers)
protected void ignoreBrowserDecoratorSetup()
protected void ignoreBrowserDecoratorTearDown()
protected void assertEditorHtml(String html)
assertEditorHtmlContains(String)
instead.html
- HTML content to matchprotected void assertEditorHtml(String html, boolean normalizeSpaces)
assertEditorHtmlContains(String)
instead.html
- HTML content to matchnormalizeSpaces
- boolean indicating whether spaces should be normalisedprotected void assertEditorHtmlContains(String html)
html
- HTML content to matchprotected void assertEditorHtmlDoesNotContain(String html)
html
- HTML content to search forprotected void assertEditorText(String text)
text
- Text to match@Deprecated protected void assertElementAttributeValue(String selector, String attributeName, String expectedAttributeValue)
assertElementAttributeValueMatches(String, String, Matcher)
selector
- CSS selector for locating element in the editor contentattributeName
- Name of the attribute to read the value forexpectedAttributeValue
- Expected value for the attributeprotected void assertElementAttributeValueMatches(String selector, String attributeName, org.hamcrest.Matcher<String> attributeValueMatcher)
protected void assertElementNumberOfMatches(int quantity, String selector)
quantity
- The number of expected matchesselector
- CSS selector to be used for matching elements in the editor contentprotected void assertElementText(String text, String selector)
text
- Text we expect to matchselector
- CSS selector for locating element in the editor contentprotected void assertElementText(String message, String text, String selector)
message
- Error messagetext
- Text we expect to matchselector
- CSS selector for locating element in the editor contentprotected void assertElementTextContains(String text, String selector)
text
- Text we expect the element to containselector
- CSS selector for locating element in the editor contentprotected void clickOnElement(String selector)
selector
- CSS selector for locating element in the editor contentprotected void insertAndWaitForFixture(String fixture)
insertAndWaitForFixture(String, String)
instead.fixture
- Normalised HTML content to be set in the editorprotected void insertAndWaitForFixture(String fixture, String htmlToWaitFor)
fixture
- HTML content to be set in the editorhtmlToWaitFor
- Content to be used for checking that the editor has been updatedprotected void placeCursorAtTheEndOfElement(String selector)
selector
- CSS selector to be used for positioning the cursor.protected void placeCursorAtTheStartOfElement(String selector)
selector
- CSS selector to be used for positioning the cursor.protected void pressUp()
protected void pressDown()
protected void pressLeft()
protected void pressRight()
protected void pressBackspace()
protected void pressDelete()
protected void pressEnter()
protected void pressReturn()
protected void pressEsc()
protected void pressMultipleKeys(String keysChord)
keysChord
- A representation of keys to press - see Keys.chord(CharSequence...)
protected void pressTab()
protected void undo()
protected void typeInTheEditor(String string)
string
- Content to type into the editorprotected boolean isEditorV4()
Copyright © 2003–2020 Atlassian. All rights reserved.