Class MuiBadge
- java.lang.Object
-
- com.github.grossopa.selenium.core.component.AbstractDelegatedWebElement
-
- com.github.grossopa.selenium.core.component.DefaultWebComponent
-
- com.github.grossopa.selenium.component.mui.v4.AbstractMuiComponent
-
- com.github.grossopa.selenium.component.mui.v4.datadisplay.MuiBadge
-
- All Implemented Interfaces:
MuiComponent,com.github.grossopa.selenium.core.component.WebComponent,org.openqa.selenium.interactions.Locatable,org.openqa.selenium.SearchContext,org.openqa.selenium.TakesScreenshot,org.openqa.selenium.WebElement,org.openqa.selenium.WrapsDriver,org.openqa.selenium.WrapsElement
public class MuiBadge extends AbstractMuiComponent
Badge generates a small badge to the top-right of its child(ren).- Since:
- 1.0
- Author:
- Jack Yin
- See Also:
- https://material-ui.com/components/badges/
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOMPONENT_NAMEThe component name-
Fields inherited from class com.github.grossopa.selenium.component.mui.v4.AbstractMuiComponent
config
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.github.grossopa.selenium.core.component.WebComponentgetBadge()Finds the badge element.intgetBadgeNumber()Returns the number of the badge.StringgetComponentName()Gets the current component namebooleanisBadgeDisplayed()Whether the badge is displayed or not.booleanisDotDisplayed()Whether the dot is displayed instead of numbers.Set<MuiVersion>versions()Gets all the supported versions-
Methods inherited from class com.github.grossopa.selenium.component.mui.v4.AbstractMuiComponent
config, equals, hashCode, isEnabled, toString, validate
-
Methods inherited from class com.github.grossopa.selenium.core.component.DefaultWebComponent
as, attributeContains, driver, findComponent, findComponentAs, findComponents, findComponentsAs, findTextNodes, getId, isFocused, outerHTML, styleContains, to
-
Methods inherited from class com.github.grossopa.selenium.core.component.AbstractDelegatedWebElement
clear, click, findElement, findElements, getAccessibleName, getAriaRole, getAttribute, getCoordinates, getCssValue, getDomAttribute, getDomProperty, getLocation, getRect, getScreenshotAs, getShadowRoot, getSize, getTagName, getText, getWrappedDriver, getWrappedElement, isDisplayed, isSelected, sendKeys, submit
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.github.grossopa.selenium.core.component.WebComponent
findElement, findElements
-
-
-
-
Field Detail
-
COMPONENT_NAME
public static final String COMPONENT_NAME
The component name- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MuiBadge
public MuiBadge(org.openqa.selenium.WebElement element, com.github.grossopa.selenium.core.ComponentWebDriver driver, MuiConfig config)Constructs an instance with the delegated element and root driver- Parameters:
element- the delegated elementdriver- the root driverconfig- the Material UI configuration
-
-
Method Detail
-
versions
public Set<MuiVersion> versions()
Description copied from interface:MuiComponentGets all the supported versions- Specified by:
versionsin interfaceMuiComponent- Overrides:
versionsin classAbstractMuiComponent- Returns:
- all the supported versions
-
getBadge
public com.github.grossopa.selenium.core.component.WebComponent getBadge()
Finds the badge element. could be either visible or invisible. with a certain number or a dot indicates there is new message(s).- Returns:
- the badge element.
-
getBadgeNumber
public int getBadgeNumber()
Returns the number of the badge. Note it will return 0 for dot as well even if it's displayed.- Returns:
- the number of the badge.
-
isDotDisplayed
public boolean isDotDisplayed()
Whether the dot is displayed instead of numbers.- Returns:
- whether the dot is displayed
-
getComponentName
public String getComponentName()
Description copied from class:AbstractMuiComponentGets the current component name- Specified by:
getComponentNamein classAbstractMuiComponent- Returns:
- the current component name
-
isBadgeDisplayed
public boolean isBadgeDisplayed()
Whether the badge is displayed or not.- Returns:
- whether the badge is displayed or not
-
-