com.atlassian.confluence
Class AbstractAtlassianWebTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by net.sourceforge.jwebunit.junit.WebTestCase
              extended by com.atlassian.confluence.AbstractAtlassianWebTestCase
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AbstractConfluenceAcceptanceTest

public abstract class AbstractAtlassianWebTestCase
extends net.sourceforge.jwebunit.junit.WebTestCase

This super class provides extensions to JWebUnit useful in acceptance tests.


Field Summary
static java.lang.String SITE_TITLE_SUFFIX
           
static java.lang.String TITLE_SEPARATOR
           
 
Fields inherited from class net.sourceforge.jwebunit.junit.WebTestCase
tester
 
Constructor Summary
AbstractAtlassianWebTestCase()
           
AbstractAtlassianWebTestCase(java.lang.String testName)
           
 
Method Summary
protected  void assertCollectionContainsKeyWithValue(java.util.Collection collection, java.lang.String key, java.lang.String value)
           
protected static void assertContains(java.lang.String expectedSubstring, java.lang.String actual)
           
protected static void assertDoesNotContain(java.lang.String unexpectedSubstring, java.lang.String actual)
           
 void assertElementNotPresentByXPath(java.lang.String string)
           
 void assertElementPresentByXPath(java.lang.String string)
           
protected static void assertEndsWith(java.lang.String expectedSuffix, java.lang.String actual)
           
 void assertLinkPresent(java.lang.String linkId)
           
 void assertLinkPresentWithHref(java.lang.String url)
           
 void assertLinkPresentWithImage(java.lang.String imageFileName)
           
 void assertLinkPresentWithText(java.lang.String string)
           
 void assertLinkPresentWithTextAndHref(java.lang.String text, java.lang.String href)
           
 void assertPageTitleEquals(java.lang.String pageTitle)
          Asserts that the title equals the passed pageTitle plus the site suffix (usually SITE_TITLE_SUFFIX)
e.g.
 void assertServerResponseContains(java.lang.String string)
           
 void assertServerResponseDoesNotContain(java.lang.String string)
           
protected static void assertStartsWith(java.lang.String expectedPrefix, java.lang.String actual)
           
 void assertStatusCode(int expectedStatus)
           
 void assertTextNotPresent(java.lang.String string)
           
 void assertTextsPresentInOrder(java.lang.String[] texts)
          Asserts that all the given texts appear in the current response in the order in which they appear in the array.
 void assertTextsPresentInOrder(java.lang.String[] expected, java.lang.String[] unexpected)
          Asserts that all the given expected texts appear in the current response in the order in which they appear in the array, with none of the unexpected Strings occurring in-between.
 void assertTitleEquals(java.lang.String s)
          Deprecated. Don't use directly, use assertPageTitleEquals(String) or assertTitleEquals(String, String)
 void assertTitleEquals(java.lang.String pageTitle, java.lang.String spaceTitle)
          Asserts that the title equals the passed pageTitle plus separator plus spaceTitle plus site suffix (usually SITE_TITLE_SUFFIX).
protected  java.lang.String getGroupFromResponse(java.lang.String pattern)
           
protected  void tearDown()
           
 
Methods inherited from class net.sourceforge.jwebunit.junit.WebTestCase
assertButtonNotPresent, assertButtonNotPresentWithText, assertButtonPresent, assertButtonPresentWithText, assertCheckboxNotPresent, assertCheckboxNotPresent, assertCheckboxNotSelected, assertCheckboxNotSelected, assertCheckboxPresent, assertCheckboxPresent, assertCheckboxSelected, assertCheckboxSelected, assertCookiePresent, assertCookieValueEquals, assertCookieValueMatch, assertDownloadedFileEquals, assertElementNotPresent, assertElementPresent, assertFormElementEmpty, assertFormElementEquals, assertFormElementMatch, assertFormElementNotPresent, assertFormElementPresent, assertFormNotPresent, assertFormNotPresent, assertFormPresent, assertFormPresent, assertFramePresent, assertHiddenFieldPresent, assertImagePresent, assertImageValid, assertImageValidAndStore, assertKeyInTable, assertKeyInTable, assertKeyNotInTable, assertKeyNotPresent, assertKeyNotPresent, assertKeyPresent, assertKeyPresent, assertKeysInTable, assertKeysInTable, assertLinkNotPresent, assertLinkNotPresentWithExactText, assertLinkNotPresentWithExactText, assertLinkNotPresentWithImage, assertLinkNotPresentWithText, assertLinkNotPresentWithText, assertLinkPresentWithExactText, assertLinkPresentWithExactText, assertLinkPresentWithText, assertMatch, assertMatchInElement, assertMatchInTable, assertMatchInTable, assertNoMatch, assertNoMatchInElement, assertNoMatchInTable, assertNoMatchInTable, assertRadioOptionNotPresent, assertRadioOptionNotSelected, assertRadioOptionPresent, assertRadioOptionSelected, assertResetButtonNotPresent, assertResetButtonNotPresent, assertResetButtonPresent, assertResetButtonPresent, assertSelectedOptionEquals, assertSelectedOptionMatches, assertSelectedOptionsEqual, assertSelectedOptionsMatch, assertSelectedOptionValueEquals, assertSelectedOptionValuesEqual, assertSelectOptionNotPresent, assertSelectOptionPresent, assertSelectOptionsEqual, assertSelectOptionsNotEqual, assertSelectOptionsPresent, assertSelectOptionValueNotPresent, assertSelectOptionValuePresent, assertSelectOptionValuesEqual, assertSelectOptionValuesNotEqual, assertSelectOptionValuesPresent, assertSubmitButtonNotPresent, assertSubmitButtonNotPresent, assertSubmitButtonPresent, assertSubmitButtonPresent, assertSubmitButtonPresent, assertTableEquals, assertTableEquals, assertTableMatch, assertTableMatch, assertTableNotPresent, assertTablePresent, assertTableRowCountEquals, assertTableRowsEqual, assertTableRowsEqual, assertTableRowsMatch, assertTableRowsMatch, assertTextFieldEquals, assertTextInElement, assertTextInTable, assertTextInTable, assertTextNotInElement, assertTextNotInTable, assertTextNotInTable, assertTextPresent, assertTitleEqualsKey, assertTitleEqualsKey, assertTitleMatch, assertWindowCountEquals, assertWindowPresent, assertWindowPresent, assertWindowPresentWithTitle, beginAt, checkCheckbox, checkCheckbox, clickButton, clickButtonWithText, clickElementByXPath, clickLink, clickLinkWithExactText, clickLinkWithExactText, clickLinkWithImage, clickLinkWithText, clickLinkWithText, clickRadioOption, closeBrowser, closeWindow, dumpCookies, dumpHtml, dumpHtml, dumpTable, dumpTable, getDialog, getElementAttributByXPath, getElementTextByXPath, getFormElementValue, getImage, getMessage, getMessage, getPageSource, getServeurResponse, getTable, getTestContext, getTester, getTestingEngineKey, gotoFrame, gotoPage, gotoRootWindow, gotoWindow, gotoWindow, gotoWindowByTitle, reset, runBare, saveAs, selectOption, selectOptionByValue, selectOptions, selectOptionsByValues, setDialog, setExpectedJavaScriptAlert, setExpectedJavaScriptAlert, setExpectedJavaScriptConfirm, setExpectedJavaScriptConfirm, setExpectedJavaScriptPrompt, setExpectedJavaScriptPrompt, setFormElement, setScriptingEnabled, setTestContext, setTestingEngineKey, setTextField, setWorkingForm, setWorkingForm, setWorkingForm, submit, submit, submit, uncheckCheckbox, uncheckCheckbox
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TITLE_SEPARATOR

public static final java.lang.String TITLE_SEPARATOR
See Also:
Constant Field Values

SITE_TITLE_SUFFIX

public static final java.lang.String SITE_TITLE_SUFFIX
See Also:
Constant Field Values
Constructor Detail

AbstractAtlassianWebTestCase

public AbstractAtlassianWebTestCase()

AbstractAtlassianWebTestCase

public AbstractAtlassianWebTestCase(java.lang.String testName)
Method Detail

tearDown

protected void tearDown()
                 throws java.lang.Exception
Overrides:
tearDown in class net.sourceforge.jwebunit.junit.WebTestCase
Throws:
java.lang.Exception

getGroupFromResponse

protected java.lang.String getGroupFromResponse(java.lang.String pattern)

assertPageTitleEquals

public void assertPageTitleEquals(java.lang.String pageTitle)
Asserts that the title equals the passed pageTitle plus the site suffix (usually SITE_TITLE_SUFFIX)
e.g. "Dashboard - Confluence"

Parameters:
pageTitle - The title displayed before the first separator

assertTitleEquals

public void assertTitleEquals(java.lang.String pageTitle,
                              java.lang.String spaceTitle)
Asserts that the title equals the passed pageTitle plus separator plus spaceTitle plus site suffix (usually SITE_TITLE_SUFFIX).
e.g. "Home - Test Space - Confluence"

Parameters:
pageTitle - The title displayed before the first separator
spaceTitle - The title displayed for the tested space

assertTitleEquals

public void assertTitleEquals(java.lang.String s)
Deprecated. Don't use directly, use assertPageTitleEquals(String) or assertTitleEquals(String, String)

Overrides:
assertTitleEquals in class net.sourceforge.jwebunit.junit.WebTestCase
Parameters:
s -

assertCollectionContainsKeyWithValue

protected void assertCollectionContainsKeyWithValue(java.util.Collection collection,
                                                    java.lang.String key,
                                                    java.lang.String value)
                                             throws java.lang.Exception
Throws:
java.lang.Exception

assertTextsPresentInOrder

public void assertTextsPresentInOrder(java.lang.String[] texts)
Asserts that all the given texts appear in the current response in the order in which they appear in the array.

Parameters:
texts - an array of strings expected to appear in the response

assertTextsPresentInOrder

public void assertTextsPresentInOrder(java.lang.String[] expected,
                                      java.lang.String[] unexpected)
Asserts that all the given expected texts appear in the current response in the order in which they appear in the array, with none of the unexpected Strings occurring in-between.

Parameters:
expected - an array of strings expected to appear in the response
unexpected - an array of string unexpected to appear in the response

assertElementPresentByXPath

public void assertElementPresentByXPath(java.lang.String string)
Overrides:
assertElementPresentByXPath in class net.sourceforge.jwebunit.junit.WebTestCase

assertTextNotPresent

public void assertTextNotPresent(java.lang.String string)
Overrides:
assertTextNotPresent in class net.sourceforge.jwebunit.junit.WebTestCase

assertElementNotPresentByXPath

public void assertElementNotPresentByXPath(java.lang.String string)
Overrides:
assertElementNotPresentByXPath in class net.sourceforge.jwebunit.junit.WebTestCase

assertLinkPresentWithText

public void assertLinkPresentWithText(java.lang.String string)
Overrides:
assertLinkPresentWithText in class net.sourceforge.jwebunit.junit.WebTestCase

assertLinkPresentWithImage

public void assertLinkPresentWithImage(java.lang.String imageFileName)
Overrides:
assertLinkPresentWithImage in class net.sourceforge.jwebunit.junit.WebTestCase

assertLinkPresent

public void assertLinkPresent(java.lang.String linkId)
Overrides:
assertLinkPresent in class net.sourceforge.jwebunit.junit.WebTestCase

assertLinkPresentWithHref

public void assertLinkPresentWithHref(java.lang.String url)

assertLinkPresentWithTextAndHref

public void assertLinkPresentWithTextAndHref(java.lang.String text,
                                             java.lang.String href)

assertStatusCode

public void assertStatusCode(int expectedStatus)

assertServerResponseContains

public void assertServerResponseContains(java.lang.String string)

assertServerResponseDoesNotContain

public void assertServerResponseDoesNotContain(java.lang.String string)

assertContains

protected static void assertContains(java.lang.String expectedSubstring,
                                     java.lang.String actual)

assertDoesNotContain

protected static void assertDoesNotContain(java.lang.String unexpectedSubstring,
                                           java.lang.String actual)

assertEndsWith

protected static void assertEndsWith(java.lang.String expectedSuffix,
                                     java.lang.String actual)

assertStartsWith

protected static void assertStartsWith(java.lang.String expectedPrefix,
                                       java.lang.String actual)


Copyright © 2003-2008 Atlassian Pty Ltd. All Rights Reserved.