|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.confluence.htmlunit.WebTesterAssertions
public class WebTesterAssertions
Assertions that revolve around a WebTester
Constructor Summary | |
---|---|
WebTesterAssertions()
|
Method Summary | |
---|---|
static void |
assertAtLoginPage(java.lang.String reason)
|
static void |
assertAtLoginPage(java.lang.String reason,
net.sourceforge.jwebunit.junit.WebTester tester)
|
static void |
assertDoesNotContain(java.lang.String unexpectedSubstring,
java.lang.String actual)
|
static void |
assertImageIsPresentWithSrcUrlThatContains(java.lang.String imageName)
Provide our own implementation of JWebUnit.assertImagePresent(String, String) that asserts the image name with
a contains check rather than equals. |
static void |
assertIsLoggedInAs(User user)
|
static void |
assertLinkNotPresentWithHrefContaining(java.lang.String urlSubstring)
|
static void |
assertLinkPresentWithHref(java.lang.String url)
|
static void |
assertLinkPresentWithHrefContaining(java.lang.String urlSubstring)
|
static void |
assertLinkPresentWithTextAndHref(java.lang.String text,
java.lang.String href)
|
static void |
assertPageAndSpaceTitle(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). |
static void |
assertPageAndSpaceTitle(java.lang.String reason,
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). |
static void |
assertPageTitle(java.lang.String pageTitle)
Asserts that the title equals the passed pageTitle plus the site suffix (usually SITE_TITLE_SUFFIX) e.g. |
static void |
assertPageTitle(java.lang.String reason,
java.lang.String pageTitle)
Asserts that the title equals the passed pageTitle plus the site suffix (usually SITE_TITLE_SUFFIX) e.g. |
static void |
assertPageTitleEquals(java.lang.String reason,
net.sourceforge.jwebunit.junit.WebTester webTester,
java.lang.String pageTitle)
Asserts that the title equals the passed pageTitle plus the site suffix (usually SITE_TITLE_SUFFIX) e.g. |
static void |
assertPageTitleEquals(net.sourceforge.jwebunit.junit.WebTester webTester,
java.lang.String pageTitle)
Asserts that the title equals the passed pageTitle plus the site suffix (usually SITE_TITLE_SUFFIX) e.g. |
static void |
assertServerResponseContains(java.lang.String string)
|
static void |
assertStartsWith(java.lang.String expectedPrefix,
java.lang.String actual)
|
static void |
assertStatusCode(int expectedStatus)
|
static void |
assertStatusCode(int expectedStatus,
java.lang.String failureMessage)
Assert the status code and should the assertion fail then include the supplied failure message. |
static void |
assertTextNotPresentInPageSource(java.lang.String text)
|
static void |
assertTextPresentInPageSource(java.lang.String text)
Asserts that the given text is in the page source. |
static 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. |
static 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. |
static void |
assertTitleEquals(java.lang.String reason,
net.sourceforge.jwebunit.junit.WebTester webTester,
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). |
static void |
assertTitleEquals(net.sourceforge.jwebunit.junit.WebTester webTester,
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). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WebTesterAssertions()
Method Detail |
---|
public static void assertPageTitleEquals(net.sourceforge.jwebunit.junit.WebTester webTester, java.lang.String pageTitle)
webTester
- The WebTesterpageTitle
- The title displayed before the first separatorpublic static void assertPageTitleEquals(java.lang.String reason, net.sourceforge.jwebunit.junit.WebTester webTester, java.lang.String pageTitle)
reason
- additional information about any assertion failurewebTester
- The WebTesterpageTitle
- The title displayed before the first separatorpublic static void assertTitleEquals(net.sourceforge.jwebunit.junit.WebTester webTester, java.lang.String pageTitle, java.lang.String spaceTitle)
webTester
- The WebTesterpageTitle
- The title displayed before the first separatorspaceTitle
- The title displayed for the tested spacepublic static void assertTitleEquals(java.lang.String reason, net.sourceforge.jwebunit.junit.WebTester webTester, java.lang.String pageTitle, java.lang.String spaceTitle)
reason
- additional information about any assertion failurewebTester
- The WebTesterpageTitle
- The title displayed before the first separatorspaceTitle
- The title displayed for the tested spacepublic static void assertPageTitle(java.lang.String pageTitle)
pageTitle
- The title displayed before the first separatorpublic static void assertPageTitle(java.lang.String reason, java.lang.String pageTitle)
reason
- additional information about any assertion failurepageTitle
- The title displayed before the first separatorpublic static void assertPageAndSpaceTitle(java.lang.String pageTitle, java.lang.String spaceTitle)
pageTitle
- The title displayed before the first separatorspaceTitle
- The title displayed for the tested spacepublic static void assertPageAndSpaceTitle(java.lang.String reason, java.lang.String pageTitle, java.lang.String spaceTitle)
reason
- additional information about any assertion failurepageTitle
- The title displayed before the first separatorspaceTitle
- The title displayed for the tested spacepublic static void assertTextsPresentInOrder(java.lang.String... texts)
texts
- an array of strings expected to appear in the responsepublic static void assertTextsPresentInOrder(java.lang.String[] expected, java.lang.String[] unexpected)
expected
- an array of strings expected to appear in the responseunexpected
- an array of string unexpected to appear in the responsepublic static void assertTextPresentInPageSource(java.lang.String text)
text
- the text to look forpublic static void assertTextNotPresentInPageSource(java.lang.String text)
public static void assertLinkPresentWithHref(java.lang.String url)
public static void assertLinkPresentWithHrefContaining(java.lang.String urlSubstring)
public static void assertLinkNotPresentWithHrefContaining(java.lang.String urlSubstring)
public static void assertLinkPresentWithTextAndHref(java.lang.String text, java.lang.String href)
public static void assertStatusCode(int expectedStatus)
public static void assertStatusCode(int expectedStatus, java.lang.String failureMessage)
expectedStatus
- the status to assert forfailureMessage
- the message to include should the assertion failpublic static void assertServerResponseContains(java.lang.String string)
public static void assertDoesNotContain(java.lang.String unexpectedSubstring, java.lang.String actual)
public static void assertStartsWith(java.lang.String expectedPrefix, java.lang.String actual)
public static void assertIsLoggedInAs(User user)
public static void assertAtLoginPage(java.lang.String reason) throws java.net.URISyntaxException
java.net.URISyntaxException
public static void assertAtLoginPage(java.lang.String reason, net.sourceforge.jwebunit.junit.WebTester tester) throws java.net.URISyntaxException
java.net.URISyntaxException
public static void assertImageIsPresentWithSrcUrlThatContains(java.lang.String imageName)
JWebUnit.assertImagePresent(String, String)
that asserts the image name with
a contains check rather than equals.
imageName
- The path to the image (i.e. the src attribute value)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |