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
    Constructor
    Description
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    void
    assertElementNotPresentBy(String attrName, String attrValue)
     
    void
    void
    assertElementPresentBy(String attrName, String attrValue)
     
    void
    Deprecated.
    Use WebTester.assertRadioOptionValueNotPresent(String, String)
    void
    assertOptionValuePresent(String selectName, String optionLabel)
    Asserts that an option with the given option label is present on the given select form element.
    void
    assertTextInTable(String tableSummaryOrId, String text)
     
    void
     
    void
     
    void
    Clicks the standard JIRA form's cancel button.
    void
     
    void
     
    static void
    log(String msg)
     
    static void
    log(String msg, Throwable t)
     
    static void
     
    static void
     
    static void
     
    void
    selectMultiOption(String selectName, String option)
    void
    Selects an option from a multiple select field by specifying the value of the desired option.
    void
    selectOption(String selectName, String option)
    Selects an option from a select form field by specifying the visible option label (as opposed to the value)
    void
    submit(String buttonName)
    Submits the current form using the button with the given name.
    void
     
    void
    void
     
    void
    waitAndReloadBulkOperationProgressPage(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, 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, runBare, runTest, setName, setUp, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • WebTestCaseWrapper

      public WebTestCaseWrapper(String name)
    • WebTestCaseWrapper

      public WebTestCaseWrapper()
  • Method Details

    • raiseRuntimeException

      public static void raiseRuntimeException(Throwable e)
    • clickCancelButton

      public void clickCancelButton()
      Clicks the standard JIRA form's cancel button. Note: this requires HttpUnitOptions.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

      public void assertTextPresent(String text)
      Overrides:
      assertTextPresent in class net.sourceforge.jwebunit.WebTestCase
    • assertTextNotPresent

      public void assertTextNotPresent(String text)
      Overrides:
      assertTextNotPresent in class net.sourceforge.jwebunit.WebTestCase
    • assertTextInTable

      public void assertTextInTable(String tableSummaryOrId, String text)
      Overrides:
      assertTextInTable in class net.sourceforge.jwebunit.WebTestCase
    • assertElementPresent

      @Deprecated public void assertElementPresent(String anID)
      Deprecated.
      Overrides:
      assertElementPresent in class net.sourceforge.jwebunit.WebTestCase
    • assertElementNotPresent

      @Deprecated public void assertElementNotPresent(String anID)
      Deprecated.
      Overrides:
      assertElementNotPresent in class net.sourceforge.jwebunit.WebTestCase
    • assertElementPresentBy

      public void assertElementPresentBy(String attrName, String attrValue)
    • assertElementNotPresentBy

      public void assertElementNotPresentBy(String attrName, String attrValue)
    • selectMultiOption

      @Deprecated public void selectMultiOption(String selectName, String option)
    • selectMultiOptionByValue

      public void selectMultiOptionByValue(String selectName, String value)
      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

      public void selectOption(String selectName, String option)
      Selects an option from a select form field by specifying the visible option label (as opposed to the value)
      Overrides:
      selectOption in class net.sourceforge.jwebunit.WebTestCase
      Parameters:
      selectName - the name of the select form element.
      option - the string label for the option to be selected.
    • assertOptionValuePresent

      public void assertOptionValuePresent(String selectName, String optionLabel)
      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

      public void assertOptionValueNotPresent(String selectName, String option)
      Deprecated.
      Use WebTester.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

      public void submit(String buttonName)
      Submits the current form using the button with the given name.
      Overrides:
      submit in class net.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 public void waitAndReloadBulkOperationProgressPage()
    • waitAndReloadBulkOperationProgressPage

      public void waitAndReloadBulkOperationProgressPage(boolean optional)
    • waitAndReloadBulkOperationProgressPage

      public void waitAndReloadBulkOperationProgressPage(boolean optional, net.sourceforge.jwebunit.WebTester webTester)
    • log

      public static void log(String msg)
    • logSection

      public static void logSection(String msg)
    • log

      public static void log(Throwable t)
    • log

      public static void log(String msg, Throwable t)
    • dumpResponse

      public void dumpResponse()
    • dumpResponse

      public void dumpResponse(Throwable t)
    • tearDown

      public void tearDown()
      Overrides:
      tearDown in class junit.framework.TestCase