Class MuiModalFinder
- java.lang.Object
-
- com.github.grossopa.selenium.component.mui.finder.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<com.github.grossopa.selenium.core.component.WebComponent>findOverlays()Finds the all overlays in the root path.List<com.github.grossopa.selenium.core.component.WebComponent>findOverlays(String componentName)Finds the all overlays by component name in the root path.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 invokingWebElement.isDisplayed()of found overlays.com.github.grossopa.selenium.core.component.WebComponentfindTopVisibleOverlay()Finds the top visible overlay.com.github.grossopa.selenium.core.component.WebComponentfindTopVisibleOverlay(String componentName)Finds the top visible overlay by component name.List<com.github.grossopa.selenium.core.component.WebComponent>findVisibleOverlays()Finds the all visible overlays in the root path.List<com.github.grossopa.selenium.core.component.WebComponent>findVisibleOverlays(String componentName)Finds the all visible overlays by component name in the root path.
-
-
-
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 driverconfig- 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 withkeepMounted=trueand 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 withkeepMounted=trueand 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 withkeepMounted=trueand 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 withkeepMounted=trueand 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 invokingWebElement.isDisplayed()of found overlays.- Parameters:
classNames- the class names to findincludeHidden- whether includes hidden overlays (for some components they will create hidden overlays even not triggered)- Returns:
- the found overlays
-
-