|
||||||||||
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.SeleniumClient com.atlassian.confluence.selenium.client.ConfluenceSeleniumClient
public class ConfluenceSeleniumClient
Extends the Atlassian Selenium client to provide Confluence specific methods.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.atlassian.selenium.SeleniumClient |
---|
com.atlassian.selenium.SeleniumClient.Browser |
Field Summary | |
---|---|
static java.lang.String |
DOWN_KEY
|
static java.lang.String |
UP_KEY
|
static java.lang.String |
WIKI_CONTENT_XPATH
|
Fields inherited from class com.atlassian.selenium.SeleniumClient |
---|
ACTION_WAIT, PAGE_LOAD_WAIT |
Fields inherited from class com.thoughtworks.selenium.DefaultSelenium |
---|
commandProcessor |
Method Summary | |
---|---|
void |
check(java.lang.String name,
java.lang.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(java.lang.String locator,
boolean waitForPageToLoad)
|
void |
click(java.lang.String locator,
long timeoutMillis)
|
void |
clickLinkWithTextInWikiContent(java.lang.String text,
boolean waitForPageToLoad)
Clicks a link in the wiki content with the exact text given. |
java.lang.String |
getBaseUrl()
|
double |
getBrowserVersion()
|
java.lang.String |
getContextPath()
Context path, including initial slash, eg "/confluence". |
java.lang.String |
getEval(java.lang.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(java.lang.String javascript)
|
java.lang.String |
getEvalFunction(java.lang.String... functionLines)
Varargs version of getEvalFunction(String) which joins together its arguments with newlines. |
java.lang.String |
getEvalFunction(java.lang.String function)
Runs the provided Javascript function in the context of the test page. |
java.util.List<java.lang.String> |
getEvalListFunction(java.lang.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()
|
boolean |
isIE6Mode()
|
boolean |
isJQueryElementSelectorPresent(java.lang.String selector)
Returns true if the given JQuery selector returns at least one result. |
void |
keyPressOnly(java.lang.String locator,
java.lang.String key)
|
void |
open(java.lang.String url,
long timeoutMillis)
Overridden to append the context path in front of the url. |
void |
pressBackspace(java.lang.String elementLocator)
Simulates pressing the backspace key in the element. |
void |
pressCtrlAltAndKey(java.lang.String locator,
java.lang.String keySequence)
Presses the control and alt keys, followed by the key(s) passed in |
void |
pressCtrlAndKey(java.lang.String locator,
java.lang.String keySequence)
Presses the control key, followed by the key(s) passed in. |
void |
pressCtrlAndKeyDownOnly(java.lang.String locator,
java.lang.String keySequence)
Use this method for key presses that will load a new page. |
void |
pressCtrlShiftAndKey(java.lang.String locator,
java.lang.String keySequence)
Presses the control+shift keys, followed by the key(s) passed in. |
void |
pressEnter(java.lang.String elementLocator,
boolean waitForPageToLoad)
Simulates pressing the enter key in the element. |
void |
pressEscape(java.lang.String elementLocator)
Simulates pressing the Esc key in the element. |
void |
pressShiftAndKey(java.lang.String locator,
java.lang.String keySequence)
|
void |
pressTab(java.lang.String elementLocator)
Simulates pressing the tab key in the element. |
void |
setScriptsFinishedPluginExpected(boolean expected)
|
void |
submit(java.lang.String form,
boolean waitForPageToLoad)
|
void |
submit(java.lang.String form,
long timeoutMillis)
|
void |
typeInElementWithId(java.lang.String elementId,
java.lang.String text)
|
void |
typeWithLastCharFullKeyEvents(java.lang.String locator,
java.lang.String text)
Types text in the field specified by the locator. |
void |
waitForCondition(java.lang.String javascript,
java.lang.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(java.lang.String javascript)
|
void |
waitForFunction(java.lang.String javascript,
java.lang.String timeoutMillis)
Runs the provided Javascript function in the context of the test page. |
void |
waitForJQueryElementSelector(java.lang.String selector)
Blocks until an element is found with the specified jQuery selector (or until the action timeout is reached). |
void |
waitForNoJQueryElementSelector(java.lang.String selector)
|
void |
waitForPageToLoad(long timeoutMillis)
|
void |
waitForPageToLoad(java.lang.String timeout)
Override to make sure all Javascript has finished loading before returning. |
void |
waitForScriptsToLoad()
|
void |
waitUntilHidden(java.lang.String elementId)
Waits until the element with the supplied id is hidden or until the default timeout expires. |
void |
waitUntilVisible(java.lang.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.SeleniumClient |
---|
clickAndWaitForAjaxWithJquery, clickAndWaitForAjaxWithJquery, clickButton, clickButtonAndWaitForAjaxWithJquery, clickButtonWithName, clickButtonWithNameAndWaitForAjaxWithJquery, clickElementWithClass, clickElementWithClassAndWaitForAjaxWithJquery, clickElementWithCss, clickElementWithCssAndWaitForAjaxWithJquery, clickElementWithTitle, clickElementWithTitleAndWaitForAjaxWithJquery, clickElementWithXpath, clickElementWithXpathAndWaitForAjaxWithJquery, clickLinkWithText, getBrowser, hasJquery, keyPress, open, openNoWait, selectOption, selectOptionAndWaitForAjaxWithJquery, start, typeInElementWithCss, typeInElementWithName, typeWithFullKeyEvents, typeWithFullKeyEvents, waitForAjaxWithJquery, waitForAjaxWithJquery, waitForCondition, waitForCondition, waitForPageToLoad |
Methods inherited from class com.thoughtworks.selenium.DefaultSelenium |
---|
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, getCursorPosition, getElementHeight, getElementIndex, getElementPositionLeft, getElementPositionTop, getElementWidth, getExpression, getHtmlSource, getLocation, 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, 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 |
Field Detail |
---|
public static final java.lang.String WIKI_CONTENT_XPATH
public static final java.lang.String DOWN_KEY
public static final java.lang.String UP_KEY
Method Detail |
---|
public static ConfluenceSeleniumClient getInstance()
public void setScriptsFinishedPluginExpected(boolean expected)
public double getBrowserVersion()
public void cleanUp()
public void open(java.lang.String url, long timeoutMillis)
open
in class com.atlassian.selenium.SeleniumClient
public void waitForScriptsToLoad()
public void waitForPageToLoad(long timeoutMillis)
waitForPageToLoad
in class com.atlassian.selenium.SeleniumClient
public void waitForPageToLoad(java.lang.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(java.lang.String javascript, java.lang.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(java.lang.String javascript, java.lang.String timeoutMillis)
public void waitForFunction(java.lang.String javascript)
public void waitForJQueryElementSelector(java.lang.String selector)
selector
- jQuery element selectorpublic boolean isJQueryElementSelectorPresent(java.lang.String selector)
public void waitForNoJQueryElementSelector(java.lang.String selector)
public boolean getEvalAsBoolean(java.lang.String javascript)
public java.lang.String getEval(java.lang.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 java.lang.String getEvalFunction(java.lang.String function)
function
- a javascript function body including the return statementpublic java.lang.String getEvalFunction(java.lang.String... functionLines)
getEvalFunction(String)
which joins together its arguments with newlines.
public java.util.List<java.lang.String> getEvalListFunction(java.lang.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(java.lang.String elementId, java.lang.String text)
public void typeWithLastCharFullKeyEvents(java.lang.String locator, java.lang.String text)
public void waitUntilHidden(java.lang.String elementId)
public void waitUntilVisible(java.lang.String elementId)
public void pressBackspace(java.lang.String elementLocator)
public void pressEnter(java.lang.String elementLocator, boolean waitForPageToLoad)
public void pressTab(java.lang.String elementLocator)
public void pressEscape(java.lang.String elementLocator)
public void pressCtrlAndKey(java.lang.String locator, java.lang.String keySequence)
public void pressShiftAndKey(java.lang.String locator, java.lang.String keySequence)
public void pressCtrlAltAndKey(java.lang.String locator, java.lang.String keySequence)
public void pressCtrlShiftAndKey(java.lang.String locator, java.lang.String keySequence)
public java.lang.String getContextPath()
public java.lang.String getBaseUrl()
public boolean isIE6Mode()
public void check(java.lang.String name, java.lang.String value)
check
in class com.atlassian.selenium.SeleniumClient
public void click(java.lang.String locator, long timeoutMillis)
click
in class com.atlassian.selenium.SeleniumClient
public void click(java.lang.String locator, boolean waitForPageToLoad)
click
in class com.atlassian.selenium.SeleniumClient
public void clickLinkWithTextInWikiContent(java.lang.String text, boolean waitForPageToLoad)
public void submit(java.lang.String form, long timeoutMillis)
submit
in class com.atlassian.selenium.SeleniumClient
public void submit(java.lang.String form, boolean waitForPageToLoad)
submit
in class com.atlassian.selenium.SeleniumClient
public void keyPressOnly(java.lang.String locator, java.lang.String key)
public void pressCtrlAndKeyDownOnly(java.lang.String locator, java.lang.String keySequence)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |