com.atlassian.confluence.selenium.client
Class ConfluenceSeleniumClient

java.lang.Object
  extended by com.thoughtworks.selenium.DefaultSelenium
      extended by com.atlassian.selenium.SeleniumClient
          extended by com.atlassian.confluence.selenium.client.ConfluenceSeleniumClient
All Implemented Interfaces:
com.thoughtworks.selenium.Selenium

public class ConfluenceSeleniumClient
extends com.atlassian.selenium.SeleniumClient

Extends the Atlassian Selenium client to provide Confluence specific methods.


Nested Class Summary
static class ConfluenceSeleniumClient.Browser
           
 
Field Summary
 
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)
           
 void clickButton(java.lang.String buttonText, boolean waitForPageToLoad)
           
 void clickButtonWithName(java.lang.String buttonName, boolean waitForPageToLoad)
           
 void clickElementWithClass(java.lang.String className)
           
 void clickElementWithTitle(java.lang.String title)
           
 void clickElementWithXpath(java.lang.String xpath)
           
 void clickLinkWithText(java.lang.String text, boolean waitForPageToLoad)
           
 ConfluenceSeleniumClient.Browser getBrowser()
           
 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.
 java.lang.String getEvalFunction(java.lang.String function)
          Runs the provided Javascript function in the context of the test page.
static ConfluenceSeleniumClient getInstance()
           
 void open(java.lang.String url, long timeoutMillis)
          Overriden to append the context path infront of the url.
 void pressCtrlAndKey(java.lang.String locator, java.lang.String keySequence)
          Presses the control key, followed by the key(s) passed in.
 void pressEnter(java.lang.String elementLocator, boolean waitForPageToLoad)
          Simulates pressing the enter key in the element.
 void typeInElementWithName(java.lang.String elementName, java.lang.String text)
           
 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 waitForPageToLoad()
          Waits for the page to load with the default timeout configured in ConfluenceSeleniumConfiguration.
 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
click, click, keyPress, open, selectOption, submit, submit, typeWithFullKeyEvents, typeWithFullKeyEvents, waitForCondition, waitForCondition, waitForPageToLoad
 
Methods inherited from class com.thoughtworks.selenium.DefaultSelenium
addLocationStrategy, addSelection, allowNativeXpath, altKeyDown, altKeyUp, answerOnNextPrompt, assignId, captureScreenshot, check, chooseCancelOnNextConfirmation, chooseOkOnNextConfirmation, click, clickAt, close, controlKeyDown, controlKeyUp, createCookie, deleteCookie, doubleClick, doubleClickAt, dragAndDrop, dragAndDropToObject, dragdrop, fireEvent, getAlert, getAllButtons, getAllFields, getAllLinks, getAllWindowIds, getAllWindowNames, getAllWindowTitles, getAttribute, getAttributeFromAllWindows, getBodyText, getConfirmation, getCookie, 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, isAlertPresent, isChecked, isConfirmationPresent, isEditable, isElementPresent, isOrdered, isPromptPresent, isSomethingSelected, isTextPresent, isVisible, keyDown, keyUp, metaKeyDown, metaKeyUp, mouseDown, mouseDownAt, mouseMove, mouseMoveAt, mouseOut, mouseOver, mouseUp, mouseUpAt, openWindow, refresh, removeAllSelections, removeSelection, runScript, select, selectFrame, selectWindow, setBrowserLogLevel, setContext, setCursorPosition, setMouseSpeed, setSpeed, setTimeout, shiftKeyDown, shiftKeyUp, start, stop, submit, type, typeKeys, uncheck, waitForFrameToLoad, waitForPageToLoad, waitForPopUp, windowFocus, windowMaximize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ConfluenceSeleniumClient getInstance()

getBrowser

public ConfluenceSeleniumClient.Browser getBrowser()

open

public void open(java.lang.String url,
                 long timeoutMillis)
Overriden to append the context path infront of the url.

Overrides:
open in class com.atlassian.selenium.SeleniumClient

waitForCondition

public 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. Use waitForFunction(String, String) for executing more than one statement.

Specified by:
waitForCondition in interface com.thoughtworks.selenium.Selenium
Overrides:
waitForCondition in class com.thoughtworks.selenium.DefaultSelenium

waitForFunction

public void waitForFunction(java.lang.String javascript,
                            java.lang.String timeoutMillis)
Runs the provided Javascript function in the context of the test page. The function should contain a return statement to evaluate.


waitForFunction

public void waitForFunction(java.lang.String javascript)

getEval

public 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. Use getEvalFunction(String) for executing more than one statement.

Specified by:
getEval in interface com.thoughtworks.selenium.Selenium
Overrides:
getEval in class com.thoughtworks.selenium.DefaultSelenium

getEvalFunction

public java.lang.String getEvalFunction(java.lang.String function)
Runs the provided Javascript function in the context of the test page. The function should contain a return statement to evaluate and return.

Parameters:
function - a javascript function body including the return statement

clickLinkWithText

public void clickLinkWithText(java.lang.String text,
                              boolean waitForPageToLoad)

clickButton

public void clickButton(java.lang.String buttonText,
                        boolean waitForPageToLoad)

clickButtonWithName

public void clickButtonWithName(java.lang.String buttonName,
                                boolean waitForPageToLoad)

waitForPageToLoad

public void waitForPageToLoad()
Waits for the page to load with the default timeout configured in ConfluenceSeleniumConfiguration.


clickElementWithTitle

public void clickElementWithTitle(java.lang.String title)

clickElementWithClass

public void clickElementWithClass(java.lang.String className)

clickElementWithXpath

public void clickElementWithXpath(java.lang.String xpath)

typeInElementWithName

public void typeInElementWithName(java.lang.String elementName,
                                  java.lang.String text)

waitUntilHidden

public void waitUntilHidden(java.lang.String elementId)
Waits until the element with the supplied id is hidden or until the default timeout expires. Elements hidden via jQuery or via the addition of "hidden" class are found.


waitUntilVisible

public void waitUntilVisible(java.lang.String elementId)
Waits until the element with the supplied id is visible or until the default timeout expires.


pressEnter

public void pressEnter(java.lang.String elementLocator,
                       boolean waitForPageToLoad)
Simulates pressing the enter key in the element. Note, this method does not work for submitting forms.


pressCtrlAndKey

public void pressCtrlAndKey(java.lang.String locator,
                            java.lang.String keySequence)
Presses the control key, followed by the key(s) passed in.


check

public void check(java.lang.String name,
                  java.lang.String value)

getContextPath

public java.lang.String getContextPath()
Context path, including initial slash, eg "/confluence". Empty string if applicable.



Copyright © 2003-2008 Atlassian Pty Ltd. All Rights Reserved.