public class

AssertionsImpl

extends AbstractFuncTestUtil
implements Assertions
java.lang.Object
   ↳ com.atlassian.jira.functest.framework.AbstractFuncTestUtil
     ↳ com.atlassian.jira.functest.framework.assertions.AssertionsImpl

Class Overview

Implementation of Assertions

Summary

[Expand]
Inherited Fields
From class com.atlassian.jira.functest.framework.AbstractFuncTestUtil
Public Constructors
AssertionsImpl(WebTester tester, JIRAEnvironmentData environmentData, Navigation navigation, LocatorFactory locator)
Public Methods
void assertEquals(String failureMessage, List expected, List actual)
Elaboration of assertEquals for lists with nicer messages.
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 will "dump" the current contents of the net.sourceforge.jwebunit.WebTester including the Throwable 'cause'.
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.
[Expand]
Inherited Methods
From class com.atlassian.jira.functest.framework.AbstractFuncTestUtil
From class java.lang.Object
From interface com.atlassian.jira.functest.framework.assertions.Assertions
From interface com.atlassian.jira.testkit.client.log.FuncTestLogger

Public Constructors

public AssertionsImpl (WebTester tester, JIRAEnvironmentData environmentData, Navigation navigation, LocatorFactory locator)

Public Methods

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

Elaboration of assertEquals for lists with nicer messages.

Parameters
failureMessage The message (prefix) to use to describe a failure.
expected the expected list.
actual the actual list to be tested.

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 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 ()

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 ()

public JiraMessageAssertions getJiraMessageAssertions ()

public LabelAssertions getLabelAssertions ()

public LinkAssertions getLinkAssertions ()

public TableAssertions getTableAssertions ()

public TextAssertions getTextAssertions ()

public URLAssertions getURLAssertions ()

public UserAssertions getUserAssertions ()

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.