Class MuiComponents

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

    public class MuiComponents
    extends com.github.grossopa.selenium.core.component.AbstractComponents
    Contains the definition of Material UI components.
    Since:
    1.0
    Author:
    Jack Yin
    • Constructor Detail

      • MuiComponents

        public MuiComponents()
        Constructs an instance with default MuiConfig.
      • MuiComponents

        public MuiComponents​(MuiConfig config)
        Constructs an instance with provided MuiConfig.
        Parameters:
        config - the MUI configuration instance
    • Method Detail

      • toButton

        public MuiButton toButton()
        Wraps the current WebComponent to MuiButton instance.
        Returns:
        wrapped MuiButton instance on the given component
      • toFab

        public MuiFab toFab()
        Wraps the current WebComponent to MuiFab instance.
        Returns:
        wrapped MuiFab instance on the given component
      • toSelect

        public MuiSelect toSelect​(org.openqa.selenium.By optionLocator)
        Wraps the current WebComponent to MuiSelect instance.
        Parameters:
        optionLocator - the locator for locating the options (NOTE: it is the option element NOT the option container)
        Returns:
        wrapped MuiSelect instance on the given component
      • toSelect

        public MuiSelect toSelect​(org.openqa.selenium.By optionLocator,
                                  String optionValueAttribute)
        Wraps the current WebComponent to MuiSelect instance.
        Parameters:
        optionLocator - the locator for locating the options (NOTE: it is the option element NOT the option container)
        optionValueAttribute - if the option value will be marked somewhere in the element. with this attribute it will make sure MuiSelect.selectByValue(String) and MuiSelect.deselectByValue(String) works properly.
        Returns:
        wrapped MuiSelect instance on the given component
      • toSlider

        public MuiSlider toSlider()
        Wraps the current WebComponent to MuiSlider instance.
        Returns:
        the wrapped MuiSlider instance on the given component
      • toSlider

        public MuiSlider toSlider​(java.util.function.UnaryOperator<Double> inverseScaleFunction)
        Wraps the current WebComponent to MuiSlider instance with scale function configured.
        Parameters:
        inverseScaleFunction - the non-null customized inverse scale function
        Returns:
        the wrapped MuiSlider instance on the given component
      • toSwitch

        public MuiSwitch toSwitch()
        Wraps the current WebComponent to MuiSwitch.
        Returns:
        the wrapped MuiSwitch instance on the given component
      • toRadio

        public MuiRadio toRadio()
        Wraps the current WebComponent to MuiRadio.
        Returns:
        the wrapped MuiRadio instance on the given component
      • toRadioGroup

        public MuiRadioGroup toRadioGroup()
        Wraps the current WebComponent to MuiRadio.
        Returns:
        the wrapped MuiRadio instance on the given component
      • toLink

        public MuiLink toLink()
        Wraps the current WebComponent to MuiLink.
        Returns:
        the wrapped MuiLink instance on the given component
      • toTabs

        public MuiTabs toTabs()
        Wraps the current WebComponent to MuiTabs.
        Returns:
        the wrapped MuiTabs instance on the given component
      • toAvatar

        public MuiAvatar toAvatar()
        Wraps the current WebComponent to MuiAvatar.
        Returns:
        the wrapped MuiAvatar instance on the given component
      • toBadge

        public MuiBadge toBadge()
        Wraps the current WebComponent to MuiBadge.
        Returns:
        the wrapped MuiBadge instance on the given component
      • toChip

        public MuiChip toChip()
        Wraps the current WebComponent to MuiChip.
        Returns:
        the wrapped MuiChip instance on the given component
      • toDivider

        public MuiDivider toDivider()
        Wraps the current WebComponent to MuiDivider.
        Returns:
        the wrapped MuiDivider instance on the given component
      • toList

        public MuiList toList()
        Wraps the current WebComponent to MuiList.
        Returns:
        the wrapped MuiList instance on the given component
      • toAppBar

        public MuiAppBar toAppBar()
        Wraps the current WebComponent to MuiAppBar.
        Returns:
        the wrapped MuiAppBar instance on the given component
      • toPager

        public MuiPager toPager()
        Wraps the current WebComponent to MuiPager.
        Returns:
        the wrapped MuiPager instance on the given component
      • toMenu

        public MuiMenu toMenu()
        Wraps the current WebComponent to MuiMenu.
        Returns:
        the wrapped MuiMenu instance on the given component
      • toDialog

        public MuiDialog toDialog()
        Wraps the current WebComponent to MuiDialog.
        Returns:
        the wrapped MuiDialog instance on the given component
      • toSnackbar

        public MuiSnackbar toSnackbar​(long autoHideDuration)
        Wraps the current WebComponent to MuiSnackbar.
        Parameters:
        autoHideDuration - the autoHideDuration, should be a little longer than the value set in the component.
        Returns:
        the wrapped MuiSnackbar instance on the given component
      • toAutocomplete

        public MuiAutocomplete toAutocomplete​(@Nullable
                                              org.openqa.selenium.By optionLocator)
        Wraps the current WebComponent to MuiAutocomplete with customized optionLocator
        Parameters:
        optionLocator - the option locator for finding the option elements
        Returns:
        the wrapped MuiAutocomplete instance on the given component
      • toAutocomplete

        public MuiAutocomplete toAutocomplete​(@Nullable
                                              org.openqa.selenium.By optionLocator,
                                              @Nullable
                                              MuiAutocompleteTagLocators tagLocators)
        Wraps the current WebComponent to MuiAutocomplete with customized optionLocator
        Parameters:
        optionLocator - the option locator for finding the option elements
        tagLocators - the tag locators for finding the selected option elements
        Returns:
        the wrapped MuiAutocomplete instance on the given component