Class MuiConfig
- java.lang.Object
-
- com.github.grossopa.selenium.component.mui.config.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.BybuttonLocator()For locating the button from direct parent containerbooleanequals(Object o)StringgetCssPrefix()StringgetIsCheckedCss()Gets the isChecked CSS.StringgetIsDisabledCss()Gets the isDisabled CSS.StringgetIsSelectedCss()Gets the isSelected CSS.Set<String>getModalClasses()Gets the modals class list, they are Drawer, Dialog, Popover and Pager.StringgetOverlayAbsolutePath()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.StringgetRootCss(String componentName)Builds the root component css name from the component name, it is used for determining the root node of all MUI component.MuiVersiongetVersion()Gets the Mui versioninthashCode()booleanisChecked(com.github.grossopa.selenium.core.component.WebComponent component)Checks whether the component has the checked css present.booleanisDisabled(com.github.grossopa.selenium.core.component.WebComponent component)Checks whether the component has the disabled css present.booleanisGridContainer(com.github.grossopa.selenium.core.component.WebComponent component)Checks whether the Grid has the container css present.booleanisGridItem(com.github.grossopa.selenium.core.component.WebComponent component)Checks whether the Grid has the item css present.booleanisSelected(com.github.grossopa.selenium.core.component.WebComponent component)Checks whether the component has the selected css present.org.openqa.selenium.BymenuPagerLocator()Gets the Menu Pager elements inner the MuiPopover-root which is bound to a MuiMenu component.org.openqa.selenium.ByradioLocator()For locating the radio from direct parent containervoidsetCssPrefix(String cssPrefix)Sets the global css prefixvoidsetOverlayAbsolutePath(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.voidsetVersion(MuiVersion version)Sets the Mui versionorg.openqa.selenium.BysliderThumbLocator()For locating the thumb element of the Slider.StringtoString()booleanvalidateByCss(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.booleanvalidateComponentByCss(com.github.grossopa.selenium.core.component.WebComponent component, String componentName)Validates whether the given component is the desired component by checking the css present.
-
-
-
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:
getOverlayAbsolutePathin interfacecom.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:
isCheckedin interfacecom.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:
isSelectedin interfacecom.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:
isDisabledin interfacecom.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:
getIsCheckedCssin interfacecom.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:
getIsSelectedCssin interfacecom.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:
getIsDisabledCssin interfacecom.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 checkcomponentName- the component name- Returns:
- true for the
WebComponentis 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 checkcssName- the expected css name- Returns:
- true for the
WebComponentis 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:
getCssPrefixin interfacecom.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
-
-