|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
net.sourceforge.jwebunit.junit.WebTestCase
com.atlassian.crowd.acceptance.utils.CrowdWebTestCase
public class CrowdWebTestCase
Base Crowd test case, with extra assertions on top of WebTestCase.
| Field Summary |
|---|
| Fields inherited from class net.sourceforge.jwebunit.junit.WebTestCase |
|---|
customTester, tester |
| Constructor Summary | |
|---|---|
CrowdWebTestCase()
|
|
| Method Summary | ||
|---|---|---|
void |
addRequestHeader(String header,
String value)
Adds a request header for all subsequent requests. |
|
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(String keyName)
Makes sure the page does contain an error and that it also contains the text of the key. |
|
void |
assertKeyInElement(String elementID,
String key)
Assert that a given element contains a specific web resource's value. |
|
void |
assertKeyPresent(String key)
Assert that a web resource's value is present. |
|
void |
assertKeyPresent(String key,
List args)
Assert that a web resource's value is present. |
|
void |
assertKeyPresent(String key,
String... args)
|
|
void |
assertKeyPresentOnce(String key)
Checks that the text of a given key only occurs once on the page, such as validation error messages |
|
void |
assertLinkPresentWithKey(String keyName)
Assert that a link containing the text of the key is present. |
|
void |
assertServerResponseContains(String string)
Ensures the server's response (HTTP header + body) contains a string. |
|
void |
assertServerResponseDoesNotContain(String string)
Ensures the server's response (HTTP header + body) dos not contain a string. |
|
void |
assertSuccessPresent()
Makes sure the page contains a success message |
|
void |
assertTextPresent(String text,
boolean suppressMessage)
Assert that supplied text is present. |
|
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 |
clickLinkWithKey(String key)
Clicks a link |
|
String |
getElementTextById(String elementId)
|
|
protected String |
getPageText()
|
|
boolean |
isTextPresent(String text)
Checks if text is present on the page |
|
protected void |
log(String message)
|
|
protected
|
scrapeTable(String id,
com.google.common.base.Function<List<String>,T> mapper)
|
|
protected
|
scrapeTable(String id,
List<String> headings,
com.google.common.base.Function<List<String>,T> mapper)
|
|
void |
setRadioButton(String radioButtonName,
String value)
Sets a specific radio button. |
|
void |
setTester(net.sourceforge.jwebunit.junit.WebTester tester)
Required so tester can be manually set externally when required. |
|
protected boolean |
waitFor(Callable<Boolean> isPresent)
|
|
void |
waitForElementById(String id)
|
|
void |
waitForElementByXPath(String xpath)
|
|
void |
waitForText(String text)
|
|
void |
waitForText(String text,
long interval,
long maxInterval)
Waits for the specified key to appear on the page. |
|
| Methods inherited from class net.sourceforge.jwebunit.junit.WebTestCase |
|---|
assertButtonNotPresent, assertButtonNotPresentWithText, assertButtonPresent, assertButtonPresentWithText, assertCheckboxNotPresent, assertCheckboxNotPresent, assertCheckboxNotSelected, assertCheckboxNotSelected, assertCheckboxPresent, assertCheckboxPresent, assertCheckboxSelected, assertCheckboxSelected, assertCommentNotPresent, assertCommentPresent, assertCookiePresent, assertCookieValueEquals, assertCookieValueMatch, assertDownloadedFileEquals, assertElementNotPresent, assertElementNotPresentByXPath, assertElementPresent, assertElementPresentByXPath, assertFormElementEmpty, assertFormElementEquals, assertFormElementMatch, assertFormElementNotPresent, assertFormElementPresent, assertFormNotPresent, assertFormNotPresent, assertFormPresent, assertFormPresent, assertFramePresent, assertHeaderEquals, assertHeaderMatches, assertHeaderNotPresent, assertHeaderPresent, assertHiddenFieldPresent, assertImagePresent, assertImagePresentPartial, assertImageValid, assertImageValidAndStore, assertKeyInTable, assertKeyInTable, assertKeyNotInTable, assertKeyNotPresent, assertKeyNotPresent, assertKeyPresent, assertKeysInTable, assertKeysInTable, assertLabeledFieldEquals, assertLabelMatches, assertLabelPresent, assertLinkNotPresent, assertLinkNotPresentWithExactText, assertLinkNotPresentWithExactText, assertLinkNotPresentWithImage, assertLinkNotPresentWithImage, assertLinkNotPresentWithText, assertLinkNotPresentWithText, assertLinkPresent, assertLinkPresentWithExactText, assertLinkPresentWithExactText, assertLinkPresentWithImage, assertLinkPresentWithImage, assertLinkPresentWithText, assertLinkPresentWithText, assertMatch, assertMatch, assertMatch, assertMatchInElement, assertMatchInTable, assertMatchInTable, assertNoMatch, assertNoMatchInElement, assertNoMatchInTable, assertNoMatchInTable, assertNotMatch, assertNotMatch, assertRadioOptionNotPresent, assertRadioOptionNotSelected, assertRadioOptionPresent, assertRadioOptionSelected, assertResetButtonNotPresent, assertResetButtonNotPresent, assertResetButtonPresent, assertResetButtonPresent, assertResponseCode, assertResponseCodeBetween, assertSelectedOptionEquals, assertSelectedOptionEquals, assertSelectedOptionMatches, assertSelectedOptionMatches, assertSelectedOptionsEqual, assertSelectedOptionsEqual, assertSelectedOptionsMatch, assertSelectedOptionsMatch, assertSelectedOptionValueEquals, assertSelectedOptionValueEquals, assertSelectedOptionValuesEqual, assertSelectedOptionValuesEqual, assertSelectOptionNotPresent, assertSelectOptionNotPresent, assertSelectOptionPresent, assertSelectOptionPresent, assertSelectOptionsEqual, assertSelectOptionsEqual, assertSelectOptionsNotEqual, assertSelectOptionsNotEqual, assertSelectOptionsPresent, assertSelectOptionsPresent, assertSelectOptionValueNotPresent, assertSelectOptionValueNotPresent, assertSelectOptionValuePresent, assertSelectOptionValuePresent, assertSelectOptionValuesEqual, assertSelectOptionValuesEqual, assertSelectOptionValuesNotEqual, assertSelectOptionValuesNotEqual, assertSelectOptionValuesPresent, assertSelectOptionValuesPresent, assertSubmitButtonNotPresent, assertSubmitButtonNotPresent, assertSubmitButtonPresent, assertSubmitButtonPresent, assertSubmitButtonPresent, assertTableEquals, assertTableEquals, assertTableMatch, assertTableMatch, assertTableNotPresent, assertTablePresent, assertTableRowCountEquals, assertTableRowsEqual, assertTableRowsEqual, assertTableRowsMatch, assertTableRowsMatch, assertTextFieldEquals, assertTextInElement, assertTextInTable, assertTextInTable, assertTextNotInElement, assertTextNotInTable, assertTextNotInTable, assertTextNotPresent, assertTextPresent, assertTitleEquals, assertTitleEqualsKey, assertTitleEqualsKey, assertTitleMatch, assertTitleNotEquals, assertTitleNotSame, assertWindowCountEquals, assertWindowPresent, assertWindowPresent, assertWindowPresentWithTitle, beginAt, checkCheckbox, checkCheckbox, clickButton, clickButtonWithText, clickElementByXPath, clickLink, clickLinkWithExactText, clickLinkWithExactText, clickLinkWithImage, clickLinkWithImage, clickLinkWithText, clickLinkWithText, clickRadioOption, closeBrowser, closeWindow, dumpCookies, dumpHtml, dumpHtml, dumpTable, dumpTable, getAllHeaders, getComments, getDialog, getElementAttributByXPath, getElementAttributeByXPath, getElementById, getElementByXPath, getElementsByXPath, getElementTextByXPath, getFieldsForLabel, getFormElementValue, getHeader, getImage, getLabeledFieldValue, getMessage, getMessage, getPageSource, getResponseHeaders, getServerResponse, getServeurResponse, getTable, getTestContext, getTester, getTestingEngine, getTestingEngineKey, gotoFrame, gotoPage, gotoRootWindow, gotoWindow, gotoWindow, gotoWindowByTitle, reset, runBare, saveAs, selectOption, selectOption, selectOptionByValue, selectOptionByValue, selectOptions, selectOptions, selectOptionsByValues, selectOptionsByValues, setBaseUrl, setBaseUrl, setDialog, setExpectedJavaScriptAlert, setExpectedJavaScriptAlert, setExpectedJavaScriptConfirm, setExpectedJavaScriptConfirm, setExpectedJavaScriptPrompt, setExpectedJavaScriptPrompt, setFormElement, setHiddenField, setIgnoreFailingStatusCodes, setLabeledFormElementField, setScriptingEnabled, setTestContext, setTestingEngineKey, setTextField, setTimeout, setWorkingForm, setWorkingForm, setWorkingForm, submit, submit, submit, tearDown, uncheckCheckbox, uncheckCheckbox |
| Methods inherited from class junit.framework.TestCase |
|---|
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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runTest, setName, setUp, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CrowdWebTestCase()
| Method Detail |
|---|
public void assertKeyPresent(String key)
assertKeyPresent in class net.sourceforge.jwebunit.junit.WebTestCasekey - web resource name
public void assertKeyPresent(String key,
List args)
key - web resource nameargs -
public void assertKeyPresent(String key,
String... args)
public void assertTextPresent(String text,
boolean suppressMessage)
text - public void assertSuccessPresent()
public void assertWarningNotPresent()
public void assertErrorNotPresent()
public void assertWarningAndErrorNotPresent()
assertWarningNotPresent
assertErrorNotPresent
public void assertErrorPresent()
public void assertErrorPresentWithKey(String keyName)
keyName - public void assertWarningPresent()
public void assertLinkPresentWithKey(String keyName)
keyName - The key whose associated text will be searched for.
public void assertKeyInElement(String elementID,
String key)
elementID - id of element to be inspectedkey - the web resource's key
public void setRadioButton(String radioButtonName,
String value)
radioButtonName - The name of the radio button.value - The value to set it too.public void clickLinkWithKey(String key)
key - The value of this key is the link clickedpublic String getElementTextById(String elementId)
public void addRequestHeader(String header,
String value)
header - header paramater.value - parameter value.public void assertServerResponseContains(String string)
string - string to search for.public void assertServerResponseDoesNotContain(String string)
string - string to search for.public void setTester(net.sourceforge.jwebunit.junit.WebTester tester)
tester - new tester.protected void log(String message)
protected String getPageText()
public void waitForText(String text,
long interval,
long maxInterval)
throws Exception
text - interval - maxInterval -
Exception
public void waitForElementByXPath(String xpath)
throws Exception
Exception
public void waitForElementById(String id)
throws Exception
Exception
protected boolean waitFor(Callable<Boolean> isPresent)
throws Exception
Exceptionpublic boolean isTextPresent(String text)
text - the text to match for
public void waitForText(String text)
throws Exception
Exceptionpublic void assertKeyPresentOnce(String key)
key - the key to check occurrences of
protected <T> List<T> scrapeTable(String id,
com.google.common.base.Function<List<String>,T> mapper)
protected <T> List<T> scrapeTable(String id,
List<String> headings,
com.google.common.base.Function<List<String>,T> mapper)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||