public interface

TextAssertions

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

Class Overview

Contains a number of methods that do "extended" functional test assertions involving text.

See Also

Summary

Public Methods
void assertAtLeastOneTextPresent(Locator locator, String option1, String... options)
Asserts that at least one of the provided text strings is present in the locator.
void assertEqualDateStrings(String expected, String actual)
void assertRegexMatch(String srcText, String regexPattern)
This asserets that the regular expression pattern 'regexPattern' has at least one match somewhere inside 'srcText'
void assertRegexMatch(Locator locator, String regexPattern)
Synonym for assertRegexMatch(String, String) that calls getText() on the provided locator.
void assertRegexNoMatch(Locator locator, String regexPattern)
Synonym for assertRegexNoMatch(String, String) that calls getText() on the provided locator.
void assertRegexNoMatch(String srcText, String regexPattern)
This asserets that the regular expression pattern 'regexPattern' has NO match somewhere inside 'srcText'
void assertTextNotPresent(Locator locator, String expectedText)
Synonym for assertTextNotPresent(String, String) that calls getText() on the provided locator.
void assertTextNotPresent(String srcText, String expectedText)
Asserts that 'expectedText' can NOT be found in 'srcText'.
void assertTextNotPresent(String text)
Asserts that the given text cannot be found in the current page.
void assertTextPresent(String expectedText)
Asserts that 'expectedText' can be found in the current page.
void assertTextPresent(String srcText, String expectedText)
Asserts that 'expectedText' can be found in 'srcText'.
void assertTextPresent(Locator locator, String expectedText)
Synonym for assertTextPresent(String, String) that calls getText() on the provided locator.
void assertTextPresentHtmlEncoded(String expectedText)
Asserts that 'expectedText' can be found in the current page in a "HTML Encoded" form.
void assertTextPresentNumOccurences(String expectedText, int numOccurences)
Asserts that 'expectedText' can be found in the current page exactly 'numOccurences' times.
void assertTextPresentNumOccurences(String srcText, String expectedText, int numOccurences)
Asserts that 'expectedText' can be found in 'srcText' exactly 'numOccurences' times.
void assertTextPresentNumOccurences(Locator locator, String expectedText, int numOccurences)
Synonym for assertTextPresentNumOccurences(String, String, int) that calls getText() on the provided locator.
void assertTextSequence(String srcText, String[] expectedTextSequence)
Asserts that the text sequence 'expectedTextSequence' can be found in 'srcText'
void assertTextSequence(Locator locator, String[] expectedTextSequence)
Synonym for assertTextSequence(String, String[]) that calls getText() on the provided locator.
void assertTextSequence(Locator locator, String expected1, String... expected2)
Synonym for assertTextSequence(String, String[]) that calls getText() on the provided locator.
void assertTextSequence(String srcText, String expected1, String... expected2)
Asserts that the text sequence 'expectedTextSequence' can be found in 'srcText'

Public Methods

public void assertAtLeastOneTextPresent (Locator locator, String option1, String... options)

Asserts that at least one of the provided text strings is present in the locator. Will throw an AssertionError if none are present.

Parameters
locator the source of the text
option1 the expected text
options the expected texts

public void assertEqualDateStrings (String expected, String actual)

public void assertRegexMatch (String srcText, String regexPattern)

This asserets that the regular expression pattern 'regexPattern' has at least one match somewhere inside 'srcText'

Parameters
srcText the text source to do the matching in
regexPattern the regex pattern

public void assertRegexMatch (Locator locator, String regexPattern)

Synonym for assertRegexMatch(String, String) that calls getText() on the provided locator.

Parameters
locator the source of the teext
regexPattern the regex pattern

public void assertRegexNoMatch (Locator locator, String regexPattern)

Synonym for assertRegexNoMatch(String, String) that calls getText() on the provided locator.

Parameters
locator the source of the teext
regexPattern the regex pattern

public void assertRegexNoMatch (String srcText, String regexPattern)

This asserets that the regular expression pattern 'regexPattern' has NO match somewhere inside 'srcText'

Parameters
srcText the text source to do the matching in
regexPattern the regex pattern

public void assertTextNotPresent (Locator locator, String expectedText)

Synonym for assertTextNotPresent(String, String) that calls getText() on the provided locator.

Parameters
locator the source of the text
expectedText the expected text

public void assertTextNotPresent (String srcText, String expectedText)

Asserts that 'expectedText' can NOT be found in 'srcText'.

Parameters
srcText the text to search in
expectedText the expected text

public void assertTextNotPresent (String text)

Asserts that the given text cannot be found in the current page.

Parameters
text the expected text

public void assertTextPresent (String expectedText)

Asserts that 'expectedText' can be found in the current page.

Parameters
expectedText the expected text

public void assertTextPresent (String srcText, String expectedText)

Asserts that 'expectedText' can be found in 'srcText'.

Parameters
srcText the text to search in
expectedText the expected text

public void assertTextPresent (Locator locator, String expectedText)

Synonym for assertTextPresent(String, String) that calls getText() on the provided locator.

Parameters
locator the source of the text
expectedText the expected text

public void assertTextPresentHtmlEncoded (String expectedText)

Asserts that 'expectedText' can be found in the current page in a "HTML Encoded" form.

The encoding expects <, >, ", ', and & to be encoded to appropriate HTML encoding.

Parameters
expectedText the expected text

public void assertTextPresentNumOccurences (String expectedText, int numOccurences)

Asserts that 'expectedText' can be found in the current page exactly 'numOccurences' times.

Parameters
expectedText the expected text
numOccurences the number of times the expected text should occur; must be greater than 0.

public void assertTextPresentNumOccurences (String srcText, String expectedText, int numOccurences)

Asserts that 'expectedText' can be found in 'srcText' exactly 'numOccurences' times.

Parameters
srcText the text to search in
expectedText the expected text
numOccurences the number of times the expected text should occur; must be greater than 0.

public void assertTextPresentNumOccurences (Locator locator, String expectedText, int numOccurences)

Synonym for assertTextPresentNumOccurences(String, String, int) that calls getText() on the provided locator.

Parameters
locator the source of the text
expectedText the expected text
numOccurences the number of times the expected text should occur; must be greater than 0.

public void assertTextSequence (String srcText, String[] expectedTextSequence)

Asserts that the text sequence 'expectedTextSequence' can be found in 'srcText'

Parameters
srcText the text to search in
expectedTextSequence the expected text sequence

public void assertTextSequence (Locator locator, String[] expectedTextSequence)

Synonym for assertTextSequence(String, String[]) that calls getText() on the provided locator.

Parameters
locator the source of the text
expectedTextSequence the expected text sequence

public void assertTextSequence (Locator locator, String expected1, String... expected2)

Synonym for assertTextSequence(String, String[]) that calls getText() on the provided locator.

Parameters
locator the source of the text
expected1 the first expected text in the sequence
expected2 the rest of expected texts in the sequence

public void assertTextSequence (String srcText, String expected1, String... expected2)

Asserts that the text sequence 'expectedTextSequence' can be found in 'srcText'

Parameters
srcText the text to search in
expected1 the first expected text in the sequence
expected2 the rest of expected texts in the sequence