Class AccordionTester<T extends Accordion>

java.lang.Object
com.vaadin.browserless.ComponentTester<T>
com.vaadin.flow.component.accordion.AccordionTester<T>
All Implemented Interfaces:
Clickable<T>

public class AccordionTester<T extends Accordion> extends ComponentTester<T>
Since:
1.0
  • Constructor Details

    • AccordionTester

      public AccordionTester(T component)
      Wrap given component for testing.
      Parameters:
      component - target component
  • Method Details

    • openDetails

      public void openDetails(String summary)
      Open the accordion with the given summary.
      Parameters:
      summary - summary of accordion panel
      Throws:
      IllegalArgumentException - if no dropdown panel found for summary
    • closeDetails

      public void closeDetails()
      Close the open accordion panel, as if the user clicked its summary. An exception will be thrown if no panel is open.
      Throws:
      IllegalStateException - if the component is not usable or if no panel is open
      Since:
      25.3
    • closeDetails

      public void closeDetails(String summary)
      Close the accordion panel with the given summary, as if the user clicked its summary. An exception will be thrown if the panel is not the open one.
      Parameters:
      summary - summary of accordion panel
      Throws:
      IllegalArgumentException - if no dropdown panel found for summary
      IllegalStateException - if the component is not usable or if the panel is not open
      Since:
      25.3
    • toggleDetails

      public void toggleDetails(String summary)
      Toggle the accordion panel with the given summary, as if the user clicked its summary. An open panel is closed, a closed panel is opened. Note that an accordion has at most one open panel, so opening a panel closes whichever panel was open before.
      Parameters:
      summary - summary of accordion panel
      Throws:
      IllegalArgumentException - if no dropdown panel found for summary
      IllegalStateException - if the component is not usable
      Since:
      25.3
    • isOpen

      public boolean isOpen(String summary)
      Check if accordion with the summary is open.
      Parameters:
      summary - summary of accordion panel
      Returns:
      true if panel is open
    • getPanel

      public AccordionPanel getPanel(String summary)
      Get the panel with the summary. Throws if panel is not open.
      Parameters:
      summary - summary of accordion panel
      Returns:
      AccordionPanel for the given summary
    • hasPanel

      public boolean hasPanel(String summary)
      Check if a panel for summary exists in accordion.
      Parameters:
      summary - summary of accordion panel
      Returns:
      true if panel exists