Package com.atlassian.jira.webtests
Class WebTestCaseWrapper
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
net.sourceforge.jwebunit.WebTestCase
com.atlassian.jira.webtests.WebTestCaseWrapper
- All Implemented Interfaces:
junit.framework.Test
- Direct Known Subclasses:
AbstractAtlassianWebTestCase
public class WebTestCaseWrapper
extends net.sourceforge.jwebunit.WebTestCase
This class pretty much wraps the WebTestCase to dump out the response whenever the WebTestFails. A definite candidate
for some simple AOP work :)
-
Field Summary
Fields inherited from class net.sourceforge.jwebunit.WebTestCase
tester -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated.voidassertElementNotPresentBy(String attrName, String attrValue) voidassertElementPresent(String anID) Deprecated.UseAssertions.assertNodeByIdExists(java.lang.String)instead.voidassertElementPresentBy(String attrName, String attrValue) voidassertOptionValueNotPresent(String selectName, String option) Deprecated.UseWebTester.assertRadioOptionValueNotPresent(String, String)voidassertOptionValuePresent(String selectName, String optionLabel) Asserts that an option with the given option label is present on the given select form element.voidassertTextInTable(String tableSummaryOrId, String text) voidassertTextNotPresent(String text) voidassertTextPresent(String text) voidClicks the standard JIRA form's cancel button.voidvoidstatic voidstatic voidstatic voidstatic voidlogSection(String msg) static voidvoidselectMultiOption(String selectName, String option) Deprecated.useForm.selectOptionsByDisplayName(String, String[])instead.voidselectMultiOptionByValue(String selectName, String value) Selects an option from a multiple select field by specifying the value of the desired option.voidselectOption(String selectName, String option) Selects an option from a select form field by specifying the visible option label (as opposed to the value)voidSubmits the current form using the button with the given name.voidtearDown()voidDeprecated.voidwaitAndReloadBulkOperationProgressPage(boolean optional) voidwaitAndReloadBulkOperationProgressPage(boolean optional, net.sourceforge.jwebunit.WebTester webTester) Methods inherited from class net.sourceforge.jwebunit.WebTestCase
assertButtonNotPresent, assertButtonPresent, assertCheckboxNotSelected, assertCheckboxSelected, assertCookiePresent, assertCookieValueEquals, assertFormElementEmpty, assertFormElementEquals, assertFormElementNotPresent, assertFormElementNotPresentWithLabel, assertFormElementPresent, assertFormElementPresentWithLabel, assertFormNotPresent, assertFormNotPresent, assertFormPresent, assertFormPresent, assertFramePresent, assertKeyInTable, assertKeyNotInTable, assertKeyNotPresent, assertKeyPresent, assertKeysInTable, assertLinkNotPresent, assertLinkNotPresentWithImage, assertLinkNotPresentWithText, assertLinkNotPresentWithText, assertLinkPresent, assertLinkPresentWithImage, assertLinkPresentWithText, assertLinkPresentWithText, assertOptionEquals, assertOptionsEqual, assertOptionsNotEqual, assertOptionValuesEqual, assertOptionValuesNotEqual, assertRadioOptionNotPresent, assertRadioOptionNotSelected, assertRadioOptionPresent, assertRadioOptionSelected, assertSubmitButtonNotPresent, assertSubmitButtonPresent, assertSubmitButtonValue, assertTableEquals, assertTableEquals, assertTableNotPresent, assertTablePresent, assertTableRowsEqual, assertTableRowsEqual, assertTextInElement, assertTextInTable, assertTextNotInElement, assertTextNotInTable, assertTextNotInTable, assertTitleEquals, assertTitleEqualsKey, assertWindowPresent, beginAt, checkCheckbox, checkCheckbox, clickButton, clickLink, clickLinkWithImage, clickLinkWithText, clickLinkWithText, clickLinkWithTextAfterText, dumpCookies, dumpCookies, dumpResponse, dumpTable, dumpTable, getDialog, getMessage, getTestContext, getTester, gotoFrame, gotoPage, gotoRootWindow, gotoWindow, reset, setFormElement, setFormElementWithLabel, setWorkingForm, submit, uncheckCheckbox, uncheckCheckboxMethods 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, runBare, runTest, setName, setUp, toString
-
Constructor Details
-
WebTestCaseWrapper
-
WebTestCaseWrapper
public WebTestCaseWrapper()
-
-
Method Details
-
raiseRuntimeException
-
clickCancelButton
public void clickCancelButton()Clicks the standard JIRA form's cancel button. Note: this requiresHttpUnitOptions.setScriptingEnabled(boolean)to be set true BEFORE the containing page is loaded. If you do this, make sure you set back in a try/finally block -
assertTextPresent
- Overrides:
assertTextPresentin classnet.sourceforge.jwebunit.WebTestCase
-
assertTextNotPresent
- Overrides:
assertTextNotPresentin classnet.sourceforge.jwebunit.WebTestCase
-
assertTextInTable
- Overrides:
assertTextInTablein classnet.sourceforge.jwebunit.WebTestCase
-
assertElementPresent
Deprecated.UseAssertions.assertNodeByIdExists(java.lang.String)instead. Since v7.1.- Overrides:
assertElementPresentin classnet.sourceforge.jwebunit.WebTestCase
-
assertElementNotPresent
Deprecated.UseAssertions.assertNodeByIdDoesNotExist(java.lang.String)instead. Since v7.1.- Overrides:
assertElementNotPresentin classnet.sourceforge.jwebunit.WebTestCase
-
assertElementPresentBy
-
assertElementNotPresentBy
-
selectMultiOption
Deprecated.useForm.selectOptionsByDisplayName(String, String[])instead. -
selectMultiOptionByValue
Selects an option from a multiple select field by specifying the value of the desired option.- Parameters:
selectName- the name of the select form element.value- the value of the option to be selected.
-
selectOption
Selects an option from a select form field by specifying the visible option label (as opposed to the value)- Overrides:
selectOptionin classnet.sourceforge.jwebunit.WebTestCase- Parameters:
selectName- the name of the select form element.option- the string label for the option to be selected.
-
assertOptionValuePresent
Asserts that an option with the given option label is present on the given select form element.- Parameters:
selectName- the name of the select form element.optionLabel- the value of the option to assert on.
-
assertOptionValueNotPresent
Deprecated.UseWebTester.assertRadioOptionValueNotPresent(String, String)Asserts that an option with the given option label is not present on the given select form element.- Parameters:
selectName- the name of the select form element.option- the value of the option to assert on.
-
submit
Submits the current form using the button with the given name.- Overrides:
submitin classnet.sourceforge.jwebunit.WebTestCase- Parameters:
buttonName- The name attribute on the submit input element.- Throws:
RuntimeException- if the form or button is not present.
-
waitAndReloadBulkOperationProgressPage
Deprecated. -
waitAndReloadBulkOperationProgressPage
public void waitAndReloadBulkOperationProgressPage(boolean optional) -
waitAndReloadBulkOperationProgressPage
public void waitAndReloadBulkOperationProgressPage(boolean optional, net.sourceforge.jwebunit.WebTester webTester) -
log
-
logSection
-
log
-
log
-
dumpResponse
public void dumpResponse() -
dumpResponse
-
tearDown
public void tearDown()- Overrides:
tearDownin classjunit.framework.TestCase
-
Assertions.assertNodeByIdDoesNotExist(java.lang.String)instead.