|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
com.atlassian.crowd.acceptance.utils.CrowdWebTestCase
public class CrowdWebTestCase
A copy of WebTestCase from jwebunit with a protected tester instead of a private tester
Superclass for Junit TestCases which provides web application navigation and JUnit assertions. This class uses and is generated fromWebTester.
| Field Summary | |
|---|---|
protected net.sourceforge.jwebunit.junit.WebTester |
tester
|
| Constructor Summary | |
|---|---|
CrowdWebTestCase()
|
|
CrowdWebTestCase(java.lang.String name)
|
|
| Method Summary | |
|---|---|
void |
addRequestHeader(java.lang.String header,
java.lang.String value)
Adds a request header for all subsequent requests. |
void |
assertButtonNotPresent(java.lang.String buttonId)
Assert that a button with a given id is not present in the current window. |
void |
assertButtonNotPresentWithText(java.lang.String text)
Assert that a button with a given text is not present in the current window. |
void |
assertButtonPresent(java.lang.String buttonId)
Assert that a button with a given id is present in the current window. A button can be the following HTML elements: button input button button |
void |
assertButtonPresentWithText(java.lang.String text)
Assert that a button with a given text is present in the current window. |
void |
assertCheckboxNotPresent(java.lang.String checkboxName)
Assert that a form checkbox with a given name is not present. |
void |
assertCheckboxNotPresent(java.lang.String checkboxName,
java.lang.String checkboxValue)
Assert that a given checkbox is not present. |
void |
assertCheckboxNotSelected(java.lang.String checkBoxName)
Assert that a specific checkbox is not selected. |
void |
assertCheckboxNotSelected(java.lang.String checkBoxName,
java.lang.String checkBoxValue)
Assert that a specific checkbox is not selected. |
void |
assertCheckboxPresent(java.lang.String checkboxName)
Assert that a form checkbox with a given name is present. |
void |
assertCheckboxPresent(java.lang.String checkboxName,
java.lang.String checkboxValue)
Assert that a given checkbox is present. |
void |
assertCheckboxSelected(java.lang.String checkBoxName)
Assert that a specific checkbox is selected. |
void |
assertCheckboxSelected(java.lang.String checkBoxName,
java.lang.String checkBoxValue)
Assert that a specific checkbox is selected. |
void |
assertCookiePresent(java.lang.String cookieName)
Checks to see if a cookie is present in the response. |
void |
assertCookieValueEquals(java.lang.String cookieName,
java.lang.String expectedValue)
Check to see if a cookie has the given value. |
void |
assertCookieValueMatch(java.lang.String cookieName,
java.lang.String regexp)
Check to see if a cookie value match the given regexp. |
void |
assertDownloadedFileEquals(java.net.URL expected)
Download the current page (or file) and compare it with the given file. |
void |
assertElementNotPresent(java.lang.String anID)
Assert that an element with a given id is not present. |
void |
assertElementNotPresentByXPath(java.lang.String xpath)
Assert that an element with a given xpath is not present. |
void |
assertElementPresent(java.lang.String anID)
Assert that an element with a given id is present. |
void |
assertElementPresentByXPath(java.lang.String xpath)
Assert that an element with a given xpath is present. |
void |
assertErrorNotPresent()
Makes sure the page does not contain an error, as when an exception has occurred. |
void |
assertErrorPresent()
Makes sure the page does contain an error, as when an exception has occurred. |
void |
assertErrorPresentWithKey(java.lang.String keyName)
Makes sure the page does contain an error and that it also contains the text of the key. |
void |
assertErrorPresentWithText(java.lang.String text)
Makes sure the page does contain an error and that it also contains the text. |
void |
assertFormElementEmpty(java.lang.String formElementName)
Deprecated. |
void |
assertFormElementEquals(java.lang.String formElementName,
java.lang.String expectedValue)
Deprecated. |
void |
assertFormElementMatch(java.lang.String formElementName,
java.lang.String regexp)
Deprecated. |
void |
assertFormElementNotPresent(java.lang.String formElementName)
Assert that a form input element with a given name is not present. |
void |
assertFormElementPresent(java.lang.String formElementName)
Assert that a form input element with a given name is present. |
void |
assertFormNotPresent()
Assert that there is not a form present. |
void |
assertFormNotPresent(java.lang.String nameOrID)
Assert that there is not a form with the specified name or id present. |
void |
assertFormPresent()
Assert that there is a form present. |
void |
assertFormPresent(java.lang.String nameOrID)
Assert that there is a form with the specified name or id present. |
void |
assertFramePresent(java.lang.String frameNameOrId)
Assert that a frame with the given name or ID is present. |
void |
assertHiddenFieldPresent(java.lang.String formElementName,
java.lang.String expectedValue)
Assert that an input hidden element with name formElementName has the expectedValue
value. |
void |
assertKeyInTable(java.lang.String tableSummaryOrId,
java.lang.String key)
Assert that the value of a given web resource is present in a specific table. |
void |
assertKeyNotInTable(java.lang.String tableSummaryOrId,
java.lang.String key)
Assert that the value of a given web resource is not present in a specific table. |
void |
assertKeyNotPresent(java.lang.String key)
Assert that a web resource's value is not present. |
void |
assertKeyPresent(java.lang.String key)
Assert that a web resource's value is present. |
void |
assertKeyPresent(java.lang.String key,
java.util.List args)
Assert that a web resource's value is present. |
void |
assertKeysInTable(java.lang.String tableSummaryOrId,
java.lang.String[] keys)
Assert that the values of a set of web resources are all present in a specific table. |
void |
assertLinkNotPresent(java.lang.String linkId)
Assert that no link with the given id is present in the response. |
void |
assertLinkNotPresentWithExactText(java.lang.String linkText)
Assert that no link containing the Exact text is present. |
void |
assertLinkNotPresentWithExactText(java.lang.String linkText,
int index)
Assert that no link containing the Exact text is present. |
void |
assertLinkNotPresentWithImage(java.lang.String imageFileName)
Assert that a link containing a specified image is not present. |
void |
assertLinkNotPresentWithText(java.lang.String linkText)
Assert that no link containing the supplied text is present. |
void |
assertLinkNotPresentWithText(java.lang.String linkText,
int index)
Assert that no link containing the supplied text is present. |
void |
assertLinkPresent(java.lang.String linkId)
Assert that a link with a given id is present in the response. |
void |
assertLinkPresentWithExactText(java.lang.String linkText)
Assert that a link containing the Exact text is present. |
void |
assertLinkPresentWithExactText(java.lang.String linkText,
int index)
Assert that a link containing the Exact text is present. |
void |
assertLinkPresentWithImage(java.lang.String imageFileName)
Assert that a link containing a specified image is present. |
void |
assertLinkPresentWithKey(java.lang.String keyName)
Assert that a link containing the text of the key is present. |
void |
assertLinkPresentWithText(java.lang.String linkText)
Assert that a link containing the supplied text is present. |
void |
assertLinkPresentWithText(java.lang.String linkText,
int index)
Assert that a link containing the supplied text is present. |
void |
assertMatch(java.lang.String regexp)
Assert that supplied regexp is matched. |
void |
assertMatchInElement(java.lang.String elementID,
java.lang.String regexp)
Assert that a given element matches a specific regexp. |
void |
assertMatchInTable(java.lang.String tableSummaryNameOrId,
java.lang.String regexp)
Assert that supplied regexp is matched in a specific table. |
void |
assertMatchInTable(java.lang.String tableSummaryOrId,
java.lang.String[] regexp)
Assert that a set of regexp values are all matched in a specific table. |
void |
assertNoMatch(java.lang.String regexp)
Assert that supplied regexp is not present. |
void |
assertNoMatchInElement(java.lang.String elementID,
java.lang.String regexp)
Assert that a given element does not match a specific regexp. |
void |
assertNoMatchInTable(java.lang.String tableSummaryNameOrId,
java.lang.String regexp)
Assert that supplied regexp is not present in a specific table. |
void |
assertNoMatchInTable(java.lang.String tableSummaryNameOrId,
java.lang.String[] regexp)
Assert that none of a set of regexp values are present in a specific table. |
void |
assertRadioOptionNotPresent(java.lang.String name,
java.lang.String radioOption)
Assert that a specific option is not present in a radio group. |
void |
assertRadioOptionNotSelected(java.lang.String name,
java.lang.String radioOption)
Assert that a specific option is not selected in a radio group. |
void |
assertRadioOptionPresent(java.lang.String name,
java.lang.String radioOption)
Assert that a specific option is present in a radio group. |
void |
assertRadioOptionSelected(java.lang.String name,
java.lang.String radioOption)
Assert that a specific option is selected in a radio group. |
void |
assertResetButtonNotPresent()
Assert that no reset button is present in the current form. A reset button can be the following HTML elements: reset input reset button |
void |
assertResetButtonNotPresent(java.lang.String buttonName)
Assert that a reset button with a given name is not present. A reset button can be the following HTML elements: reset input reset button |
void |
assertResetButtonPresent()
Assert that a reset button is present. |
void |
assertResetButtonPresent(java.lang.String buttonName)
Assert that a reset button with a given name is present. A reset button can be the following HTML elements: reset input reset button |
void |
assertSelectedOptionEquals(java.lang.String selectName,
java.lang.String option)
|
void |
assertSelectedOptionMatches(java.lang.String selectName,
java.lang.String regexp)
|
void |
assertSelectedOptionsEqual(java.lang.String selectName,
java.lang.String[] labels)
Assert that the currently selected display label(s) of a select box matches given label(s). |
void |
assertSelectedOptionsMatch(java.lang.String selectName,
java.lang.String[] regexps)
Assert that the currently selected display value(s) of a select box matches a given value(s). |
void |
assertSelectedOptionValueEquals(java.lang.String selectName,
java.lang.String value)
Assert that the currently selected value of a select box matches given value. |
void |
assertSelectedOptionValuesEqual(java.lang.String selectName,
java.lang.String[] values)
Assert that the currently selected value(s) of a select box matches given value(s). |
void |
assertSelectOptionNotPresent(java.lang.String selectName,
java.lang.String optionLabel)
Assert that a specific option is not present in a select box. |
void |
assertSelectOptionPresent(java.lang.String selectName,
java.lang.String optionLabel)
Assert that a specific option is present in a select box (by label). |
void |
assertSelectOptionsEqual(java.lang.String selectName,
java.lang.String[] expectedOptions)
Assert that the display values of a select element's options match a given array of strings. |
void |
assertSelectOptionsNotEqual(java.lang.String selectName,
java.lang.String[] expectedOptions)
Assert that the display values of a select element's options do not match a given array of strings. |
void |
assertSelectOptionsPresent(java.lang.String selectName,
java.lang.String[] optionLabels)
Assert that given options are present in a select box (by label). |
void |
assertSelectOptionValueNotPresent(java.lang.String selectName,
java.lang.String optionValue)
|
void |
assertSelectOptionValuePresent(java.lang.String selectName,
java.lang.String optionValue)
Assert that a specific option is present in a select box (by value). |
void |
assertSelectOptionValuesEqual(java.lang.String selectName,
java.lang.String[] expectedValues)
Assert that the values of a select element's options match a given array of strings. |
void |
assertSelectOptionValuesNotEqual(java.lang.String selectName,
java.lang.String[] optionValues)
Assert that the values of a select element's options do not match a given array of strings. |
void |
assertSelectOptionValuesPresent(java.lang.String selectName,
java.lang.String[] optionValues)
Assert that given options are present in a select box (by value). |
void |
assertServerResponseContains(java.lang.String string)
Ensures the server's response (HTTP header + body) contains a string. |
void |
assertServerResponseDoesNotContain(java.lang.String string)
Ensures the server's response (HTTP header + body) dos not contain a string. |
void |
assertSubmitButtonNotPresent()
Assert that no submit button is present in the current form. |
void |
assertSubmitButtonNotPresent(java.lang.String buttonName)
Assert that a submit button with a given name is not present. |
void |
assertSubmitButtonPresent()
Assert that a submit button is present. |
void |
assertSubmitButtonPresent(java.lang.String buttonName)
Assert that a submit button with a given name is present. |
void |
assertSubmitButtonPresent(java.lang.String buttonName,
java.lang.String buttonValue)
Assert that a submit button with a given name and value is present. |
void |
assertTableEquals(java.lang.String tableSummaryNameOrId,
java.lang.String[][] expectedCellValues)
Assert that a specific table matches a matrix of supplied text values. |
void |
assertTableEquals(java.lang.String tableSummaryNameOrId,
net.sourceforge.jwebunit.html.Table expectedTable)
Assert that a specific table matches an ExpectedTable. |
void |
assertTableMatch(java.lang.String tableSummaryOrId,
java.lang.String[][] expectedCellValues)
Assert that a specific table matches a matrix of supplied regexps. |
void |
assertTableMatch(java.lang.String tableSummaryOrId,
net.sourceforge.jwebunit.html.Table expectedTable)
Assert that a specific table matches an ExpectedTable. |
void |
assertTableNotPresent(java.lang.String tableSummaryNameOrId)
Assert that a table with a given summary or id value is not present. |
void |
assertTablePresent(java.lang.String tableSummaryNameOrId)
Assert that a table with a given summary or id value is present. |
void |
assertTableRowCountEquals(java.lang.String tableSummaryNameOrId,
int expectedRowCount)
Assert that the number of rows for a specific table equals expected value. |
void |
assertTableRowsEqual(java.lang.String tableSummaryNameOrId,
int startRow,
java.lang.String[][] expectedTable)
Assert that a range of rows for a specific table matches a matrix of supplied text values. |
void |
assertTableRowsEqual(java.lang.String tableSummaryNameOrId,
int startRow,
net.sourceforge.jwebunit.html.Table expectedTable)
Assert that a range of rows for a specific table matches a matrix of supplied text values. |
void |
assertTableRowsMatch(java.lang.String tableSummaryOrId,
int startRow,
java.lang.String[][] expectedTable)
Assert that a range of rows for a specific table matches a matrix of supplied regexps. |
void |
assertTableRowsMatch(java.lang.String tableSummaryOrId,
int startRow,
net.sourceforge.jwebunit.html.Table expectedTable)
Assert that a range of rows for a specific table matches a matrix of supplied regexps. |
void |
assertTextFieldEquals(java.lang.String formElementName,
java.lang.String expectedValue)
Assert that an input text element with name formElementName has the expectedValue
value. |
void |
assertTextInElement(java.lang.String elementID,
java.lang.String text)
Assert that a given element contains specific text. |
void |
assertTextInTable(java.lang.String tableSummaryNameOrId,
java.lang.String text)
Assert that supplied text is present in a specific table. |
void |
assertTextInTable(java.lang.String tableSummaryOrId,
java.lang.String[] text)
Assert that a set of text values are all present in a specific table. |
void |
assertTextNotInElement(java.lang.String elementID,
java.lang.String text)
|
void |
assertTextNotInTable(java.lang.String tableSummaryNameOrId,
java.lang.String text)
Assert that supplied text is not present in a specific table. |
void |
assertTextNotInTable(java.lang.String tableSummaryNameOrId,
java.lang.String[] text)
Assert that none of a set of text values are present in a specific table. |
void |
assertTextNotPresent(java.lang.String text)
Assert that supplied text is not present. |
void |
assertTextPresent(java.lang.String text)
Assert that supplied text is present. |
void |
assertTitleEquals(java.lang.String title)
Assert title of current html page in conversation matches an expected value. |
void |
assertTitleEqualsKey(java.lang.String titleKey)
Assert title of current html page matches the value of a specified web resource. |
void |
assertTitleMatch(java.lang.String regexp)
Assert title of current html page in conversation matches an expected regexp. |
void |
assertWarningAndErrorNotPresent()
assertWarningNotPresent
assertErrorNotPresent |
void |
assertWarningNotPresent()
Makes sure the page doesn't contain a warning, as when an exception has occurred. |
void |
assertWarningPresent()
Makes sure the page does contain a warning |
void |
assertWarningPresentWithKey(java.lang.String keyName)
Makes sure the page does contain a warning and that it also contains the text of the key. |
void |
assertWarningPresentWithText(java.lang.String text)
Makes sure the page does contain a warning and that it also contains the text. |
void |
assertWindowCountEquals(int windowCount)
Assert that the number of opened windows equals given value. |
void |
assertWindowPresent(int windowID)
Assert that a window with the given ID is open. |
void |
assertWindowPresent(java.lang.String windowName)
Assert that a window with the given name is open. |
void |
assertWindowPresentWithTitle(java.lang.String title)
Assert that at least one window with the given title is open. |
void |
beginAt(java.lang.String aRelativeURL)
Begin conversation at a URL absolute or relative to base URL. |
void |
checkCheckbox(java.lang.String checkBoxName)
Select a specified checkbox. |
void |
checkCheckbox(java.lang.String checkBoxName,
java.lang.String value)
Select a specified checkbox. |
void |
clickButton(java.lang.String buttonId)
Click the button with the given id. |
void |
clickButtonWithText(java.lang.String buttonValueText)
Clicks a button with text of the value attribute. |
void |
clickElementByXPath(java.lang.String xpath)
Click element with given xpath. |
void |
clickLink(java.lang.String linkId)
Navigate by selection of a link with given id. |
void |
clickLinkWithExactText(java.lang.String linkText)
Navigate by selection of a link with the exact given text. |
void |
clickLinkWithExactText(java.lang.String linkText,
int index)
Navigate by selecting Nth link with the exact given text. |
void |
clickLinkWithImage(java.lang.String imageFileName)
Navigate by selection of a link with a given image. |
void |
clickLinkWithKey(java.lang.String key)
Clicks a link |
void |
clickLinkWithText(java.lang.String linkText)
Navigate by selection of a link containing given text. |
void |
clickLinkWithText(java.lang.String linkText,
int index)
Navigate by selecting Nth link containing given text. |
void |
clickRadioOption(java.lang.String radioGroup,
java.lang.String radioOption)
Clicks a radio option. |
void |
closeBrowser()
Close the current conversation. |
void |
closeWindow()
Close the current window. |
void |
dumpCookies()
Print all the cookies to stdout. |
void |
dumpHtml()
Deprecated. Use WebTester.getPageSource() |
void |
dumpHtml(java.io.PrintStream stream)
Deprecated. Use WebTester.getPageSource() |
void |
dumpTable(java.lang.String tableNameOrId)
Dump the table as the 2D array that is used for assertions - for debugging purposes. |
void |
dumpTable(java.lang.String tableNameOrId,
java.io.PrintStream stream)
Dump the table as the 2D array that is used for assertions - for debugging purposes. |
net.sourceforge.jwebunit.api.ITestingEngine |
getDialog()
Deprecated. You should not use plugin specific fonctionality. Please ask for a new core feature instead. |
java.lang.String |
getElementAttributByXPath(java.lang.String xpath,
java.lang.String attribut)
Get the attribut value of the gicen element. |
java.lang.String |
getElementTextByXPath(java.lang.String xpath)
|
java.lang.String |
getFormElementValue(java.lang.String formElementName)
Deprecated. |
java.lang.String |
getMessage(java.lang.String key)
Return the value of a web resource based on its key. |
java.lang.String |
getPageSource()
Get the source of the HTML page (like in a real browser), or HTTP body for a non HTML content. |
java.lang.String |
getServerResponse()
Get the last data sent by the server. |
net.sourceforge.jwebunit.html.Table |
getTable(java.lang.String tableSummaryNameOrId)
|
net.sourceforge.jwebunit.util.TestContext |
getTestContext()
Provide access to test testContext. |
net.sourceforge.jwebunit.junit.WebTester |
getTester()
|
java.lang.String |
getTestingEngineKey()
Gets the Testing Engine Key that is used to find the proper testing engine class (HtmlUnitDialog / SeleniumDialog) for the tests. |
void |
gotoFrame(java.lang.String frameNameOrId)
Make the given frame active. |
void |
gotoPage(java.lang.String url)
Go to the given page like if user has typed the URL manually in the browser. |
void |
gotoRootWindow()
Make the root window active. |
void |
gotoWindow(int windowID)
Make a given window active. |
void |
gotoWindow(java.lang.String windowName)
Make a given window active. |
void |
gotoWindowByTitle(java.lang.String title)
Make first window with the given title active. |
void |
reset()
Reset the current form using the default reset button. |
void |
runBare()
Clean up unused memory. |
void |
saveAs(java.io.File f)
Save the last downloaded page (or file) to the disk. |
void |
selectOption(java.lang.String selectName,
java.lang.String label)
Select an option with a given display label in a select element. |
void |
selectOptionByValue(java.lang.String selectName,
java.lang.String value)
Select an option with a given value in a select element. |
void |
selectOptions(java.lang.String selectName,
java.lang.String[] labels)
Select options with given display labels in a select element. |
void |
selectOptionsByValues(java.lang.String selectName,
java.lang.String[] values)
Select options with given values in a select element. |
void |
setDialog(net.sourceforge.jwebunit.api.ITestingEngine aIJWebUnitDialog)
Set the testing engine. |
void |
setExpectedJavaScriptAlert(java.lang.String message)
Tell that the given alert boxe is expected. |
void |
setExpectedJavaScriptAlert(java.lang.String[] messages)
Tell that the given alert boxes are expected in the given order. |
void |
setExpectedJavaScriptConfirm(java.lang.String[] messages,
boolean[] actions)
Tell that the given confirm boxes are expected in the given order. |
void |
setExpectedJavaScriptConfirm(java.lang.String message,
boolean action)
Tell that the given confirm boxe is expected. |
void |
setExpectedJavaScriptPrompt(java.lang.String[] messages,
java.lang.String[] inputs)
Tell that the given prompt boxes are expected in the given order. |
void |
setExpectedJavaScriptPrompt(java.lang.String message,
java.lang.String input)
Tell that the given prompt boxe is expected. |
void |
setFormElement(java.lang.String formElementName,
java.lang.String value)
Deprecated. use setTextField or other methods |
void |
setRadioButton(java.lang.String radioButtonName,
java.lang.String value)
Sets a specific radio button. |
void |
setScriptingEnabled(boolean value)
Enable or disable Javascript support |
void |
setTestContext(net.sourceforge.jwebunit.util.TestContext aTestContext)
Allows setting an external test testContext class that might be extended from TestContext. |
void |
setTester(net.sourceforge.jwebunit.junit.WebTester tester)
Required so tester can be manually set externally when required. |
void |
setTestingEngineKey(java.lang.String testingEngineKey)
Set the Testing Engine that you want to use for the tests based on the Testing Engine Key. |
void |
setTextField(java.lang.String inputName,
java.lang.String value)
Set the value of a text or password input field. |
void |
setWorkingForm(int index)
Begin interaction with a specified form. |
void |
setWorkingForm(java.lang.String nameOrId)
Begin interaction with a specified form. |
void |
setWorkingForm(java.lang.String nameOrId,
int index)
Begin interaction with a specified form. |
void |
submit()
Submit form - default submit button will be used (unnamed submit button, or named button if there is only one on the form. |
void |
submit(java.lang.String buttonName)
Submit form by pressing named button. |
void |
submit(java.lang.String buttonName,
java.lang.String buttonValue)
Submit the form by pressing the named button with the given value (label). |
void |
tearDown()
|
void |
uncheckCheckbox(java.lang.String checkBoxName)
Deselect a specified checkbox. |
void |
uncheckCheckbox(java.lang.String checkBoxName,
java.lang.String value)
Deselect a specified checkbox. |
| Methods inherited from class junit.framework.TestCase |
|---|
countTestCases, createResult, getName, run, run, runTest, setName, setUp, toString |
| Methods inherited from class junit.framework.Assert |
|---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected net.sourceforge.jwebunit.junit.WebTester tester
| Constructor Detail |
|---|
public CrowdWebTestCase(java.lang.String name)
public CrowdWebTestCase()
| Method Detail |
|---|
public void tearDown()
throws java.lang.Exception
tearDown in class junit.framework.TestCasejava.lang.Exception
public void runBare()
throws java.lang.Throwable
runBare in class junit.framework.TestCasejava.lang.Throwablepublic net.sourceforge.jwebunit.api.ITestingEngine getDialog()
public void closeBrowser()
public void closeWindow()
public void setDialog(net.sourceforge.jwebunit.api.ITestingEngine aIJWebUnitDialog)
aIJWebUnitDialog - Testing engine.public net.sourceforge.jwebunit.util.TestContext getTestContext()
public void setTestContext(net.sourceforge.jwebunit.util.TestContext aTestContext)
aTestContext - public void beginAt(java.lang.String aRelativeURL)
getTestContext().setBaseUrl(String) to define base URL. Absolute URL
should start with "http://", "https://" or "www.".
aRelativeURL - absolute or relative URL (relative to base URL).public java.lang.String getMessage(java.lang.String key)
key - name of the web resource.
public void assertTitleEquals(java.lang.String title)
title - expected title valuepublic void assertTitleMatch(java.lang.String regexp)
regexp - expected title regexppublic void assertTitleEqualsKey(java.lang.String titleKey)
titleKey - web resource key for titlepublic void assertKeyPresent(java.lang.String key)
key - web resource name
public void assertKeyPresent(java.lang.String key,
java.util.List args)
key - web resource nameargs - public void assertTextPresent(java.lang.String text)
text - public void assertMatch(java.lang.String regexp)
regexp - public void assertKeyNotPresent(java.lang.String key)
key - web resource namepublic void assertWarningNotPresent()
public void assertErrorNotPresent()
public void assertWarningAndErrorNotPresent()
assertWarningNotPresent
assertErrorNotPresent
public void assertErrorPresent()
public void assertErrorPresentWithKey(java.lang.String keyName)
keyName - public void assertErrorPresentWithText(java.lang.String text)
public void assertWarningPresent()
public void assertWarningPresentWithKey(java.lang.String keyName)
keyName - public void assertWarningPresentWithText(java.lang.String text)
public void assertTextNotPresent(java.lang.String text)
text - public void assertNoMatch(java.lang.String regexp)
regexp - public net.sourceforge.jwebunit.html.Table getTable(java.lang.String tableSummaryNameOrId)
tableSummaryNameOrId -
public void assertTablePresent(java.lang.String tableSummaryNameOrId)
tableSummaryNameOrId - summary, name or id attribute value of tablepublic void assertTableNotPresent(java.lang.String tableSummaryNameOrId)
tableSummaryNameOrId - summary, name or id attribute value of table
public void assertKeyInTable(java.lang.String tableSummaryOrId,
java.lang.String key)
tableSummaryOrId - summary or id attribute value of tablekey - web resource name
public void assertTextInTable(java.lang.String tableSummaryNameOrId,
java.lang.String text)
tableSummaryNameOrId - summary, name or id attribute value of tabletext -
public void assertMatchInTable(java.lang.String tableSummaryNameOrId,
java.lang.String regexp)
tableSummaryNameOrId - summary, name or id attribute value of tableregexp -
public void assertKeysInTable(java.lang.String tableSummaryOrId,
java.lang.String[] keys)
tableSummaryOrId - summary, name or id attribute value of tablekeys - Array of web resource names.
public void assertTextInTable(java.lang.String tableSummaryOrId,
java.lang.String[] text)
tableSummaryOrId - summary, name or id attribute value of tabletext - Array of expected text values.
public void assertMatchInTable(java.lang.String tableSummaryOrId,
java.lang.String[] regexp)
tableSummaryOrId - summary, name or id attribute value of tableregexp - Array of expected regexps to match.
public void assertKeyNotInTable(java.lang.String tableSummaryOrId,
java.lang.String key)
tableSummaryOrId - summary, name or id attribute value of tablekey - web resource name
public void assertTextNotInTable(java.lang.String tableSummaryNameOrId,
java.lang.String text)
tableSummaryNameOrId - summary, name or id attribute value of tabletext -
public void assertTextNotInTable(java.lang.String tableSummaryNameOrId,
java.lang.String[] text)
tableSummaryNameOrId - summary, name or id attribute value of tabletext - Array of text values
public void assertNoMatchInTable(java.lang.String tableSummaryNameOrId,
java.lang.String regexp)
tableSummaryNameOrId - summary, name or id attribute value of tableregexp -
public void assertNoMatchInTable(java.lang.String tableSummaryNameOrId,
java.lang.String[] regexp)
tableSummaryNameOrId - summary, name or id attribute value of tableregexp - Array of text values
public void assertTableEquals(java.lang.String tableSummaryNameOrId,
net.sourceforge.jwebunit.html.Table expectedTable)
tableSummaryNameOrId - summary, name or id attribute value of tableexpectedTable - represents expected values (colspan supported).
public void assertTableEquals(java.lang.String tableSummaryNameOrId,
java.lang.String[][] expectedCellValues)
tableSummaryNameOrId - summary, name or id attribute value of tableexpectedCellValues - double dimensional array of expected values
public void assertTableRowsEqual(java.lang.String tableSummaryNameOrId,
int startRow,
net.sourceforge.jwebunit.html.Table expectedTable)
tableSummaryNameOrId - summary, name or id attribute value of tablestartRow - index of start row for comparisonexpectedTable - represents expected values (colspan and rowspan supported).
public void assertTableRowsEqual(java.lang.String tableSummaryNameOrId,
int startRow,
java.lang.String[][] expectedTable)
tableSummaryNameOrId - summary, name or id attribute value of tablestartRow - index of start row for comparisonexpectedTable - represents expected values (colspan and rowspan supported).
public void assertTableRowCountEquals(java.lang.String tableSummaryNameOrId,
int expectedRowCount)
tableSummaryNameOrId - summary, name or id attribute value of tableexpectedRowCount - expected row count.
public void assertTableMatch(java.lang.String tableSummaryOrId,
net.sourceforge.jwebunit.html.Table expectedTable)
tableSummaryOrId - summary or id attribute value of tableexpectedTable - represents expected regexps (colspan supported).
public void assertTableMatch(java.lang.String tableSummaryOrId,
java.lang.String[][] expectedCellValues)
tableSummaryOrId - summary or id attribute value of tableexpectedCellValues - double dimensional array of expected regexps
public void assertTableRowsMatch(java.lang.String tableSummaryOrId,
int startRow,
net.sourceforge.jwebunit.html.Table expectedTable)
tableSummaryOrId - summary or id attribute value of tablestartRow - index of start row for comparisonexpectedTable - represents expected regexps (colspan and rowspan supported).
public void assertTableRowsMatch(java.lang.String tableSummaryOrId,
int startRow,
java.lang.String[][] expectedTable)
tableSummaryOrId - summary or id attribute value of tablestartRow - index of start row for comparisonexpectedTable - represents expected regexps (colspan and rowspan not supported).public void assertFormElementPresent(java.lang.String formElementName)
formElementName - public void assertFormElementNotPresent(java.lang.String formElementName)
formElementName - public void assertCheckboxPresent(java.lang.String checkboxName)
checkboxName - checkbox name.
public void assertCheckboxPresent(java.lang.String checkboxName,
java.lang.String checkboxValue)
checkboxName - checkbox name attribut.checkboxValue - checkbox value attribut.public void assertCheckboxNotPresent(java.lang.String checkboxName)
checkboxName - checkbox name.
public void assertCheckboxNotPresent(java.lang.String checkboxName,
java.lang.String checkboxValue)
checkboxName - checkbox name.checkboxValue - checkbox value attribut.public void assertFormPresent()
public void assertFormPresent(java.lang.String nameOrID)
nameOrID - public void assertFormNotPresent()
public void assertFormNotPresent(java.lang.String nameOrID)
nameOrID -
public void assertFormElementEquals(java.lang.String formElementName,
java.lang.String expectedValue)
formElementName - expectedValue -
public void assertFormElementMatch(java.lang.String formElementName,
java.lang.String regexp)
formElementName - regexp - public void assertFormElementEmpty(java.lang.String formElementName)
formElementName -
public void assertTextFieldEquals(java.lang.String formElementName,
java.lang.String expectedValue)
formElementName has the expectedValue
value.
formElementName - the value of the name attribute of the elementexpectedValue - the expected value of the given input element
public void assertHiddenFieldPresent(java.lang.String formElementName,
java.lang.String expectedValue)
formElementName has the expectedValue
value.
formElementName - the value of the name attribute of the elementexpectedValue - the expected value of the given input elementpublic void assertCheckboxSelected(java.lang.String checkBoxName)
checkBoxName -
public void assertCheckboxSelected(java.lang.String checkBoxName,
java.lang.String checkBoxValue)
checkBoxName - checkBoxValue - public void assertCheckboxNotSelected(java.lang.String checkBoxName)
checkBoxName -
public void assertCheckboxNotSelected(java.lang.String checkBoxName,
java.lang.String checkBoxValue)
checkBoxName - checkBoxValue -
public void assertRadioOptionPresent(java.lang.String name,
java.lang.String radioOption)
name - radio group name.radioOption - option to test for.
public void assertRadioOptionNotPresent(java.lang.String name,
java.lang.String radioOption)
name - radio group name.radioOption - option to test for.
public void assertRadioOptionSelected(java.lang.String name,
java.lang.String radioOption)
name - radio group name.radioOption - option to test for selection.
public void assertRadioOptionNotSelected(java.lang.String name,
java.lang.String radioOption)
name - radio group name.radioOption - option to test for selection.
public void assertSelectOptionsPresent(java.lang.String selectName,
java.lang.String[] optionLabels)
selectName - name of the select element.optionLabels - option labels.
public void assertSelectOptionPresent(java.lang.String selectName,
java.lang.String optionLabel)
selectName - name of the select element.optionLabel - option label.
public void assertSelectOptionValuesPresent(java.lang.String selectName,
java.lang.String[] optionValues)
selectName - name of the select element.optionValues - option labels.
public void assertSelectOptionValuePresent(java.lang.String selectName,
java.lang.String optionValue)
selectName - name of the select element.optionValue - option value.
public void assertSelectOptionValueNotPresent(java.lang.String selectName,
java.lang.String optionValue)
public void assertSelectOptionNotPresent(java.lang.String selectName,
java.lang.String optionLabel)
selectName - name of the select element.optionLabel - option label.
public void assertSelectOptionsEqual(java.lang.String selectName,
java.lang.String[] expectedOptions)
selectName - name of the select element.expectedOptions - expected labels for the select box.
public void assertSelectOptionsNotEqual(java.lang.String selectName,
java.lang.String[] expectedOptions)
selectName - name of the select element.expectedOptions - expected display values for the select box.
public void assertSelectOptionValuesEqual(java.lang.String selectName,
java.lang.String[] expectedValues)
selectName - name of the select element.expectedValues - expected values for the select box.
public void assertSelectOptionValuesNotEqual(java.lang.String selectName,
java.lang.String[] optionValues)
selectName - name of the select element.optionValues - expected values for the select box.
public void assertSelectedOptionsEqual(java.lang.String selectName,
java.lang.String[] labels)
selectName - name of the select element.labels - expected display label(s) of the selected option.
public void assertSelectedOptionEquals(java.lang.String selectName,
java.lang.String option)
public void assertSelectedOptionValuesEqual(java.lang.String selectName,
java.lang.String[] values)
selectName - name of the select element.values - expected value(s) of the selected option.
public void assertSelectedOptionValueEquals(java.lang.String selectName,
java.lang.String value)
selectName - name of the select element.value - expected value of the selected option.
public void assertSelectedOptionsMatch(java.lang.String selectName,
java.lang.String[] regexps)
selectName - name of the select element.regexps - expected display value of the selected option.
public void assertSelectedOptionMatches(java.lang.String selectName,
java.lang.String regexp)
public void assertSubmitButtonPresent()
public void assertSubmitButtonPresent(java.lang.String buttonName)
buttonName - public void assertSubmitButtonNotPresent()
public void assertSubmitButtonNotPresent(java.lang.String buttonName)
buttonName -
public void assertSubmitButtonPresent(java.lang.String buttonName,
java.lang.String buttonValue)
buttonName - buttonValue - public void assertResetButtonPresent()
public void assertResetButtonPresent(java.lang.String buttonName)
buttonName - public void assertResetButtonNotPresent()
public void assertResetButtonNotPresent(java.lang.String buttonName)
buttonName - public void assertButtonPresent(java.lang.String buttonId)
buttonId - public void assertButtonPresentWithText(java.lang.String text)
text - Text representation of button content.public void assertButtonNotPresentWithText(java.lang.String text)
text - Text representation of button content.public void assertButtonNotPresent(java.lang.String buttonId)
buttonId - public void assertLinkPresent(java.lang.String linkId)
linkId - public void assertLinkNotPresent(java.lang.String linkId)
linkId - public void assertLinkPresentWithText(java.lang.String linkText)
linkText - public void assertLinkPresentWithKey(java.lang.String keyName)
keyName - The key whose associated text will be searched for.public void assertLinkNotPresentWithText(java.lang.String linkText)
linkText -
public void assertLinkPresentWithText(java.lang.String linkText,
int index)
linkText - index - The 0-based index, when more than one link with the same text is expected.
public void assertLinkNotPresentWithText(java.lang.String linkText,
int index)
linkText - index - The 0-based index, when more than one link with the same text is expected.public void assertLinkPresentWithExactText(java.lang.String linkText)
linkText - public void assertLinkNotPresentWithExactText(java.lang.String linkText)
linkText -
public void assertLinkPresentWithExactText(java.lang.String linkText,
int index)
linkText - index - The 0-based index, when more than one link with the same text is expected.
public void assertLinkNotPresentWithExactText(java.lang.String linkText,
int index)
linkText - index - The 0-based index, when more than one link with the same text is expected.public void assertLinkPresentWithImage(java.lang.String imageFileName)
imageFileName - A suffix of the image's filename; for example, to match "images/my_icon.png",
you could just pass in "my_icon.png".public void assertLinkNotPresentWithImage(java.lang.String imageFileName)
imageFileName - A suffix of the image's filename; for example, to match "images/my_icon.png",
you could just pass in "my_icon.png".public void assertElementPresent(java.lang.String anID)
anID - element id to test for.public void assertElementNotPresent(java.lang.String anID)
anID - element id to test for.public void assertElementPresentByXPath(java.lang.String xpath)
xpath - element xpath to test for.public void assertElementNotPresentByXPath(java.lang.String xpath)
xpath - element xpath to test for.
public void assertTextInElement(java.lang.String elementID,
java.lang.String text)
elementID - id of element to be inspected.text - to check for.
public void assertTextNotInElement(java.lang.String elementID,
java.lang.String text)
public void assertMatchInElement(java.lang.String elementID,
java.lang.String regexp)
elementID - id of element to be inspected.regexp - to match.
public void assertNoMatchInElement(java.lang.String elementID,
java.lang.String regexp)
elementID - id of element to be inspected.regexp - to match.public void assertWindowPresent(java.lang.String windowName)
windowName - public void assertWindowPresent(int windowID)
windowID - Javascript window ID.public void assertWindowPresentWithTitle(java.lang.String title)
title - public void assertWindowCountEquals(int windowCount)
windowCount - Window countpublic void assertFramePresent(java.lang.String frameNameOrId)
frameNameOrId - Name or ID of the frame. ID is checked first.public void assertCookiePresent(java.lang.String cookieName)
cookieName - The cookie name
public void assertCookieValueEquals(java.lang.String cookieName,
java.lang.String expectedValue)
cookieName - The cookie nameexpectedValue - The cookie value
public void assertCookieValueMatch(java.lang.String cookieName,
java.lang.String regexp)
cookieName - The cookie nameregexp - The regexppublic java.lang.String getFormElementValue(java.lang.String formElementName)
public void setWorkingForm(int index)
index - 0-based index of the form to work with.public void setWorkingForm(java.lang.String nameOrId)
nameOrId - name or id of the form to work with.
public void setWorkingForm(java.lang.String nameOrId,
int index)
nameOrId - name or id of the form to work with.index - The 0-based index, when more than one form with the same name is expected.
public void setTextField(java.lang.String inputName,
java.lang.String value)
inputName - name of form element.value - value to set.
public void setRadioButton(java.lang.String radioButtonName,
java.lang.String value)
radioButtonName - The name of the radio button.value - The value to set it too.public void checkCheckbox(java.lang.String checkBoxName)
checkBoxName - name of checkbox to be selected.
public void checkCheckbox(java.lang.String checkBoxName,
java.lang.String value)
checkBoxName - name of checkbox to be selected.value - value of checkbox to be selected.public void uncheckCheckbox(java.lang.String checkBoxName)
checkBoxName - name of checkbox to be deselected.
public void uncheckCheckbox(java.lang.String checkBoxName,
java.lang.String value)
checkBoxName - name of checkbox to be deselected.value - value of checkbox to be deselected.
public void selectOptions(java.lang.String selectName,
java.lang.String[] labels)
selectName - name of select element.labels - labels of options to be selected.
public void selectOption(java.lang.String selectName,
java.lang.String label)
selectName - name of select element.label - label of option to be selected.
public void selectOptionsByValues(java.lang.String selectName,
java.lang.String[] values)
selectName - name of select element.values - values of options to be selected.
public void selectOptionByValue(java.lang.String selectName,
java.lang.String value)
selectName - name of select element.value - values of options to be selected.public void submit()
public void submit(java.lang.String buttonName)
buttonName - Submit button name attribut value.
public void submit(java.lang.String buttonName,
java.lang.String buttonValue)
buttonName - Submit button name attribut value.buttonValue - Submit button value attribut value.public void reset()
net.sourceforge.jwebunit.htmlunit.HtmlUnitDialog#getFormfor an explanation of how the current
form is established.
public void clickLinkWithKey(java.lang.String key)
key - The value of this key is the link clickedpublic void clickLinkWithText(java.lang.String linkText)
linkText - Text in the link.
public void clickLinkWithText(java.lang.String linkText,
int index)
linkText - Text in the link.index - The 0-based index, when more than one link with the same text is expected.public void clickLinkWithExactText(java.lang.String linkText)
linkText - Text of the link.
public void clickLinkWithExactText(java.lang.String linkText,
int index)
linkText - Text of the link.index - The 0-based index, when more than one link with the same text is expected.public void clickButton(java.lang.String buttonId)
buttonId - Button ID attribut value.public void clickButtonWithText(java.lang.String buttonValueText)
text of the value attribute.
buttonValueText - The text of the button (contents of the value attribute).public void clickLinkWithImage(java.lang.String imageFileName)
imageFileName - A suffix of the image's filename; for example, to match "images/my_icon.png",
you could just pass in "my_icon.png".public void clickLink(java.lang.String linkId)
linkId - id of link
public void clickRadioOption(java.lang.String radioGroup,
java.lang.String radioOption)
radioGroup - name of the radio group.radioOption - value of the option to check for.public void clickElementByXPath(java.lang.String xpath)
xpath - xpath of the element.
public java.lang.String getElementAttributByXPath(java.lang.String xpath,
java.lang.String attribut)
xpath - XPath of the element.attribut - Name of the attribut.
public java.lang.String getElementTextByXPath(java.lang.String xpath)
public void gotoWindow(java.lang.String windowName)
windowName - Name of the window.public void gotoWindow(int windowID)
windowID - Javascript ID of the windowpublic void gotoRootWindow()
public void gotoWindowByTitle(java.lang.String title)
title - Title of the window.public void gotoFrame(java.lang.String frameNameOrId)
frameNameOrId - Name or ID of the frame. ID is checked first.public void gotoPage(java.lang.String url)
getTestContext().setBaseUrl(String) to define base URL. Absolute URL
should start with "http://", "https://" or "www.".
url - absolute or relative URL (relative to base URL).public void dumpCookies()
public java.lang.String getPageSource()
public java.lang.String getServerResponse()
public void saveAs(java.io.File f)
f - The file name.public void assertDownloadedFileEquals(java.net.URL expected)
expected - Expected file URL.public void dumpHtml()
WebTester.getPageSource()
public void dumpHtml(java.io.PrintStream stream)
WebTester.getPageSource()
stream - public void dumpTable(java.lang.String tableNameOrId)
tableNameOrId -
public void dumpTable(java.lang.String tableNameOrId,
java.io.PrintStream stream)
tableNameOrId - stream - public void setScriptingEnabled(boolean value)
public void setTestingEngineKey(java.lang.String testingEngineKey)
testingEngineKey - The testingEngineKey to set.TestingEngineRegistrypublic java.lang.String getTestingEngineKey()
public void setFormElement(java.lang.String formElementName,
java.lang.String value)
formElementName - name of form element.value - public void setExpectedJavaScriptAlert(java.lang.String message)
message - Message in the alert.public void setExpectedJavaScriptAlert(java.lang.String[] messages)
messages - Messages in the alerts.
public void setExpectedJavaScriptConfirm(java.lang.String message,
boolean action)
message - Message in the confirm.action - Whether we should click on "OK" (true) or "Cancel" (false)
public void setExpectedJavaScriptConfirm(java.lang.String[] messages,
boolean[] actions)
messages - Messages in the confirms.actions - Whether we should click on "OK" (true) or "Cancel" (false)
public void setExpectedJavaScriptPrompt(java.lang.String message,
java.lang.String input)
message - Message in the prompt.input - What we should put in the prompt (null if user press Cancel)
public void setExpectedJavaScriptPrompt(java.lang.String[] messages,
java.lang.String[] inputs)
messages - Messages in the prompts.inputs - What we should put in the prompt (null if user press Cancel)
public void addRequestHeader(java.lang.String header,
java.lang.String value)
header - header paramater.value - parameter value.public void assertServerResponseContains(java.lang.String string)
string - string to search for.public void assertServerResponseDoesNotContain(java.lang.String string)
string - string to search for.public void setTester(net.sourceforge.jwebunit.junit.WebTester tester)
tester - new tester.public net.sourceforge.jwebunit.junit.WebTester getTester()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||