Interface HasTextFilter<C extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasText,SELF extends Locator<C,SELF>>

Type Parameters:
C - the component type, bound to HasText
SELF - the concrete locator subtype, used for fluent chaining
All Known Implementing Classes:
AnchorLocator, ButtonLocator, DescriptionListLocator, DivLocator, EmphasisLocator, H1Locator, H2Locator, H3Locator, H4Locator, H5Locator, H6Locator, ListItemLocator, NativeButtonLocator, NativeLabelLocator, OrderedListLocator, ParagraphLocator, PreLocator, RouterLinkLocator, SpanLocator, TextLocator, UnorderedListLocator, UploadButtonLocator

public interface HasTextFilter<C extends com.vaadin.flow.component.Component & com.vaadin.flow.component.HasText,SELF extends Locator<C,SELF>>
Mixin for Locators whose target component implements HasText. Exposes text-based filter methods that would be meaningless on components without textual content, turning a call like findTextField().withText("foo") (TextField is HasValue/HasLabel, not HasText) into a compile error rather than a silent no-op.
Since:
1.1
  • Method Summary

    Modifier and Type
    Method
    Description
    default SELF
    Requires the text content of the component to equal the given text.
    default SELF
    Requires the text content of the component to contain the given text.
  • Method Details

    • withText

      default SELF withText(String text)
      Requires the text content of the component to equal the given text.
      Parameters:
      text - the text the component must have
      Returns:
      this locator, for chaining
    • withTextContaining

      default SELF withTextContaining(String text)
      Requires the text content of the component to contain the given text.
      Parameters:
      text - the text the component's text must contain
      Returns:
      this locator, for chaining