|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.thoughtworks.selenium.DefaultSelenium com.atlassian.selenium.SingleBrowserSeleniumClient com.atlassian.confluence.selenium.client.ConfluenceSeleniumClient
public class ConfluenceSeleniumClient
Extends the Atlassian Selenium client to provide Confluence specific methods.
Field Summary | |
---|---|
static String |
DOWN_KEY
|
static String |
UP_KEY
|
static String |
WIKI_CONTENT_XPATH
|
Fields inherited from class com.atlassian.selenium.SingleBrowserSeleniumClient |
---|
ACTION_WAIT, PAGE_LOAD_WAIT |
Fields inherited from class com.thoughtworks.selenium.DefaultSelenium |
---|
commandProcessor |
Method Summary | |
---|---|
void |
check(String name,
String value)
Checks a checkbox given a name and value. |
void |
cleanUp()
Resets the selenium client to a default state so that we can not slow down the tests run accidentally anymore. |
void |
click(String locator,
boolean waitForPageToLoad)
|
void |
click(String locator,
long timeoutMillis)
|
void |
clickLinkWithTextInWikiContent(String text,
boolean waitForPageToLoad)
Clicks a link in the wiki content with the exact text given. |
String |
getBaseUrl()
|
com.atlassian.selenium.Browser |
getBrowser()
|
double |
getBrowserVersion()
|
String |
getContextPath()
Context path, including initial slash, eg "/confluence". |
String |
getEval(String javascript)
Runs the provided Javascript statement in the context of the test page, not the Selenium tester like DefaultSelenium.getEval(String) does. |
boolean |
getEvalAsBoolean(String javascript)
|
int |
getEvalAsInteger(String javascript)
|
String |
getEvalFunction(String... functionLines)
Varargs version of getEvalFunction(String) which joins together its arguments with newlines. |
String |
getEvalFunction(String function)
Runs the provided Javascript function in the context of the test page. |
List<String> |
getEvalListFunction(String... functionLines)
Version of getEvalFunction(String...) which executes a JS function which returns a list,
joins the result on the client side using commas, then splits it back into a list to return. |
static ConfluenceSeleniumClient |
getInstance()
|
int |
getJQueryElementSelectorHeight(String selector)
Gets the height of the supplied jQuery selector. |
String |
getMetadata(String key)
|
boolean |
getMetadataBoolean(String key)
|
long |
getMetadataLong(String key)
|
boolean |
hasSelectorWithText(String selector,
String text)
Returns true if the given JQuery selector returns at least one result containing the supplied text. |
boolean |
isIE6Mode()
|
boolean |
isJQueryElementSelectorPresent(String selector)
Returns true if the given JQuery selector returns at least one result. |
void |
keyPressOnly(String locator,
String key)
|
void |
open(String url,
long timeoutMillis)
Overridden to append the context path in front of the url. |
void |
openAbsoluteURL(String url)
|
void |
openAbsoluteURL(String url,
long timeoutMillis)
|
void |
pressBackspace(String elementLocator)
Simulates pressing the backspace key in the element. |
void |
pressCtrlAltAndKey(String locator,
String keySequence)
Presses the control and alt keys, followed by the key(s) passed in |
void |
pressCtrlAndKey(String locator,
String keySequence)
Presses the control key, followed by the key(s) passed in. |
void |
pressCtrlAndKeyDownOnly(String locator,
String keySequence)
Use this method for key presses that will load a new page. |
void |
pressCtrlShiftAndKey(String locator,
String keySequence)
Presses the control+shift keys, followed by the key(s) passed in. |
void |
pressEnter(String elementLocator,
boolean waitForPageToLoad)
Simulates pressing the enter key in the element. |
void |
pressEscape(String elementLocator)
Simulates pressing the Esc key in the element. |
void |
pressShiftAndKey(String locator,
String keySequence)
|
void |
pressTab(String elementLocator)
Simulates pressing the tab key in the element. |
void |
selectTopFrame()
|
void |
setScriptsFinishedPluginExpected(boolean expected)
|
void |
submit(String form,
boolean waitForPageToLoad)
|
void |
submit(String form,
boolean waitForPageToLoad,
boolean onlyFireEvent)
|
void |
submit(String form,
long timeoutMillis)
|
String |
toHexColor(String colorText)
Converts style color "rbg(1, 2, 3)", or "#010203" into a hex color "010203". |
void |
typeInElementWithId(String elementId,
String text)
|
void |
typeWithLastCharFullKeyEvents(String locator,
String text)
Types text in the field specified by the locator. |
void |
waitForCondition(String javascript,
String timeoutMillis)
Runs the provided Javascript statement in the context of the test page, not the Selenium tester like DefaultSelenium.waitForCondition(String, String) does. |
void |
waitForFunction(String javascript)
|
void |
waitForFunction(String javascript,
String timeoutMillis)
Runs the provided Javascript function in the context of the test page. |
void |
waitForJQueryElementSelector(String selector)
Blocks until an element is found with the specified jQuery selector (or until the action timeout is reached). |
void |
waitForJQueryElementSelector(String selector,
long timeoutMillis)
Blocks until an element is found with the specified jQuery selector (or until the given timeout is reached). |
void |
waitForJQueryElementSelectorCount(String selector,
int count)
Blocks until a certain number of elements are found with the specified jQuery selector (or until the action timeout is reached). |
void |
waitForJqueryEventTriggered(String eventName,
String selector)
Will wait for a specfic event to be triggered. |
void |
waitForNoJQueryElementSelector(String selector)
|
void |
waitForPageToLoad(long timeoutMillis)
|
void |
waitForPageToLoad(String timeout)
Override to make sure all Javascript has finished loading before returning. |
void |
waitForScriptsToLoad()
|
void |
waitUntilFocused(String elementId)
Waits until the element with the supplied id has cursor focus or until the default timeout expires. |
void |
waitUntilHiddenById(String elementId)
Waits until the element with the supplied id is hidden or until the default timeout expires. |
void |
waitUntilRemoved(String selector)
Waits until the elements matched by the supplied selector are removed from the DOM. |
void |
waitUntilVisible(String selector)
Waits until the element(s) matched by the supplied selector is visible or until the default timeout expires. |
void |
waitUntilVisibleById(String elementId)
Waits until the element with the supplied id is visible or until the default timeout expires. |
Methods inherited from class com.atlassian.selenium.SingleBrowserSeleniumClient |
---|
captureEntirePageScreenshot, clickAndWaitForAjaxWithJquery, clickAndWaitForAjaxWithJquery, clickButton, clickButtonAndWaitForAjaxWithJquery, clickButtonWithName, clickButtonWithNameAndWaitForAjaxWithJquery, clickElementWithClass, clickElementWithClassAndWaitForAjaxWithJquery, clickElementWithCss, clickElementWithCssAndWaitForAjaxWithJquery, clickElementWithTitle, clickElementWithTitleAndWaitForAjaxWithJquery, clickElementWithXpath, clickElementWithXpathAndWaitForAjaxWithJquery, clickLinkWithText, evaluate, generateKeyEvent, hasJquery, keyPress, open, openNoWait, refreshAndWait, selectOption, selectOptionAndWaitForAjaxWithJquery, seleniumKeyPress, simulateKeyPressForCharacter, simulateKeyPressForCharacter, simulateKeyPressForSpecialKey, simulateKeyPressForSpecialKey, start, toggleToCharacterCode, toggleToKeyCode, typeInElementWithCss, typeInElementWithName, typeWithFullKeyEvents, typeWithFullKeyEvents, waitForAjaxWithJquery, waitForAjaxWithJquery, waitForCondition, waitForCondition, waitForJQuery, waitForPageToLoad |
Methods inherited from class com.thoughtworks.selenium.DefaultSelenium |
---|
addCustomRequestHeader, addLocationStrategy, addScript, addSelection, allowNativeXpath, altKeyDown, altKeyUp, answerOnNextPrompt, assignId, attachFile, captureEntirePageScreenshot, captureEntirePageScreenshotToString, captureNetworkTraffic, captureScreenshot, captureScreenshotToString, check, chooseCancelOnNextConfirmation, chooseOkOnNextConfirmation, click, clickAt, close, contextMenu, contextMenuAt, controlKeyDown, controlKeyUp, createCookie, deleteAllVisibleCookies, deleteCookie, deselectPopUp, doubleClick, doubleClickAt, dragAndDrop, dragAndDropToObject, dragdrop, fireEvent, focus, getAlert, getAllButtons, getAllFields, getAllLinks, getAllWindowIds, getAllWindowNames, getAllWindowTitles, getAttribute, getAttributeFromAllWindows, getBodyText, getConfirmation, getCookie, getCookieByName, getCssCount, getCursorPosition, getElementHeight, getElementIndex, getElementPositionLeft, getElementPositionTop, getElementWidth, getExpression, getHtmlSource, getLocation, getLog, getMouseSpeed, getPrompt, getSelectedId, getSelectedIds, getSelectedIndex, getSelectedIndexes, getSelectedLabel, getSelectedLabels, getSelectedValue, getSelectedValues, getSelectOptions, getSpeed, getTable, getText, getTitle, getValue, getWhetherThisFrameMatchFrameExpression, getWhetherThisWindowMatchWindowExpression, getXpathCount, goBack, highlight, ignoreAttributesWithoutValue, isAlertPresent, isChecked, isConfirmationPresent, isCookiePresent, isEditable, isElementPresent, isOrdered, isPromptPresent, isSomethingSelected, isTextPresent, isVisible, keyDown, keyDownNative, keyPressNative, keyUp, keyUpNative, metaKeyDown, metaKeyUp, mouseDown, mouseDownAt, mouseDownRight, mouseDownRightAt, mouseMove, mouseMoveAt, mouseOut, mouseOver, mouseUp, mouseUpAt, mouseUpRight, mouseUpRightAt, open, openWindow, refresh, removeAllSelections, removeScript, removeSelection, retrieveLastRemoteControlLogs, rollup, runScript, select, selectFrame, selectPopUp, selectWindow, setBrowserLogLevel, setContext, setCursorPosition, setExtensionJs, setMouseSpeed, setSpeed, setTimeout, shiftKeyDown, shiftKeyUp, showContextualBanner, showContextualBanner, shutDownSeleniumServer, start, start, stop, submit, type, typeKeys, uncheck, useXpathLibrary, waitForFrameToLoad, waitForPopUp, windowFocus, windowMaximize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.thoughtworks.selenium.Selenium |
---|
addCustomRequestHeader, addLocationStrategy, addScript, addSelection, allowNativeXpath, altKeyDown, altKeyUp, answerOnNextPrompt, assignId, attachFile, captureEntirePageScreenshot, captureEntirePageScreenshotToString, captureNetworkTraffic, captureScreenshot, captureScreenshotToString, check, chooseCancelOnNextConfirmation, chooseOkOnNextConfirmation, click, clickAt, close, contextMenu, contextMenuAt, controlKeyDown, controlKeyUp, createCookie, deleteAllVisibleCookies, deleteCookie, deselectPopUp, doubleClick, doubleClickAt, dragAndDrop, dragAndDropToObject, dragdrop, fireEvent, focus, getAlert, getAllButtons, getAllFields, getAllLinks, getAllWindowIds, getAllWindowNames, getAllWindowTitles, getAttribute, getAttributeFromAllWindows, getBodyText, getConfirmation, getCookie, getCookieByName, getCssCount, getCursorPosition, getElementHeight, getElementIndex, getElementPositionLeft, getElementPositionTop, getElementWidth, getExpression, getHtmlSource, getLocation, getLog, getMouseSpeed, getPrompt, getSelectedId, getSelectedIds, getSelectedIndex, getSelectedIndexes, getSelectedLabel, getSelectedLabels, getSelectedValue, getSelectedValues, getSelectOptions, getSpeed, getTable, getText, getTitle, getValue, getWhetherThisFrameMatchFrameExpression, getWhetherThisWindowMatchWindowExpression, getXpathCount, goBack, highlight, ignoreAttributesWithoutValue, isAlertPresent, isChecked, isConfirmationPresent, isCookiePresent, isEditable, isElementPresent, isOrdered, isPromptPresent, isSomethingSelected, isTextPresent, isVisible, keyDown, keyDownNative, keyPressNative, keyUp, keyUpNative, metaKeyDown, metaKeyUp, mouseDown, mouseDownAt, mouseDownRight, mouseDownRightAt, mouseMove, mouseMoveAt, mouseOut, mouseOver, mouseUp, mouseUpAt, mouseUpRight, mouseUpRightAt, open, openWindow, refresh, removeAllSelections, removeScript, removeSelection, retrieveLastRemoteControlLogs, rollup, runScript, select, selectFrame, selectPopUp, selectWindow, setBrowserLogLevel, setContext, setCursorPosition, setExtensionJs, setMouseSpeed, setSpeed, setTimeout, shiftKeyDown, shiftKeyUp, showContextualBanner, showContextualBanner, shutDownSeleniumServer, start, start, stop, submit, type, typeKeys, uncheck, useXpathLibrary, waitForFrameToLoad, waitForPopUp, windowFocus, windowMaximize |
Field Detail |
---|
public static final String WIKI_CONTENT_XPATH
public static final String DOWN_KEY
public static final String UP_KEY
Method Detail |
---|
public com.atlassian.selenium.Browser getBrowser()
getBrowser
in interface com.atlassian.selenium.SeleniumClient
getBrowser
in class com.atlassian.selenium.SingleBrowserSeleniumClient
public static ConfluenceSeleniumClient getInstance()
public void setScriptsFinishedPluginExpected(boolean expected)
public double getBrowserVersion()
public void selectTopFrame()
public void cleanUp()
public void open(String url, long timeoutMillis)
open
in interface com.atlassian.selenium.SeleniumClient
open
in class com.atlassian.selenium.SingleBrowserSeleniumClient
public void openAbsoluteURL(String url, long timeoutMillis)
public void openAbsoluteURL(String url)
public void waitForScriptsToLoad()
public void waitForPageToLoad(long timeoutMillis)
waitForPageToLoad
in interface com.atlassian.selenium.SeleniumClient
waitForPageToLoad
in class com.atlassian.selenium.SingleBrowserSeleniumClient
public void waitForPageToLoad(String timeout)
SeleniumSetupTest.SCRIPTS_FINISHED_PLUGIN
being enabled (which is done during setUp).
waitForPageToLoad
in interface com.thoughtworks.selenium.Selenium
waitForPageToLoad
in class com.thoughtworks.selenium.DefaultSelenium
public void waitForCondition(String javascript, String timeoutMillis)
DefaultSelenium.waitForCondition(String, String)
does. Use waitForFunction(String, String)
for executing more than one statement.
waitForCondition
in interface com.thoughtworks.selenium.Selenium
waitForCondition
in class com.thoughtworks.selenium.DefaultSelenium
public void waitForFunction(String javascript, String timeoutMillis)
com.thoughtworks.selenium.SeleniumException
- a wrapped exception from selenium which indicates the condition that failed to run.public void waitForFunction(String javascript)
public void waitForJQueryElementSelector(String selector)
selector
- jQuery element selectorpublic void waitForJQueryElementSelector(String selector, long timeoutMillis)
selector
- jQuery element selectortimeoutMillis
- time to wait for the selector to find somethingpublic void waitForJQueryElementSelectorCount(String selector, int count)
selector
- jQuery element selectorcount
- the number of times the selector should be foundpublic int getJQueryElementSelectorHeight(String selector)
selector
- jQuery element selectorpublic void waitForJqueryEventTriggered(String eventName, String selector)
eventName
- The name of the event to listen forselector
- The selector used for bindingpublic boolean isJQueryElementSelectorPresent(String selector)
public boolean hasSelectorWithText(String selector, String text)
public void waitForNoJQueryElementSelector(String selector)
public boolean getEvalAsBoolean(String javascript)
public int getEvalAsInteger(String javascript)
public String getEval(String javascript)
DefaultSelenium.getEval(String)
does. Use getEvalFunction(String)
for
executing more than one statement.
getEval
in interface com.thoughtworks.selenium.Selenium
getEval
in class com.thoughtworks.selenium.DefaultSelenium
public String getEvalFunction(String function)
function
- a javascript function body including the return statementpublic String getEvalFunction(String... functionLines)
getEvalFunction(String)
which joins together its arguments with newlines.
public List<String> getEvalListFunction(String... functionLines)
getEvalFunction(String...)
which executes a JS function which returns a list,
joins the result on the client side using commas, then splits it back into a list to return.
public void typeInElementWithId(String elementId, String text)
public void typeWithLastCharFullKeyEvents(String locator, String text)
public void waitUntilRemoved(String selector)
public void waitUntilHiddenById(String elementId)
public void waitUntilVisible(String selector)
public void waitUntilVisibleById(String elementId)
public void waitUntilFocused(String elementId)
public void pressBackspace(String elementLocator)
public void pressEnter(String elementLocator, boolean waitForPageToLoad)
public void pressTab(String elementLocator)
public void pressEscape(String elementLocator)
public void pressCtrlAndKey(String locator, String keySequence)
public void pressShiftAndKey(String locator, String keySequence)
public void pressCtrlAltAndKey(String locator, String keySequence)
public void pressCtrlShiftAndKey(String locator, String keySequence)
public String getContextPath()
public String getBaseUrl()
public boolean isIE6Mode()
public void check(String name, String value)
check
in interface com.atlassian.selenium.SeleniumClient
check
in class com.atlassian.selenium.SingleBrowserSeleniumClient
public void click(String locator, long timeoutMillis)
click
in interface com.atlassian.selenium.SeleniumClient
click
in class com.atlassian.selenium.SingleBrowserSeleniumClient
public void click(String locator, boolean waitForPageToLoad)
click
in interface com.atlassian.selenium.SeleniumClient
click
in class com.atlassian.selenium.SingleBrowserSeleniumClient
public void clickLinkWithTextInWikiContent(String text, boolean waitForPageToLoad)
public void submit(String form, long timeoutMillis)
submit
in interface com.atlassian.selenium.SeleniumClient
submit
in class com.atlassian.selenium.SingleBrowserSeleniumClient
public void submit(String form, boolean waitForPageToLoad)
submit
in interface com.atlassian.selenium.SeleniumClient
submit
in class com.atlassian.selenium.SingleBrowserSeleniumClient
public void submit(String form, boolean waitForPageToLoad, boolean onlyFireEvent)
public void keyPressOnly(String locator, String key)
public void pressCtrlAndKeyDownOnly(String locator, String keySequence)
public String toHexColor(String colorText)
public String getMetadata(String key)
public long getMetadataLong(String key)
public boolean getMetadataBoolean(String key)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |