com.atlassian.confluence
Class AbstractAtlassianWebTestCase

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

public abstract class AbstractAtlassianWebTestCase
extends ThreadLocalWebTestCase

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


Field Summary
protected  org.slf4j.Logger log
           
static String SITE_TITLE_SUFFIX
          Deprecated. since 3.1 use ConfluencePage.SITE_TITLE_SUFFIX
static String TITLE_SEPARATOR
          Deprecated. since 3.1 use ConfluencePage.TITLE_SEPARATOR
 
Constructor Summary
AbstractAtlassianWebTestCase()
           
AbstractAtlassianWebTestCase(String testName)
           
 
Method Summary
protected  void assertCollectionContainsKeyWithValue(Collection collection, String key, String value)
           
protected static void assertContains(String expectedSubstring, String actual)
           
protected static void assertDoesNotContain(String unexpectedSubstring, String actual)
           
protected static void assertEndsWith(String expectedSuffix, String actual)
           
 void assertLinkNotPresentWithHrefContaining(String urlSubstring)
           
 void assertLinkPresentWithHref(String url)
           
 void assertLinkPresentWithHrefContaining(String urlSubstring)
           
 void assertLinkPresentWithTextAndHref(String text, String href)
           
 void assertPageTitleEquals(String pageTitle)
          Asserts that the title equals the passed pageTitle plus the site suffix (usually SITE_TITLE_SUFFIX)
e.g.
 void assertServerResponseContains(String string)
           
 void assertServerResponseDoesNotContain(String string)
           
protected static void assertStartsWith(String expectedPrefix, String actual)
           
 void assertStatusCode(int expectedStatus)
           
 void assertTextPresentInPageSource(String text)
          Asserts that the given text is in the page source.
 void assertTextsPresentInOrder(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(String[] expected, 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(String s)
          Deprecated. Don't use directly, use assertPageTitleEquals(String) or assertTitleEquals(String, String)
 void assertTitleEquals(String pageTitle, String spaceTitle)
          Asserts that the title equals the passed pageTitle plus separator plus spaceTitle plus site suffix (usually SITE_TITLE_SUFFIX).
protected  String getGroupFromResponse(String pattern)
           
 void setTextFieldUnlessBlank(String inputName, String value)
           
 
Methods inherited from class com.atlassian.confluence.ThreadLocalWebTestCase
assertButtonNotPresent, assertButtonNotPresentWithText, assertButtonPresent, assertButtonPresentWithText, assertCheckboxNotPresent, assertCheckboxNotPresent, assertCheckboxNotSelected, assertCheckboxNotSelected, assertCheckboxPresent, assertCheckboxPresent, assertCheckboxSelected, assertCheckboxSelected, assertCookiePresent, assertCookieValueEquals, assertCookieValueMatch, assertDownloadedFileEquals, assertElementNotPresent, assertElementNotPresentByXPath, assertElementPresent, assertElementPresentByXPath, 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, assertLinkPresent, assertLinkPresentWithExactText, assertLinkPresentWithExactText, assertLinkPresentWithImage, assertLinkPresentWithText, 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, assertTextNotPresent, 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, removeThreadLocal, reset, runBare, saveAs, selectOption, selectOptionByValue, selectOptions, selectOptionsByValues, setDialog, setExpectedJavaScriptAlert, setExpectedJavaScriptAlert, setExpectedJavaScriptConfirm, setExpectedJavaScriptConfirm, setExpectedJavaScriptPrompt, setExpectedJavaScriptPrompt, setFormElement, setScriptingEnabled, setTestContext, setTester, setTestingEngineKey, setTextField, setWorkingForm, setWorkingForm, setWorkingForm, submit, submit, submit, tearDown, 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

log

protected final transient org.slf4j.Logger log

TITLE_SEPARATOR

@Deprecated
public static final String TITLE_SEPARATOR
Deprecated. since 3.1 use ConfluencePage.TITLE_SEPARATOR
See Also:
Constant Field Values

SITE_TITLE_SUFFIX

@Deprecated
public static final String SITE_TITLE_SUFFIX
Deprecated. since 3.1 use ConfluencePage.SITE_TITLE_SUFFIX
See Also:
Constant Field Values
Constructor Detail

AbstractAtlassianWebTestCase

public AbstractAtlassianWebTestCase()

AbstractAtlassianWebTestCase

public AbstractAtlassianWebTestCase(String testName)
Method Detail

getGroupFromResponse

protected String getGroupFromResponse(String pattern)

assertPageTitleEquals

public void assertPageTitleEquals(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(String pageTitle,
                              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(String s)
Deprecated. Don't use directly, use assertPageTitleEquals(String) or assertTitleEquals(String, String)

Description copied from class: ThreadLocalWebTestCase
Assert title of current html page in conversation matches an expected value.

Overrides:
assertTitleEquals in class ThreadLocalWebTestCase
Parameters:
s - expected title value

assertCollectionContainsKeyWithValue

protected void assertCollectionContainsKeyWithValue(Collection collection,
                                                    String key,
                                                    String value)
                                             throws Exception
Throws:
Exception

assertTextsPresentInOrder

public void assertTextsPresentInOrder(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(String[] expected,
                                      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

assertTextPresentInPageSource

public void assertTextPresentInPageSource(String text)
Asserts that the given text is in the page source. Useful for testing non-html responses where assertTextPresent doesn't work.

Parameters:
text - the text to look for

assertLinkPresentWithHref

public void assertLinkPresentWithHref(String url)

assertLinkPresentWithHrefContaining

public void assertLinkPresentWithHrefContaining(String urlSubstring)

assertLinkNotPresentWithHrefContaining

public void assertLinkNotPresentWithHrefContaining(String urlSubstring)

assertLinkPresentWithTextAndHref

public void assertLinkPresentWithTextAndHref(String text,
                                             String href)

setTextFieldUnlessBlank

public void setTextFieldUnlessBlank(String inputName,
                                    String value)

assertStatusCode

public void assertStatusCode(int expectedStatus)

assertServerResponseContains

public void assertServerResponseContains(String string)

assertServerResponseDoesNotContain

public void assertServerResponseDoesNotContain(String string)

assertContains

protected static void assertContains(String expectedSubstring,
                                     String actual)

assertDoesNotContain

protected static void assertDoesNotContain(String unexpectedSubstring,
                                           String actual)

assertEndsWith

protected static void assertEndsWith(String expectedSuffix,
                                     String actual)

assertStartsWith

protected static void assertStartsWith(String expectedPrefix,
                                       String actual)


Copyright © 2003-2011 Atlassian. All Rights Reserved.