com.atlassian.jira.functest.framework.assertions
Class TextAssertionsImpl

java.lang.Object
  extended by com.atlassian.jira.functest.framework.AbstractFuncTestUtil
      extended by com.atlassian.jira.functest.framework.assertions.TextAssertionsImpl
All Implemented Interfaces:
TextAssertions, com.atlassian.jira.testkit.client.log.FuncTestLogger

public class TextAssertionsImpl
extends AbstractFuncTestUtil
implements TextAssertions, com.atlassian.jira.testkit.client.log.FuncTestLogger

An implementation of the TextAssertions

Since:
v3.13

Field Summary
 
Fields inherited from class com.atlassian.jira.functest.framework.AbstractFuncTestUtil
environmentData, FS, locators, logger, logIndentLevel
 
Constructor Summary
TextAssertionsImpl()
           
TextAssertionsImpl(net.sourceforge.jwebunit.WebTester tester)
           
 
Method Summary
 void assertAtLeastOneTextPresent(Locator locator, String option1, String... moreOptions)
          Asserts that at least one of the provided text strings is present in the locator.
 void assertRegexMatch(Locator locator, String regexPattern)
          Synonym for TextAssertions.assertRegexMatch(String,String) that calls getText() on the provided locator.
 void assertRegexMatch(String srcText, String regexPattern)
          This asserets that the regular expression pattern 'regexPattern' has at least one match somewhere inside 'srcText'
 void assertRegexNoMatch(Locator locator, String regexPattern)
          Synonym for TextAssertions.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 TextAssertions.assertTextNotPresent(String,String) that calls getText() on the provided locator.
 void assertTextNotPresent(String expectedText)
          Asserts that the given text cannot be found in the current page.
 void assertTextNotPresent(String srcText, String expectedText)
          Asserts that 'expectedText' can NOT be found in 'srcText'.
 void assertTextPresent(Locator locator, String expectedText)
          Synonym for TextAssertions.assertTextPresent(String,String) that calls getText() on the provided locator.
 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 assertTextPresentHtmlEncoded(String expectedText)
          Asserts that 'expectedText' can be found in the current page in a "HTML Encoded" form.
 void assertTextPresentNumOccurences(Locator locator, String expectedText, int numOccurences)
          Synonym for TextAssertions.assertTextPresentNumOccurences(String,String,int) that calls getText() on the provided locator.
 void assertTextPresentNumOccurences(String expectedText, int numOccurences)
          Asserts that 'expectedText' can be found in the current page exactly 'numOccurences' times.
 void assertTextPresentNumOccurences(String srcText, String subString, int expectedCount)
          Asserts that 'expectedText' can be found in 'srcText' exactly 'numOccurences' times.
 void assertTextSequence(Locator locator, String[] expectedTextSequence)
          Synonym for TextAssertions.assertTextSequence(String,String[]) that calls getText() on the provided locator.
 void assertTextSequence(Locator locator, String expected1, String... expected2)
          Synonym for TextAssertions.assertTextSequence(String,String[]) 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(String srcText, String expected1, String... expected2)
          Asserts that the text sequence 'expectedTextSequence' can be found in 'srcText'
 
Methods inherited from class com.atlassian.jira.functest.framework.AbstractFuncTestUtil
childLogIndentLevel, getAssertions, getEnvironmentData, getFuncTestHelperFactory, getLogger, log, log, navigation, submitAtPage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.jira.testkit.client.log.FuncTestLogger
log, log
 

Constructor Detail

TextAssertionsImpl

public TextAssertionsImpl()

TextAssertionsImpl

public TextAssertionsImpl(net.sourceforge.jwebunit.WebTester tester)
Method Detail

assertTextPresent

public void assertTextPresent(String expectedText)
Description copied from interface: TextAssertions
Asserts that 'expectedText' can be found in the current page.

Specified by:
assertTextPresent in interface TextAssertions
Parameters:
expectedText - the expected text

assertTextPresentHtmlEncoded

public void assertTextPresentHtmlEncoded(String expectedText)
Description copied from interface: TextAssertions
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.

Specified by:
assertTextPresentHtmlEncoded in interface TextAssertions
Parameters:
expectedText - the expected text

assertTextNotPresent

public void assertTextNotPresent(String expectedText)
Description copied from interface: TextAssertions
Asserts that the given text cannot be found in the current page.

Specified by:
assertTextNotPresent in interface TextAssertions
Parameters:
expectedText - the expected text

assertTextPresent

public void assertTextPresent(Locator locator,
                              String expectedText)
Description copied from interface: TextAssertions
Synonym for TextAssertions.assertTextPresent(String,String) that calls getText() on the provided locator.

Specified by:
assertTextPresent in interface TextAssertions
Parameters:
locator - the source of the text
expectedText - the expected text

assertTextPresent

public void assertTextPresent(String srcText,
                              String expectedText)
Description copied from interface: TextAssertions
Asserts that 'expectedText' can be found in 'srcText'.

Specified by:
assertTextPresent in interface TextAssertions
Parameters:
srcText - the text to search in
expectedText - the expected text

assertTextPresentNumOccurences

public void assertTextPresentNumOccurences(String expectedText,
                                           int numOccurences)
Description copied from interface: TextAssertions
Asserts that 'expectedText' can be found in the current page exactly 'numOccurences' times.

Specified by:
assertTextPresentNumOccurences in interface TextAssertions
Parameters:
expectedText - the expected text
numOccurences - the number of times the expected text should occur; must be greater than 0.

assertTextPresentNumOccurences

public void assertTextPresentNumOccurences(String srcText,
                                           String subString,
                                           int expectedCount)
Description copied from interface: TextAssertions
Asserts that 'expectedText' can be found in 'srcText' exactly 'numOccurences' times.

Specified by:
assertTextPresentNumOccurences in interface TextAssertions
Parameters:
srcText - the text to search in
subString - the expected text
expectedCount - the number of times the expected text should occur; must be greater than 0.

assertTextPresentNumOccurences

public void assertTextPresentNumOccurences(Locator locator,
                                           String expectedText,
                                           int numOccurences)
Description copied from interface: TextAssertions
Synonym for TextAssertions.assertTextPresentNumOccurences(String,String,int) that calls getText() on the provided locator.

Specified by:
assertTextPresentNumOccurences in interface TextAssertions
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.

assertTextNotPresent

public void assertTextNotPresent(String srcText,
                                 String expectedText)
Description copied from interface: TextAssertions
Asserts that 'expectedText' can NOT be found in 'srcText'.

Specified by:
assertTextNotPresent in interface TextAssertions
Parameters:
srcText - the text to search in
expectedText - the expected text

assertTextNotPresent

public void assertTextNotPresent(Locator locator,
                                 String expectedText)
Description copied from interface: TextAssertions
Synonym for TextAssertions.assertTextNotPresent(String,String) that calls getText() on the provided locator.

Specified by:
assertTextNotPresent in interface TextAssertions
Parameters:
locator - the source of the text
expectedText - the expected text

assertTextSequence

public void assertTextSequence(Locator locator,
                               String[] expectedTextSequence)
Description copied from interface: TextAssertions
Synonym for TextAssertions.assertTextSequence(String,String[]) that calls getText() on the provided locator.

Specified by:
assertTextSequence in interface TextAssertions
Parameters:
locator - the source of the text
expectedTextSequence - the expected text sequence

assertTextSequence

public void assertTextSequence(Locator locator,
                               String expected1,
                               String... expected2)
Description copied from interface: TextAssertions
Synonym for TextAssertions.assertTextSequence(String,String[]) that calls getText() on the provided locator.

Specified by:
assertTextSequence in interface TextAssertions
Parameters:
locator - the source of the text
expected1 - the first expected text in the sequence
expected2 - the rest of expected texts in the sequence

assertAtLeastOneTextPresent

public void assertAtLeastOneTextPresent(Locator locator,
                                        String option1,
                                        String... moreOptions)
Description copied from interface: TextAssertions
Asserts that at least one of the provided text strings is present in the locator. Will throw an AssertionFailedError if none are present.

Specified by:
assertAtLeastOneTextPresent in interface TextAssertions
Parameters:
locator - the source of the text
option1 - the expected text
moreOptions - the expected texts

assertTextSequence

public void assertTextSequence(String srcText,
                               String expected1,
                               String... expected2)
Description copied from interface: TextAssertions
Asserts that the text sequence 'expectedTextSequence' can be found in 'srcText'

Specified by:
assertTextSequence in interface TextAssertions
Parameters:
srcText - the text to search in
expected1 - the first expected text in the sequence
expected2 - the rest of expected texts in the sequence

assertTextSequence

public void assertTextSequence(String srcText,
                               String[] expectedTextSequence)
Description copied from interface: TextAssertions
Asserts that the text sequence 'expectedTextSequence' can be found in 'srcText'

Specified by:
assertTextSequence in interface TextAssertions
Parameters:
srcText - the text to search in
expectedTextSequence - the expected text sequence

assertRegexMatch

public void assertRegexMatch(String srcText,
                             String regexPattern)
Description copied from interface: TextAssertions
This asserets that the regular expression pattern 'regexPattern' has at least one match somewhere inside 'srcText'

Specified by:
assertRegexMatch in interface TextAssertions
Parameters:
srcText - the text source to do the matching in
regexPattern - the regex pattern

assertRegexNoMatch

public void assertRegexNoMatch(String srcText,
                               String regexPattern)
Description copied from interface: TextAssertions
This asserets that the regular expression pattern 'regexPattern' has NO match somewhere inside 'srcText'

Specified by:
assertRegexNoMatch in interface TextAssertions
Parameters:
srcText - the text source to do the matching in
regexPattern - the regex pattern

assertRegexMatch

public void assertRegexMatch(Locator locator,
                             String regexPattern)
Description copied from interface: TextAssertions
Synonym for TextAssertions.assertRegexMatch(String,String) that calls getText() on the provided locator.

Specified by:
assertRegexMatch in interface TextAssertions
Parameters:
locator - the source of the teext
regexPattern - the regex pattern

assertRegexNoMatch

public void assertRegexNoMatch(Locator locator,
                               String regexPattern)
Description copied from interface: TextAssertions
Synonym for TextAssertions.assertRegexNoMatch(String,String) that calls getText() on the provided locator.

Specified by:
assertRegexNoMatch in interface TextAssertions
Parameters:
locator - the source of the teext
regexPattern - the regex pattern


Copyright © 2002-2013 Atlassian. All Rights Reserved.