Class MuiModalFinder


  • public class MuiModalFinder
    extends Object
    The modal locator for locating all the Modal overlay modules.
    Since:
    1.1
    Author:
    Jack Yin
    • Constructor Summary

      Constructors 
      Constructor Description
      MuiModalFinder​(com.github.grossopa.selenium.core.ComponentWebDriver driver, MuiConfig config)
      Constructs an instance with given root driver.
    • Constructor Detail

      • MuiModalFinder

        public MuiModalFinder​(com.github.grossopa.selenium.core.ComponentWebDriver driver,
                              MuiConfig config)
        Constructs an instance with given root driver.
        Parameters:
        driver - the root driver
        config - the Material-UI configuration
    • Method Detail

      • findOverlays

        public List<com.github.grossopa.selenium.core.component.WebComponent> findOverlays()
        Finds the all overlays in the root path. Note all overlays existing will be returned including those with keepMounted=true and not displayed. Note it will NOT be able to find the Modal component.

        The possible components types are any of MuiDialog, MuiDrawer, MuiMenu or MuiPopover.

        Returns:
        all the overlay components.
      • findOverlays

        public List<com.github.grossopa.selenium.core.component.WebComponent> findOverlays​(String componentName)
        Finds the all overlays by component name in the root path. Note all overlays existing will be returned including those with keepMounted=true and not displayed. Note it will NOT be able to find the Modal component.

        The possible components types are any of MuiDialog, MuiDrawer, MuiMenu or MuiPopover.

        Parameters:
        componentName - any of @MuiPopover.COMPONENT_NAME
        Returns:
        all the overlay components.
      • findVisibleOverlays

        public List<com.github.grossopa.selenium.core.component.WebComponent> findVisibleOverlays()
        Finds the all visible overlays in the root path. Only visible overlays will be returned those without those with keepMounted=true and not displayed. Note it will NOT be able to find the Modal component.

        The possible components types are any of MuiDialog, MuiDrawer, MuiMenu or MuiPopover.

        Returns:
        all the overlay components.
      • findVisibleOverlays

        public List<com.github.grossopa.selenium.core.component.WebComponent> findVisibleOverlays​(String componentName)
        Finds the all visible overlays by component name in the root path. Only visible overlays will be returned those without those with keepMounted=true and not displayed. Note it will NOT be able to find the Modal component.

        The possible components types are any of MuiDialog, MuiDrawer, MuiMenu or MuiPopover.

        Parameters:
        componentName - any of @MuiPopover.COMPONENT_NAME
        Returns:
        all the overlay components.
      • findTopVisibleOverlay

        @Nullable
        public com.github.grossopa.selenium.core.component.WebComponent findTopVisibleOverlay()
        Finds the top visible overlay. Usually it's the interactive-able overlay.
        Returns:
        the found top overlay component or null if no overlays found.
      • findTopVisibleOverlay

        @Nullable
        public com.github.grossopa.selenium.core.component.WebComponent findTopVisibleOverlay​(String componentName)
        Finds the top visible overlay by component name. Usually it's the interactive-able overlay.
        Parameters:
        componentName - any of @MuiPopover.COMPONENT_NAME
        Returns:
        the found top overlay component or null if no overlays found.
      • findOverlays

        public List<com.github.grossopa.selenium.core.component.WebComponent> findOverlays​(Set<String> classNames,
                                                                                           boolean includeHidden)
        Finds the overlays by a list of class names and whether includes hidden ones by invoking WebElement.isDisplayed() of found overlays.
        Parameters:
        classNames - the class names to find
        includeHidden - whether includes hidden overlays (for some components they will create hidden overlays even not triggered)
        Returns:
        the found overlays