Class MuiConfig
- java.lang.Object
-
- com.github.grossopa.selenium.component.mui.config.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 StringATTR_CLASSclass attribute name
-
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 containerStringgetIsCheckedCss()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.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.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 containervoidsetOverlayAbsolutePath(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.BysliderThumbLocator()For locating the thumb element of the Slider.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.
-
-
-
Field Detail
-
ATTR_CLASS
public static final String ATTR_CLASS
class attribute name- See Also:
- Constant Field Values
-
-
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 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)
-
-