com.atlassian.jira.functest.framework.assertions
Interface Assertions

All Known Implementing Classes:
AssertionsImpl

public interface Assertions

A set of "extended" assertions within JIRA web functional testing. Also note we have a very similar interface called TextAssertions that deals with text assertions specifically.

Since:
v3.13

Method Summary
 void assertEquals(String failureMesg, List expected, List actual)
           
 void assertLastChangeHistoryRecords(String issueKey, com.atlassian.jira.webtests.ztests.workflow.ExpectedChangeHistoryRecord expectedChangeHistoryRecord)
          Useful to check that a particular change history item exists for a given issue.
 void assertLastChangeHistoryRecords(String issueKey, List expectedChangeHistoryRecords)
          Useful to check that a number of change history items exist for a given issue.
 void assertNodeByIdDoesNotExist(String id)
          Asserts that a given node does not exists
 void assertNodeByIdDoesNotHaveText(String id, String textToTest)
          Asserts that a given node exists but does not contain the given text
 void assertNodeByIdEquals(String id, String textToTest)
          Asserts that a given node exactly equals the given text
 void assertNodeByIdExists(String id)
          Asserts that a given node exists
 void assertNodeByIdHasText(String id, String textToTest)
          Asserts that a given node contains the given text
 void assertNodeDoesNotExist(Locator locator)
          Asserts that a given node does not exists
 void assertNodeDoesNotExist(String xpath)
          Asserts that a node does not exist under the xpath expression given
 void assertNodeDoesNotHaveText(Locator locator, String textToTest)
          Asserts that a given node exists but does not contain the given text
 void assertNodeDoesNotHaveText(String xpath, String textToTest)
          Asserts that a node under the xpath expression given does not contain the given text
 void assertNodeEquals(Locator locator, String textToTest)
          Asserts that a given node exactly equals the given text
 void assertNodeExists(Locator locator)
          Asserts that a given node exists
 void assertNodeExists(String xpath)
          Asserts that a node exists under the xpath expression given
 void assertNodeHasText(Locator locator, String textToTest)
          Asserts that a given node contains the given text
 void assertNodeHasText(String xpath, String textToTest)
          Asserts that a node under the xpath expression given contains the given text
 void assertProfileLinkPresent(String id, String linkText)
          Checks that a profile link with the given ID and link Text exists on the page.
 void assertSubmitButtonPresentWithText(String buttonId, String buttonText)
          Check that the button with the id provided has the text provided as its value.
 CommentAssertions comments(Iterable<String> comments)
          Returns an object that can be used to make assertions on a specified group of comments.
 void dumpResponse(junit.framework.TestCase testCase, net.sourceforge.jwebunit.WebTester tester, Throwable cause)
          This will "dump" the current contents of the WebTester including the Throwable 'cause'.
 DashboardAssertions getDashboardAssertions()
           
 IssueNavigatorAssertions getIssueNavigatorAssertions()
          Return an object that can be used to make assertions about the navigator.
 JiraFormAssertions getJiraFormAssertions()
           
 JiraMessageAssertions getJiraMessageAssertions()
           
 LabelAssertions getLabelAssertions()
           
 LinkAssertions getLinkAssertions()
           
 TableAssertions getTableAssertions()
           
 TextAssertions getTextAssertions()
           
 URLAssertions getURLAssertions()
           
 UserAssertions getUserAssertions()
           
 ViewIssueAssertions getViewIssueAssertions()
          Returns an object that can be used to make assertions on the "View Issue" page.
 HTMLAssertions html()
           
 

Method Detail

dumpResponse

void dumpResponse(junit.framework.TestCase testCase,
                  net.sourceforge.jwebunit.WebTester tester,
                  Throwable cause)
This will "dump" the current contents of the WebTester including the Throwable 'cause'.

DONT LEAVE THESE CALLS IN THE TESTS. You should really only use this if you are debugging your test code. if you dont remove them, then you will generate "unwarranted" test artifacts in Bamboo.

Parameters:
testCase - the TestCase in play
tester - the WebTester in play
cause - an optional cause for dumping the response

assertLastChangeHistoryRecords

void assertLastChangeHistoryRecords(String issueKey,
                                    com.atlassian.jira.webtests.ztests.workflow.ExpectedChangeHistoryRecord expectedChangeHistoryRecord)
Useful to check that a particular change history item exists for a given issue.

Parameters:
issueKey - The issue to check
expectedChangeHistoryRecord - A ExpectedChangeHistoryRecord item

assertLastChangeHistoryRecords

void assertLastChangeHistoryRecords(String issueKey,
                                    List expectedChangeHistoryRecords)
Useful to check that a number of change history items exist for a given issue.

Parameters:
issueKey - The issue to check
expectedChangeHistoryRecords - A list of ExpectedChangeHistoryRecords

getIssueNavigatorAssertions

IssueNavigatorAssertions getIssueNavigatorAssertions()
Return an object that can be used to make assertions about the navigator.

Returns:
an object that can be used to make assertions about the navigator.

getViewIssueAssertions

ViewIssueAssertions getViewIssueAssertions()
Returns an object that can be used to make assertions on the "View Issue" page.

It is assumed that you are already on the View Issue page. If not, then use something like navigation.issue().viewIssue("RAT-1") to get to the required Issue.

Returns:
an object that can be used to make assertions on the "View Issue" page.
See Also:
IssueNavigation.viewIssue(String)

getDashboardAssertions

DashboardAssertions getDashboardAssertions()
Returns:
an object that can be used to make assertions about Dashboard pages

getJiraFormAssertions

JiraFormAssertions getJiraFormAssertions()
Returns:
an object that can be used to make assertions about JIRA forms

getJiraMessageAssertions

JiraMessageAssertions getJiraMessageAssertions()
Returns:
an object that can be used to make assertions about JIRA messages

getURLAssertions

URLAssertions getURLAssertions()
Returns:
an object that can be used to make assertions about the current JIRA url.

getTextAssertions

TextAssertions getTextAssertions()
Returns:
an object that can be used for text assertions.

getLinkAssertions

LinkAssertions getLinkAssertions()
Returns:
an object that can be used to make assertions about links.

getLabelAssertions

LabelAssertions getLabelAssertions()
Returns:
an object that can be used to make assertions about labels.

getUserAssertions

UserAssertions getUserAssertions()
Returns:
an object that can be used to make assertions about users.

getTableAssertions

TableAssertions getTableAssertions()
Returns:
an object that can be used to make assertions about tables.

assertEquals

void assertEquals(String failureMesg,
                  List expected,
                  List actual)

assertProfileLinkPresent

void assertProfileLinkPresent(String id,
                              String linkText)
Checks that a profile link with the given ID and link Text exists on the page. Also clicks the link and checks that the user's profile with linkText shows up.

Parameters:
id - The id of the profileLink
linkText - The Text of the profileLink (usually the user's full name).

assertNodeExists

void assertNodeExists(String xpath)
Asserts that a node exists under the xpath expression given

Parameters:
xpath - The xpath expression to evaluate

assertNodeDoesNotExist

void assertNodeDoesNotExist(String xpath)
Asserts that a node does not exist under the xpath expression given

Parameters:
xpath - The xpath expression to evaluate

assertNodeHasText

void assertNodeHasText(String xpath,
                       String textToTest)
Asserts that a node under the xpath expression given contains the given text

Parameters:
xpath - The xpath expression to evaluate
textToTest - The text to test for

assertNodeDoesNotHaveText

void assertNodeDoesNotHaveText(String xpath,
                               String textToTest)
Asserts that a node under the xpath expression given does not contain the given text

Parameters:
xpath - The xpath expression to evaluate
textToTest - The text to test for

assertNodeByIdExists

void assertNodeByIdExists(String id)
Asserts that a given node exists

Parameters:
id - the id of the node

assertNodeByIdDoesNotExist

void assertNodeByIdDoesNotExist(String id)
Asserts that a given node does not exists

Parameters:
id - the id of the node

assertNodeByIdEquals

void assertNodeByIdEquals(String id,
                          String textToTest)
Asserts that a given node exactly equals the given text

Parameters:
id - The id of the node to test
textToTest - The text to test for

assertNodeByIdHasText

void assertNodeByIdHasText(String id,
                           String textToTest)
Asserts that a given node contains the given text

Parameters:
id - The id of the node to test
textToTest - The text to test for

assertNodeByIdDoesNotHaveText

void assertNodeByIdDoesNotHaveText(String id,
                                   String textToTest)
Asserts that a given node exists but does not contain the given text

Parameters:
id - The id of the node to test
textToTest - The text to test for

assertNodeExists

void assertNodeExists(Locator locator)
Asserts that a given node exists

Parameters:
locator - the locator for the node

assertNodeDoesNotExist

void assertNodeDoesNotExist(Locator locator)
Asserts that a given node does not exists

Parameters:
locator - the locator for the node

assertNodeEquals

void assertNodeEquals(Locator locator,
                      String textToTest)
Asserts that a given node exactly equals the given text

Parameters:
locator - The locator that contains text
textToTest - The text to test for

assertNodeHasText

void assertNodeHasText(Locator locator,
                       String textToTest)
Asserts that a given node contains the given text

Parameters:
locator - The locator that contains text
textToTest - The text to test for

assertNodeDoesNotHaveText

void assertNodeDoesNotHaveText(Locator locator,
                               String textToTest)
Asserts that a given node exists but does not contain the given text

Parameters:
locator - The locator to test
textToTest - The text to test for

assertSubmitButtonPresentWithText

void assertSubmitButtonPresentWithText(String buttonId,
                                       String buttonText)
Check that the button with the id provided has the text provided as its value.

Parameters:
buttonId - The id of the button to locate
buttonText - The text the button should contain as its value

comments

CommentAssertions comments(Iterable<String> comments)
Returns an object that can be used to make assertions on a specified group of comments.

Parameters:
comments - The comments that will be used in the assertions.
Returns:
a {CommentAssertions} object that can be used to make assertions on a specified group of comments.

html

HTMLAssertions html()


Copyright © 2002-2011 Atlassian. All Rights Reserved.