Class MuiConfig

  • All Implemented Interfaces:
    com.github.grossopa.selenium.core.component.ComponentConfig

    public class MuiConfig
    extends Object
    implements com.github.grossopa.selenium.core.component.ComponentConfig
    The root configuration for material UI components
    Since:
    1.0
    Author:
    Jack Yin
    • Constructor Summary

      Constructors 
      Constructor Description
      MuiConfig()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.openqa.selenium.By buttonLocator()
      For locating the button from direct parent container
      boolean equals​(Object o)  
      String getCssPrefix()  
      String getIsCheckedCss()
      Gets the isChecked CSS.
      String getIsDisabledCss()
      Gets the isDisabled CSS.
      String getIsSelectedCss()
      Gets the isSelected CSS.
      Set<String> getModalClasses()
      Gets the modals class list, they are Drawer, Dialog, Popover and Pager.
      String getOverlayAbsolutePath()
      The overlays are displayed in the root level of React applications, this attribute helps to locate the container of the overlays such as Modal, Dialog, etc.
      String getRootCss​(String componentName)
      Builds the root component css name from the component name, it is used for determining the root node of all MUI component.
      MuiVersion getVersion()
      Gets the Mui version
      int hashCode()  
      boolean isChecked​(com.github.grossopa.selenium.core.component.WebComponent component)
      Checks whether the component has the checked css present.
      boolean isDisabled​(com.github.grossopa.selenium.core.component.WebComponent component)
      Checks whether the component has the disabled css present.
      boolean isGridContainer​(com.github.grossopa.selenium.core.component.WebComponent component)
      Checks whether the Grid has the container css present.
      boolean isGridItem​(com.github.grossopa.selenium.core.component.WebComponent component)
      Checks whether the Grid has the item css present.
      boolean isSelected​(com.github.grossopa.selenium.core.component.WebComponent component)
      Checks whether the component has the selected css present.
      org.openqa.selenium.By menuPagerLocator()
      Gets the Menu Pager elements inner the MuiPopover-root which is bound to a MuiMenu component.
      org.openqa.selenium.By radioLocator()
      For locating the radio from direct parent container
      void setCssPrefix​(String cssPrefix)
      Sets the global css prefix
      void setOverlayAbsolutePath​(String overlayAbsolutePath)
      The overlays are displayed in the root level of React applications, this attribute helps to locate the container of the overlays such as Modal, Dialog, etc.
      void setVersion​(MuiVersion version)
      Sets the Mui version
      org.openqa.selenium.By sliderThumbLocator()
      For locating the thumb element of the Slider.
      String toString()  
      boolean validateByCss​(com.github.grossopa.selenium.core.component.WebComponent component, String cssName)
      Validates whether the given component / item is the desired component by checking the css present.
      boolean validateComponentByCss​(com.github.grossopa.selenium.core.component.WebComponent component, String componentName)
      Validates whether the given component is the desired component by checking the css present.
    • Constructor Detail

      • MuiConfig

        public MuiConfig()
    • Method Detail

      • setOverlayAbsolutePath

        public void setOverlayAbsolutePath​(String overlayAbsolutePath)
        The overlays are displayed in the root level of React applications, this attribute helps to locate the container of the overlays such as Modal, Dialog, etc.

        The default value is /html/body.

        Parameters:
        overlayAbsolutePath - the new overlay absolute path to set
      • getOverlayAbsolutePath

        public String getOverlayAbsolutePath()
        The overlays are displayed in the root level of React applications, this attribute helps to locate the container of the overlays such as Modal, Dialog, etc.

        The default value is /html/body.

        Specified by:
        getOverlayAbsolutePath in interface com.github.grossopa.selenium.core.component.ComponentConfig
        Returns:
        the overlay absolute xpath.
      • buttonLocator

        public org.openqa.selenium.By buttonLocator()
        For locating the button from direct parent container
        Returns:
        the instance of button locator
      • radioLocator

        public org.openqa.selenium.By radioLocator()
        For locating the radio from direct parent container
        Returns:
        the instance of radio locator
      • menuPagerLocator

        public org.openqa.selenium.By menuPagerLocator()
        Gets the Menu Pager elements inner the MuiPopover-root which is bound to a MuiMenu component.
        Returns:
        the Menu Pager elements inner the MuiPopover-root which is bound to a MuiMenu component.
      • sliderThumbLocator

        public org.openqa.selenium.By sliderThumbLocator()
        For locating the thumb element of the Slider.
        Returns:
        the instance of Slider thumb locator
      • isChecked

        public boolean isChecked​(com.github.grossopa.selenium.core.component.WebComponent component)
        Checks whether the component has the checked css present.
        Specified by:
        isChecked in interface com.github.grossopa.selenium.core.component.ComponentConfig
        Parameters:
        component - the component to check
        Returns:
        whether the checked css presents
        See Also:
        getIsCheckedCss()
      • isSelected

        public boolean isSelected​(com.github.grossopa.selenium.core.component.WebComponent component)
        Checks whether the component has the selected css present.
        Specified by:
        isSelected in interface com.github.grossopa.selenium.core.component.ComponentConfig
        Parameters:
        component - the component to check
        Returns:
        whether the selected css presents
        See Also:
        getIsSelectedCss()
      • isDisabled

        public boolean isDisabled​(com.github.grossopa.selenium.core.component.WebComponent component)
        Checks whether the component has the disabled css present.
        Specified by:
        isDisabled in interface com.github.grossopa.selenium.core.component.ComponentConfig
        Parameters:
        component - the component to check
        Returns:
        whether the disabled css presents
        See Also:
        getIsDisabledCss()
      • isGridContainer

        public boolean isGridContainer​(com.github.grossopa.selenium.core.component.WebComponent component)
        Checks whether the Grid has the container css present.
        Parameters:
        component - the component to check
        Returns:
        whether the container css presents
      • isGridItem

        public boolean isGridItem​(com.github.grossopa.selenium.core.component.WebComponent component)
        Checks whether the Grid has the item css present.
        Parameters:
        component - the component to check
        Returns:
        whether the item css presents
      • getIsCheckedCss

        public String getIsCheckedCss()
        Gets the isChecked CSS. default value is "Mui-checked"
        Specified by:
        getIsCheckedCss in interface com.github.grossopa.selenium.core.component.ComponentConfig
        Returns:
        the isChecked CSS
      • getIsSelectedCss

        public String getIsSelectedCss()
        Gets the isSelected CSS. default value is "Mui-selected"
        Specified by:
        getIsSelectedCss in interface com.github.grossopa.selenium.core.component.ComponentConfig
        Returns:
        the isSelected CSS
      • getIsDisabledCss

        public String getIsDisabledCss()
        Gets the isDisabled CSS. default value is "Mui-disabled"
        Specified by:
        getIsDisabledCss in interface com.github.grossopa.selenium.core.component.ComponentConfig
        Returns:
        the isDisabled CSS
      • getRootCss

        public String getRootCss​(String componentName)
        Builds the root component css name from the component name, it is used for determining the root node of all MUI component.
        Parameters:
        componentName - the component name in camel format
        Returns:
        the built css
      • validateComponentByCss

        public boolean validateComponentByCss​(com.github.grossopa.selenium.core.component.WebComponent component,
                                              String componentName)
        Validates whether the given component is the desired component by checking the css present.
        Parameters:
        component - the target component to check
        componentName - the component name
        Returns:
        true for the WebComponent is the desired component type
        See Also:
        getRootCss(String)
      • validateByCss

        public boolean validateByCss​(com.github.grossopa.selenium.core.component.WebComponent component,
                                     String cssName)
        Validates whether the given component / item is the desired component by checking the css present.
        Parameters:
        component - the target component to check
        cssName - the expected css name
        Returns:
        true for the WebComponent is the desired component/ item type
        See Also:
        getRootCss(String)
      • getModalClasses

        public Set<String> getModalClasses()
        Gets the modals class list, they are Drawer, Dialog, Popover and Pager.
        Returns:
        the modals class list
      • getCssPrefix

        public String getCssPrefix()
        Specified by:
        getCssPrefix in interface com.github.grossopa.selenium.core.component.ComponentConfig
      • setCssPrefix

        public void setCssPrefix​(String cssPrefix)
        Sets the global css prefix
        Parameters:
        cssPrefix - the global css prefix
      • getVersion

        public MuiVersion getVersion()
        Gets the Mui version
        Returns:
        the Mui version
      • setVersion

        public void setVersion​(MuiVersion version)
        Sets the Mui version
        Parameters:
        version - the Mui version
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object