Interface TextDisplayFixture

All Known Subinterfaces:
TextInputFixture
All Known Implementing Classes:
JButtonFixture, JCheckBoxFixture, JLabelFixture, JProgressBarFixture, JRadioButtonFixture, JTextComponentFixture, JToggleButtonFixture

public interface TextDisplayFixture
Understands state verification and property value queries of GUI components that display text.
  • Method Details

    • text

      String text()
      Returns the text of this fixture's Component.
      Returns:
      the text of the managed Component.
    • requireText

      TextDisplayFixture requireText(String expected)
      Asserts that the text of this fixture's Component is equal to or matches the specified String.
      Parameters:
      expected - the text to match. It can be a regular expression.
      Returns:
      this fixture.
      Throws:
      AssertionError - if the text of the target component is not equal to or does not match the given one.
    • requireText

      TextDisplayFixture requireText(Pattern pattern)
      Asserts that the text of this fixture's Component matches the given regular expression pattern.
      Parameters:
      pattern - the regular expression pattern to match.
      Returns:
      this fixture.
      Throws:
      NullPointerException - if the given regular expression pattern is null.
      AssertionError - if the text of the target component does not match the given regular expression pattern.
      Since:
      1.2