|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
com.atlassian.confluence.ThreadLocalWebTestCase
com.atlassian.confluence.AbstractAtlassianWebTestCase
public abstract class AbstractAtlassianWebTestCase
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)
|
void |
assertElementNotPresentByXPath(String string)
Assert that an element with a given xpath is not present. |
void |
assertElementPresentByXPath(String string)
Assert that an element with a given xpath is present. |
protected static void |
assertEndsWith(String expectedSuffix,
String actual)
|
void |
assertLinkNotPresentWithHrefContaining(String urlSubstring)
|
void |
assertLinkPresent(String linkId)
Assert that a link with a given id is present in the response. |
void |
assertLinkPresentWithHref(String url)
|
void |
assertLinkPresentWithHrefContaining(String urlSubstring)
|
void |
assertLinkPresentWithImage(String imageFileName)
Assert that a link containing a specified image is present. |
void |
assertLinkPresentWithText(String string)
Assert that a link containing the supplied text is present. |
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 |
assertSubmitButtonNotPresent(String buttonName)
Assert that a submit button with a given name is not present. |
void |
assertTextInElement(String elementID,
String text)
Assert that a given element contains specific text. |
void |
assertTextNotPresent(String string)
Assert that supplied text is not present. |
void |
assertTextPresent(String text)
Assert that supplied text is present. |
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). |
void |
clickLinkWithText(String linkText)
Navigate by selection of a link containing given text. |
protected String |
getGroupFromResponse(String pattern)
|
void |
selectOptionByValue(String selectName,
String value)
Select an option with a given value in a select element. |
void |
setTextField(String inputName,
String value)
Set the value of a text or password input field. |
void |
setTextFieldUnlessBlank(String inputName,
String value)
|
| 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 |
|---|
protected final transient org.slf4j.Logger log
@Deprecated public static final String TITLE_SEPARATOR
@Deprecated public static final String SITE_TITLE_SUFFIX
| Constructor Detail |
|---|
public AbstractAtlassianWebTestCase()
public AbstractAtlassianWebTestCase(String testName)
| Method Detail |
|---|
protected String getGroupFromResponse(String pattern)
public void assertPageTitleEquals(String pageTitle)
pageTitle - The title displayed before the first separator
public void assertTitleEquals(String pageTitle,
String spaceTitle)
pageTitle - The title displayed before the first separatorspaceTitle - The title displayed for the tested spacepublic void assertTitleEquals(String s)
assertPageTitleEquals(String) or assertTitleEquals(String, String)
ThreadLocalWebTestCase
assertTitleEquals in class ThreadLocalWebTestCases - expected title value
protected void assertCollectionContainsKeyWithValue(Collection collection,
String key,
String value)
throws Exception
Exceptionpublic void assertTextsPresentInOrder(String... texts)
texts - an array of strings expected to appear in the response
public void assertTextsPresentInOrder(String[] expected,
String[] unexpected)
expected - an array of strings expected to appear in the responseunexpected - an array of string unexpected to appear in the responsepublic void assertTextPresentInPageSource(String text)
text - the text to look forpublic void assertElementPresentByXPath(String string)
ThreadLocalWebTestCase
assertElementPresentByXPath in class ThreadLocalWebTestCasestring - element xpath to test for.public void assertTextNotPresent(String string)
ThreadLocalWebTestCase
assertTextNotPresent in class ThreadLocalWebTestCasepublic void assertElementNotPresentByXPath(String string)
ThreadLocalWebTestCase
assertElementNotPresentByXPath in class ThreadLocalWebTestCasestring - element xpath to test for.public void assertLinkPresentWithText(String string)
ThreadLocalWebTestCase
assertLinkPresentWithText in class ThreadLocalWebTestCasepublic void assertLinkPresentWithImage(String imageFileName)
ThreadLocalWebTestCase
assertLinkPresentWithImage in class ThreadLocalWebTestCaseimageFileName - A suffix of the image's filename; for example, to match "images/my_icon.png",
you could just pass in "my_icon.png".public void assertLinkPresent(String linkId)
ThreadLocalWebTestCase
assertLinkPresent in class ThreadLocalWebTestCasepublic void assertTextPresent(String text)
ThreadLocalWebTestCase
assertTextPresent in class ThreadLocalWebTestCase
public void assertTextInElement(String elementID,
String text)
ThreadLocalWebTestCase
assertTextInElement in class ThreadLocalWebTestCaseelementID - id of element to be inspected.text - to check for.public void assertSubmitButtonNotPresent(String buttonName)
ThreadLocalWebTestCase
assertSubmitButtonNotPresent in class ThreadLocalWebTestCase
public void selectOptionByValue(String selectName,
String value)
ThreadLocalWebTestCase
selectOptionByValue in class ThreadLocalWebTestCaseselectName - name of select element.public void clickLinkWithText(String linkText)
ThreadLocalWebTestCase
clickLinkWithText in class ThreadLocalWebTestCaselinkText - Text in the link.public void assertLinkPresentWithHref(String url)
public void assertLinkPresentWithHrefContaining(String urlSubstring)
public void assertLinkNotPresentWithHrefContaining(String urlSubstring)
public void assertLinkPresentWithTextAndHref(String text,
String href)
public void setTextFieldUnlessBlank(String inputName,
String value)
public void setTextField(String inputName,
String value)
ThreadLocalWebTestCase
setTextField in class ThreadLocalWebTestCaseinputName - name of form element.value - value to set.public void assertStatusCode(int expectedStatus)
public void assertServerResponseContains(String string)
public void assertServerResponseDoesNotContain(String string)
protected static void assertContains(String expectedSubstring,
String actual)
protected static void assertDoesNotContain(String unexpectedSubstring,
String actual)
protected static void assertEndsWith(String expectedSuffix,
String actual)
protected static void assertStartsWith(String expectedPrefix,
String actual)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||