public interface

Assertions

com.atlassian.jira.functest.framework.assertions.Assertions
Known Indirect Subclasses

Class Overview

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.

Summary

Public Methods
void assertEquals(String failureMesg, List expected, List actual)
void assertLastChangeHistoryRecords(String issueKey, List expectedChangeHistoryRecords)
Useful to check that a number of change history items exist for a given issue.
void assertLastChangeHistoryRecords(String issueKey, ExpectedChangeHistoryRecord expectedChangeHistoryRecord)
Useful to check that a particular change history item exists 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(String xpath)
Asserts that a node does not exist under the xpath expression given
void assertNodeDoesNotExist(Locator locator)
Asserts that a given node does not exists
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(String xpath, String textToTest)
Asserts that a node under the xpath expression given contains the given text
void assertNodeHasText(Locator locator, String textToTest)
Asserts that a given node 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(TestCase testCase, WebTester tester, Throwable cause)
This method is deprecated. not strictly deprecated but shouldn't be used in the code you check into main repo.
JiraFormAssertions forms()
Form assertions.
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()
HTML assertions.
LinkAssertions link()
Link assertions.
TextAssertions text()
Text assertions.

Public Methods

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

public 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 com.atlassian.jira.webtests.ztests.workflow.ExpectedChangeHistoryRecords

public void assertLastChangeHistoryRecords (String issueKey, ExpectedChangeHistoryRecord expectedChangeHistoryRecord)

Useful to check that a particular change history item exists for a given issue.

Parameters
issueKey The issue to check
expectedChangeHistoryRecord A com.atlassian.jira.webtests.ztests.workflow.ExpectedChangeHistoryRecord item

public void assertNodeByIdDoesNotExist (String id)

Asserts that a given node does not exists

Parameters
id the id of the node

public 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

public 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

public void assertNodeByIdExists (String id)

Asserts that a given node exists

Parameters
id the id of the node

public 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

public void assertNodeDoesNotExist (String xpath)

Asserts that a node does not exist under the xpath expression given

Parameters
xpath The xpath expression to evaluate

public void assertNodeDoesNotExist (Locator locator)

Asserts that a given node does not exists

Parameters
locator the locator for the node

public 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

public 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

public 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

public void assertNodeExists (Locator locator)

Asserts that a given node exists

Parameters
locator the locator for the node

public void assertNodeExists (String xpath)

Asserts that a node exists under the xpath expression given

Parameters
xpath The xpath expression to evaluate

public 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

public 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

public 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).

public 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

public 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.

public void dumpResponse (TestCase testCase, WebTester tester, Throwable cause)

This method is deprecated.
not strictly deprecated but shouldn't be used in the code you check into main repo.

This will "dump" the current contents of the net.sourceforge.jwebunit.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

public JiraFormAssertions forms ()

Form assertions. Shortcut for getJiraFormAssertions().

Returns
  • form assertions

public DashboardAssertions getDashboardAssertions ()

Returns
  • an object that can be used to make assertions about Dashboard pages

public 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.

public JiraFormAssertions getJiraFormAssertions ()

Returns
  • an object that can be used to make assertions about JIRA forms

public JiraMessageAssertions getJiraMessageAssertions ()

Returns
  • an object that can be used to make assertions about JIRA messages

public LabelAssertions getLabelAssertions ()

Returns
  • an object that can be used to make assertions about labels.

public LinkAssertions getLinkAssertions ()

Returns
  • an object that can be used to make assertions about links.

public TableAssertions getTableAssertions ()

Returns
  • an object that can be used to make assertions about tables.

public TextAssertions getTextAssertions ()

Returns
  • an object that can be used for text assertions.

public URLAssertions getURLAssertions ()

Returns
  • an object that can be used to make assertions about the current JIRA url.

public UserAssertions getUserAssertions ()

Returns
  • an object that can be used to make assertions about users.

public 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.

public HTMLAssertions html ()

HTML assertions.

Returns
  • HTML assertions.

public LinkAssertions link ()

Link assertions. Shortcut for getLinkAssertions().

Returns
  • link assertions.

public TextAssertions text ()

Text assertions. Shortcut for getTextAssertions().

Returns
  • text assertions.