|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.testng.Assert
org.apache.tapestry.test.AbstractIntegrationTestSuite
public class AbstractIntegrationTestSuite
A base class for creating integration tests. Ths encapsulates starting up an in-process copy of Jetty, and in-process
copy of SeleniumServer, and a Selenium client.
Selenium interface, and delegates all those methods to the DefaultSelenium
instance it creates. It also extends the normal exception reporting for any failed command or query to produce a more
detailed report to the main console.
JettyRunner| Field Summary | |
|---|---|
static String |
BASE_URL
|
static String |
DEFAULT_WEB_APP_ROOT
Default directory containing the web application to be tested (this conforms to Maven's default folder). |
static String |
DEFAULT_WEB_BROWSER_COMMAND
Default browser in which to run tests - firefox |
static int |
JETTY_PORT
The port on which the internal copy of Jetty is executed. |
static String |
PAGE_LOAD_TIMEOUT
15 seconds |
static String |
SUBMIT
|
| Constructor Summary | |
|---|---|
|
AbstractIntegrationTestSuite()
Initializes the suite using DEFAULT_WEB_APP_ROOT. |
protected |
AbstractIntegrationTestSuite(String webAppRoot)
|
protected |
AbstractIntegrationTestSuite(String webAppRoot,
String browserCommand)
|
| Method Summary | |
|---|---|
void |
addLocationStrategy(String strategyName,
String functionDefinition)
|
void |
addSelection(String locator,
String optionLocator)
|
void |
allowNativeXpath(String allow)
|
void |
altKeyDown()
|
void |
altKeyUp()
|
void |
answerOnNextPrompt(String answer)
|
protected void |
assertAttribute(String locator,
String expected)
Used when the locator identifies an attribute, not an element. |
protected void |
assertAttributeSeries(String idFormat,
int startIndex,
String... values)
|
protected void |
assertFieldValue(String locator,
String expected)
|
protected void |
assertFieldValueSeries(String idFormat,
int startIndex,
String... values)
|
protected void |
assertSourcePresent(String... expected)
|
protected void |
assertText(String locator,
String expected)
Asserts the text of an element, identified by the locator. |
protected void |
assertTextPresent(String... text)
|
protected void |
assertTextSeries(String idFormat,
int startIndex,
String... values)
|
void |
assignId(String locator,
String identifier)
|
void |
captureScreenshot(String filename)
|
void |
check(String locator)
|
void |
chooseCancelOnNextConfirmation()
|
void |
chooseOkOnNextConfirmation()
|
void |
cleanup()
|
void |
click(String locator)
|
protected void |
clickAndWait(String link)
|
void |
clickAt(String locator,
String coordString)
|
void |
close()
|
void |
controlKeyDown()
|
void |
controlKeyUp()
|
void |
createCookie(String nameValuePair,
String optionsString)
|
void |
deleteCookie(String name,
String path)
|
void |
doubleClick(String locator)
|
void |
doubleClickAt(String locator,
String coordString)
|
void |
dragAndDrop(String locator,
String movementsString)
|
void |
dragAndDropToObject(String locatorOfObjectToBeDragged,
String locatorOfDragDestinationObject)
|
void |
dragdrop(String locator,
String movementsString)
|
void |
fireEvent(String locator,
String eventName)
|
String |
getAlert()
|
String[] |
getAllButtons()
|
String[] |
getAllFields()
|
String[] |
getAllLinks()
|
String[] |
getAllWindowIds()
|
String[] |
getAllWindowNames()
|
String[] |
getAllWindowTitles()
|
String |
getAttribute(String attributeLocator)
|
String[] |
getAttributeFromAllWindows(String attributeName)
|
String |
getBodyText()
|
String |
getConfirmation()
|
String |
getCookie()
|
Number |
getCursorPosition(String locator)
|
Number |
getElementHeight(String locator)
|
Number |
getElementIndex(String locator)
|
Number |
getElementPositionLeft(String locator)
|
Number |
getElementPositionTop(String locator)
|
Number |
getElementWidth(String locator)
|
String |
getEval(String script)
|
String |
getExpression(String expression)
|
String |
getHtmlSource()
|
String |
getLocation()
|
Number |
getMouseSpeed()
|
String |
getPrompt()
|
String |
getSelectedId(String selectLocator)
|
String[] |
getSelectedIds(String selectLocator)
|
String |
getSelectedIndex(String selectLocator)
|
String[] |
getSelectedIndexes(String selectLocator)
|
String |
getSelectedLabel(String selectLocator)
|
String[] |
getSelectedLabels(String selectLocator)
|
String |
getSelectedValue(String selectLocator)
|
String[] |
getSelectedValues(String selectLocator)
|
String[] |
getSelectOptions(String selectLocator)
|
void |
getSpeed()
|
String |
getTable(String tableCellAddress)
|
String |
getText(String locator)
|
String |
getTitle()
|
String |
getValue(String locator)
|
boolean |
getWhetherThisFrameMatchFrameExpression(String currentFrameString,
String target)
|
boolean |
getWhetherThisWindowMatchWindowExpression(String currentWindowString,
String target)
|
Number |
getXpathCount(String xpath)
|
void |
goBack()
|
void |
highlight(String locator)
|
boolean |
isAlertPresent()
|
boolean |
isChecked(String locator)
|
boolean |
isConfirmationPresent()
|
boolean |
isEditable(String locator)
|
boolean |
isElementPresent(String locator)
|
boolean |
isOrdered(String locator1,
String locator2)
|
boolean |
isPromptPresent()
|
boolean |
isSomethingSelected(String selectLocator)
|
boolean |
isTextPresent(String pattern)
|
boolean |
isVisible(String locator)
|
void |
keyDown(String locator,
String keycode)
|
void |
keyPress(String locator,
String keycode)
|
void |
keyUp(String locator,
String keycode)
|
void |
metaKeyDown()
|
void |
metaKeyUp()
|
void |
mouseDown(String locator)
|
void |
mouseDownAt(String locator,
String coordString)
|
void |
mouseMove(String locator)
|
void |
mouseMoveAt(String locator,
String coordString)
|
void |
mouseOut(String locator)
|
void |
mouseOver(String locator)
|
void |
mouseUp(String locator)
|
void |
mouseUpAt(String locator,
String coordString)
|
void |
open(String url)
|
void |
openWindow(String url,
String windowID)
|
void |
refresh()
|
void |
removeAllSelections(String locator)
|
void |
removeSelection(String locator,
String optionLocator)
|
void |
runScript(String script)
|
void |
select(String selectLocator,
String optionLocator)
|
void |
selectFrame(String locator)
|
void |
selectWindow(String windowID)
|
void |
setBrowserLogLevel(String logLevel)
|
void |
setContext(String context)
|
void |
setCursorPosition(String locator,
String position)
|
void |
setMouseSpeed(String pixels)
|
void |
setSpeed(String value)
|
void |
setTimeout(String timeout)
|
void |
setup()
|
void |
shiftKeyDown()
|
void |
shiftKeyUp()
|
void |
start()
|
protected void |
start(String... linkText)
Used to start a typical test, by opening to the base URL and clicking through a series of links. |
void |
stop()
|
void |
submit(String formLocator)
|
void |
type(String locator,
String value)
|
void |
typeKeys(String locator,
String value)
|
void |
uncheck(String locator)
|
void |
waitForCondition(String script,
String timeout)
|
void |
waitForFrameToLoad(String frameAddress,
String timeout)
|
void |
waitForPageToLoad()
Waits the default time for the page to load. |
void |
waitForPageToLoad(String timeout)
|
void |
waitForPopUp(String windowID,
String timeout)
|
void |
windowFocus()
|
void |
windowMaximize()
|
| Methods inherited from class org.testng.Assert |
|---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEqualsNoOrder, assertEqualsNoOrder, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, fail |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_WEB_APP_ROOT
public static final String DEFAULT_WEB_BROWSER_COMMAND
public static final String PAGE_LOAD_TIMEOUT
public static final int JETTY_PORT
public static final String BASE_URL
public static final String SUBMIT
| Constructor Detail |
|---|
public AbstractIntegrationTestSuite()
DEFAULT_WEB_APP_ROOT.
protected AbstractIntegrationTestSuite(String webAppRoot)
webAppRoot - the directory containing the web application to be tested.
protected AbstractIntegrationTestSuite(String webAppRoot,
String browserCommand)
webAppRoot - web application root (default src/main/webapp)browserCommand - browser command to pass to selenium. Default is *firefox, syntax for custom browsers is
*custom <path_to_browser>, e.g. *custom /usr/lib/mozilla-firefox/firefox| Method Detail |
|---|
protected final void assertSourcePresent(String... expected)
protected final void assertAttribute(String locator,
String expected)
locator - identifies the attribute whose value is to be assertedexpected - expected value for the attribute
protected final void assertText(String locator,
String expected)
locator - identifies the element whose text value is to be assertedexpected - expected value for the element's textprotected final void assertTextPresent(String... text)
protected final void assertFieldValue(String locator,
String expected)
protected final void clickAndWait(String link)
protected final void assertTextSeries(String idFormat,
int startIndex,
String... values)
protected final void assertAttributeSeries(String idFormat,
int startIndex,
String... values)
protected final void assertFieldValueSeries(String idFormat,
int startIndex,
String... values)
public void cleanup()
throws Exception
Exception
public void setup()
throws Exception
Exception
public void addSelection(String locator,
String optionLocator)
addSelection in interface com.thoughtworks.selenium.Seleniumpublic void answerOnNextPrompt(String answer)
answerOnNextPrompt in interface com.thoughtworks.selenium.Seleniumpublic void check(String locator)
check in interface com.thoughtworks.selenium.Seleniumpublic void chooseCancelOnNextConfirmation()
chooseCancelOnNextConfirmation in interface com.thoughtworks.selenium.Seleniumpublic void chooseOkOnNextConfirmation()
chooseOkOnNextConfirmation in interface com.thoughtworks.selenium.Seleniumpublic void click(String locator)
click in interface com.thoughtworks.selenium.Seleniumpublic void doubleClick(String locator)
doubleClick in interface com.thoughtworks.selenium.Selenium
public void clickAt(String locator,
String coordString)
clickAt in interface com.thoughtworks.selenium.Selenium
public void doubleClickAt(String locator,
String coordString)
doubleClickAt in interface com.thoughtworks.selenium.Seleniumpublic void close()
close in interface com.thoughtworks.selenium.Selenium
public void fireEvent(String locator,
String eventName)
fireEvent in interface com.thoughtworks.selenium.Seleniumpublic String getAlert()
getAlert in interface com.thoughtworks.selenium.Seleniumpublic String[] getAllButtons()
getAllButtons in interface com.thoughtworks.selenium.Seleniumpublic String[] getAllFields()
getAllFields in interface com.thoughtworks.selenium.Seleniumpublic String[] getAttributeFromAllWindows(String attributeName)
getAttributeFromAllWindows in interface com.thoughtworks.selenium.Selenium
public void dragdrop(String locator,
String movementsString)
dragdrop in interface com.thoughtworks.selenium.Seleniumpublic void setMouseSpeed(String pixels)
setMouseSpeed in interface com.thoughtworks.selenium.Seleniumpublic Number getMouseSpeed()
getMouseSpeed in interface com.thoughtworks.selenium.Selenium
public void dragAndDrop(String locator,
String movementsString)
dragAndDrop in interface com.thoughtworks.selenium.Selenium
public void dragAndDropToObject(String locatorOfObjectToBeDragged,
String locatorOfDragDestinationObject)
dragAndDropToObject in interface com.thoughtworks.selenium.Seleniumpublic void windowFocus()
windowFocus in interface com.thoughtworks.selenium.Seleniumpublic void windowMaximize()
windowMaximize in interface com.thoughtworks.selenium.Seleniumpublic String[] getAllWindowIds()
getAllWindowIds in interface com.thoughtworks.selenium.Seleniumpublic String[] getAllWindowNames()
getAllWindowNames in interface com.thoughtworks.selenium.Seleniumpublic String[] getAllWindowTitles()
getAllWindowTitles in interface com.thoughtworks.selenium.Seleniumpublic String[] getAllLinks()
getAllLinks in interface com.thoughtworks.selenium.Seleniumpublic String getAttribute(String attributeLocator)
getAttribute in interface com.thoughtworks.selenium.Seleniumpublic String getBodyText()
getBodyText in interface com.thoughtworks.selenium.Seleniumpublic String getConfirmation()
getConfirmation in interface com.thoughtworks.selenium.Seleniumpublic Number getCursorPosition(String locator)
getCursorPosition in interface com.thoughtworks.selenium.Seleniumpublic String getEval(String script)
getEval in interface com.thoughtworks.selenium.Seleniumpublic String getExpression(String expression)
getExpression in interface com.thoughtworks.selenium.Seleniumpublic Number getXpathCount(String xpath)
getXpathCount in interface com.thoughtworks.selenium.Selenium
public void assignId(String locator,
String identifier)
assignId in interface com.thoughtworks.selenium.Seleniumpublic void allowNativeXpath(String allow)
allowNativeXpath in interface com.thoughtworks.selenium.Seleniumpublic String getHtmlSource()
getHtmlSource in interface com.thoughtworks.selenium.Seleniumpublic String getLocation()
getLocation in interface com.thoughtworks.selenium.Seleniumpublic String getPrompt()
getPrompt in interface com.thoughtworks.selenium.Seleniumpublic String getSelectedId(String selectLocator)
getSelectedId in interface com.thoughtworks.selenium.Seleniumpublic String[] getSelectedIds(String selectLocator)
getSelectedIds in interface com.thoughtworks.selenium.Seleniumpublic String getSelectedIndex(String selectLocator)
getSelectedIndex in interface com.thoughtworks.selenium.Seleniumpublic String[] getSelectedIndexes(String selectLocator)
getSelectedIndexes in interface com.thoughtworks.selenium.Seleniumpublic String getSelectedLabel(String selectLocator)
getSelectedLabel in interface com.thoughtworks.selenium.Seleniumpublic String[] getSelectedLabels(String selectLocator)
getSelectedLabels in interface com.thoughtworks.selenium.Seleniumpublic String getSelectedValue(String selectLocator)
getSelectedValue in interface com.thoughtworks.selenium.Seleniumpublic String[] getSelectedValues(String selectLocator)
getSelectedValues in interface com.thoughtworks.selenium.Seleniumpublic String[] getSelectOptions(String selectLocator)
getSelectOptions in interface com.thoughtworks.selenium.Seleniumpublic String getTable(String tableCellAddress)
getTable in interface com.thoughtworks.selenium.Seleniumpublic String getText(String locator)
getText in interface com.thoughtworks.selenium.Seleniumpublic void highlight(String locator)
highlight in interface com.thoughtworks.selenium.Seleniumpublic String getTitle()
getTitle in interface com.thoughtworks.selenium.Seleniumpublic