Class MuiConfig


  • public class MuiConfig
    extends Object
    The root configuration for material UI components
    Since:
    1.0
    Author:
    Jack Yin
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String ATTR_CLASS
      class attribute name
    • 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
      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.
      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 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 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.
      org.openqa.selenium.By sliderThumbLocator()
      For locating the thumb element of the Slider.
      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.

        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.
        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.
        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.
        Parameters:
        component - the component to check
        Returns:
        whether the disabled css presents
        See Also:
        getIsDisabledCss()
      • getIsCheckedCss

        public String getIsCheckedCss()
        Gets the isChecked CSS. default value is "Mui-checked"
        Returns:
        the isChecked CSS
      • getIsSelectedCss

        public String getIsSelectedCss()
        Gets the isSelected CSS. default value is "Mui-selected"
        Returns:
        the isSelected CSS
      • getIsDisabledCss

        public String getIsDisabledCss()
        Gets the isDisabled CSS. default value is "Mui-disabled"
        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