Interface TextAssertions
- All Known Implementing Classes:
TextAssertionsImpl
public interface TextAssertions
Contains a number of methods that do "extended" functional test assertions involving text.
- Since:
- v3.13
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidassertAtLeastOneTextPresent(Locator locator, String option1, String... options) Asserts that at least one of the provided text strings is present in the locator.voidassertEqualDateStrings(String expected, String actual) voidassertRegexMatch(Locator locator, String regexPattern) Synonym forassertRegexMatch(String, String)that calls getText() on the provided locator.voidassertRegexMatch(String srcText, String regexPattern) This asserets that the regular expression pattern 'regexPattern' has at least one match somewhere inside 'srcText'voidassertRegexNoMatch(Locator locator, String regexPattern) Synonym forassertRegexNoMatch(String, String)that calls getText() on the provided locator.voidassertRegexNoMatch(String srcText, String regexPattern) This asserets that the regular expression pattern 'regexPattern' has NO match somewhere inside 'srcText'voidassertTextNotPresent(Locator locator, String expectedText) Synonym forassertTextNotPresent(String, String)that calls getText() on the provided locator.voidassertTextNotPresent(String text) Asserts that the given text cannot be found in the current page.voidassertTextNotPresent(String srcText, String expectedText) Asserts that 'expectedText' can NOT be found in 'srcText'.voidassertTextPresent(Locator locator, String expectedText) Synonym forassertTextPresent(String, String)that calls getText() on the provided locator.voidassertTextPresent(String expectedText) Asserts that 'expectedText' can be found in the current page.voidassertTextPresent(String srcText, String expectedText) Asserts that 'expectedText' can be found in 'srcText'.voidassertTextPresentHtmlEncoded(String expectedText) Asserts that 'expectedText' can be found in the current page in a "HTML Encoded" form.voidassertTextPresentNumOccurences(Locator locator, String expectedText, int numOccurences) Synonym forassertTextPresentNumOccurences(String, String, int)that calls getText() on the provided locator.voidassertTextPresentNumOccurences(String expectedText, int numOccurences) Asserts that 'expectedText' can be found in the current page exactly 'numOccurences' times.voidassertTextPresentNumOccurences(String srcText, String expectedText, int numOccurences) Asserts that 'expectedText' can be found in 'srcText' exactly 'numOccurences' times.voidassertTextSequence(Locator locator, String[] expectedTextSequence) Synonym forassertTextSequence(String, String[])that calls getText() on the provided locator.voidassertTextSequence(Locator locator, String expected1, String... expected2) Synonym forassertTextSequence(String, String[])that calls getText() on the provided locator.voidassertTextSequence(String srcText, String[] expectedTextSequence) Asserts that the text sequence 'expectedTextSequence' can be found in 'srcText'voidassertTextSequence(String srcText, String expected1, String... expected2) Asserts that the text sequence 'expectedTextSequence' can be found in 'srcText'
-
Method Details
-
assertTextPresent
Asserts that 'expectedText' can be found in the current page.- Parameters:
expectedText- the expected text
-
assertTextPresentHtmlEncoded
Asserts that 'expectedText' can be found in the current page in a "HTML Encoded" form.The encoding expects invalid input: '<', >, ", ', and invalid input: '&' to be encoded to appropriate HTML encoding.
- Parameters:
expectedText- the expected text
-
assertTextNotPresent
Asserts that the given text cannot be found in the current page.- Parameters:
text- the expected text
-
assertTextPresent
Asserts that 'expectedText' can be found in 'srcText'.- Parameters:
srcText- the text to search inexpectedText- the expected text
-
assertTextPresent
Synonym forassertTextPresent(String, String)that calls getText() on the provided locator. If the provided locator is null the method does the check for the current page instead.- Parameters:
locator- the source of the textexpectedText- the expected text
-
assertTextPresentNumOccurences
Asserts that 'expectedText' can be found in the current page exactly 'numOccurences' times.- Parameters:
expectedText- the expected textnumOccurences- the number of times the expected text should occur; must be greater than 0.
-
assertTextPresentNumOccurences
Asserts that 'expectedText' can be found in 'srcText' exactly 'numOccurences' times.- Parameters:
srcText- the text to search inexpectedText- the expected textnumOccurences- the number of times the expected text should occur; must be greater than 0.
-
assertTextPresentNumOccurences
Synonym forassertTextPresentNumOccurences(String, String, int)that calls getText() on the provided locator.- Parameters:
locator- the source of the textexpectedText- the expected textnumOccurences- the number of times the expected text should occur; must be greater than 0.
-
assertRegexMatch
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 inregexPattern- the regex pattern
-
assertRegexNoMatch
This asserets that the regular expression pattern 'regexPattern' has NO match somewhere inside 'srcText'- Parameters:
srcText- the text source to do the matching inregexPattern- the regex pattern
-
assertRegexMatch
Synonym forassertRegexMatch(String, String)that calls getText() on the provided locator.- Parameters:
locator- the source of the teextregexPattern- the regex pattern
-
assertRegexNoMatch
Synonym forassertRegexNoMatch(String, String)that calls getText() on the provided locator.- Parameters:
locator- the source of the teextregexPattern- the regex pattern
-
assertTextNotPresent
Asserts that 'expectedText' can NOT be found in 'srcText'.- Parameters:
srcText- the text to search inexpectedText- the expected text
-
assertTextNotPresent
Synonym forassertTextNotPresent(String, String)that calls getText() on the provided locator.- Parameters:
locator- the source of the textexpectedText- the expected text
-
assertTextSequence
Asserts that the text sequence 'expectedTextSequence' can be found in 'srcText'- Parameters:
srcText- the text to search inexpectedTextSequence- the expected text sequence
-
assertTextSequence
Asserts that the text sequence 'expectedTextSequence' can be found in 'srcText'- Parameters:
srcText- the text to search inexpected1- the first expected text in the sequenceexpected2- the rest of expected texts in the sequence
-
assertTextSequence
Synonym forassertTextSequence(String, String[])that calls getText() on the provided locator.- Parameters:
locator- the source of the textexpectedTextSequence- the expected text sequence
-
assertTextSequence
Synonym forassertTextSequence(String, String[])that calls getText() on the provided locator.- Parameters:
locator- the source of the textexpected1- the first expected text in the sequenceexpected2- the rest of expected texts in the sequence
-
assertAtLeastOneTextPresent
Asserts that at least one of the provided text strings is present in the locator. Will throw anAssertionErrorif none are present.- Parameters:
locator- the source of the textoption1- the expected textoptions- the expected texts
-
assertEqualDateStrings
-