Class AvatarGroupElement
- All Implemented Interfaces:
Findable<ComponentQuery<AvatarGroupElement>>,HasLocatorElement,HasStyleElement,HasThemeElement
<vaadin-avatar-group>.
The group renders one <vaadin-avatar> per visible item as a direct
light-DOM child, plus a single overflow avatar carrying slot="overflow"
once maxItemsVisible (or the available width) hides some of them.
Clicking the overflow avatar opens an overlay holding a
<vaadin-avatar-group-menu> whose <vaadin-avatar-group-menu-item>
children each wrap the avatar of one hidden item. Those avatars are in the DOM
as soon as the group overflows, but are only visible while the overlay is open.
Individual avatars — visible or overflowing — are exposed as
AvatarElement instances.
-
Field Summary
FieldsFields inherited from class org.vaadin.addons.dramafinder.element.VaadinElement
locator -
Constructor Summary
ConstructorsConstructorDescriptionAvatarGroupElement(com.microsoft.playwright.Locator locator) Create a newAvatarGroupElement. -
Method Summary
Modifier and TypeMethodDescriptionvoidAssert that no avatar is hidden behind the overflow avatar.voidAssert that some avatars are hidden behind the overflow avatar.voidassertNames(String... names) Assert the names of the visible avatars, in order.voidAssert that the overflow overlay is closed.voidassertOverflowNames(String... names) Assert the names of the avatars hidden behind the overflow avatar, in order.voidAssert that the overflow overlay is open.voidassertVisibleCount(int count) Assert the number of visible avatars, excluding the overflow avatar.voidClose the overflow overlay with theEscapekey, and wait until it is closed.static AvatarGroupElementget(com.microsoft.playwright.Locator locator) Get the firstAvatarGroupElementwithin a scope.static AvatarGroupElementget(com.microsoft.playwright.Page page) Get the firstAvatarGroupElementon the page.getAvatar(int index) Get the avatar at the given position among the visible avatars.Get the visible avatars, in rendering order.com.microsoft.playwright.LocatorLocator matching every visible avatar, in rendering order.static AvatarGroupElementGet anAvatarGroupElementby itsid, scoped to the given locator.static AvatarGroupElementGet anAvatarGroupElementby itsid, searching the entire page.static AvatarGroupElementgetByTestId(com.microsoft.playwright.Locator locator, String testId) Get anAvatarGroupElementby its test id, scoped to the given locator.static AvatarGroupElementgetByTestId(com.microsoft.playwright.Page page, String testId) Get anAvatarGroupElementby its test id, searching the entire page.Get the maximum number of avatars the group displays before overflowing.getNames()Get the names of the visible avatars, in rendering order.Get the overflow avatar, the one summarising the hidden items as+N.Get the avatars hidden behind the overflow avatar, in rendering order.com.microsoft.playwright.LocatorLocator matching every avatar inside the overflow overlay, in rendering order.com.microsoft.playwright.LocatorLocator for the overflow overlay menu, which holds one menu item per hidden avatar.Get the names of the avatars hidden behind the overflow avatar, in rendering order.intGet the number of visible avatars, excluding the overflow avatar.booleanWhether some avatars are hidden behind the overflow avatar.booleanWhether the overflow overlay is currently open.voidOpen the overflow overlay by clicking the overflow avatar, and wait until it is open.voidsetMaxItemsVisible(int maxItemsVisible) Set the maximum number of avatars to display before overflowing.Methods inherited from class org.vaadin.addons.dramafinder.element.VaadinElement
assertHidden, assertVisible, assertVisible, click, find, getLocator, getProperty, getText, isHidden, isVisible, isVisible, setPropertyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.vaadin.addons.dramafinder.element.shared.HasLocatorElement
getLocator, waitAfterAction, waitForVaadinIdleMethods inherited from interface org.vaadin.addons.dramafinder.element.shared.HasStyleElement
assertCssClass, getCssClassMethods inherited from interface org.vaadin.addons.dramafinder.element.shared.HasThemeElement
assertHasNoThemeVariant, assertHasThemeVariant, assertTheme, getTheme
-
Field Details
-
FIELD_TAG_NAME
- See Also:
-
FIELD_MENU_TAG_NAME
- See Also:
-
FIELD_MENU_ITEM_TAG_NAME
- See Also:
-
-
Constructor Details
-
AvatarGroupElement
public AvatarGroupElement(com.microsoft.playwright.Locator locator) Create a newAvatarGroupElement.- Parameters:
locator- the locator for the<vaadin-avatar-group>element
-
-
Method Details
-
get
Get the firstAvatarGroupElementon the page.- Parameters:
page- the Playwright page- Returns:
- the first matching
AvatarGroupElement
-
get
Get the firstAvatarGroupElementwithin a scope.- Parameters:
locator- the scope containing the group (not the group itself)- Returns:
- the first matching
AvatarGroupElement
-
getAvatarsLocator
public com.microsoft.playwright.Locator getAvatarsLocator()Locator matching every visible avatar, in rendering order. The overflow avatar is not included.- Returns:
- locator for the visible
<vaadin-avatar>children
-
getAvatars
Get the visible avatars, in rendering order.- Returns:
- the visible avatars, empty when the group has no items
-
getAvatar
Get the avatar at the given position among the visible avatars.- Parameters:
index- zero-based index- Returns:
- the avatar at that position
-
getVisibleCount
public int getVisibleCount()Get the number of visible avatars, excluding the overflow avatar.- Returns:
- the visible avatar count
-
getNames
Get the names of the visible avatars, in rendering order.- Returns:
- the names; an entry is
nullwhen that avatar has no name
-
getMaxItemsVisible
Get the maximum number of avatars the group displays before overflowing.- Returns:
- the
maxItemsVisibleproperty, ornullwhen unset
-
setMaxItemsVisible
public void setMaxItemsVisible(int maxItemsVisible) Set the maximum number of avatars to display before overflowing.- Parameters:
maxItemsVisible- the maximum number of visible avatars
-
getOverflowAvatar
Get the overflow avatar, the one summarising the hidden items as+N. It is present even when nothing overflows, in which case it is hidden.- Returns:
- the overflow avatar
-
hasOverflow
public boolean hasOverflow()Whether some avatars are hidden behind the overflow avatar.- Returns:
truewhen the group has an overflow
-
openOverflow
public void openOverflow()Open the overflow overlay by clicking the overflow avatar, and wait until it is open. Does nothing when the overlay is already open — clicking the overflow avatar toggles the overlay, so an unconditional click would close it again. -
closeOverflow
public void closeOverflow()Close the overflow overlay with theEscapekey, and wait until it is closed. -
isOverflowOpen
public boolean isOverflowOpen()Whether the overflow overlay is currently open.- Returns:
truewhen the overlay is open
-
getOverflowMenuLocator
public com.microsoft.playwright.Locator getOverflowMenuLocator()Locator for the overflow overlay menu, which holds one menu item per hidden avatar.- Returns:
- locator for
<vaadin-avatar-group-menu>
-
getOverflowAvatarsLocator
public com.microsoft.playwright.Locator getOverflowAvatarsLocator()Locator matching every avatar inside the overflow overlay, in rendering order.- Returns:
- locator for the overflowing
<vaadin-avatar>elements
-
getOverflowAvatars
Get the avatars hidden behind the overflow avatar, in rendering order. They are in the DOM as soon as the group overflows, but only become visible onceopenOverflow()has opened the overlay.- Returns:
- the overflowing avatars, empty when nothing overflows
-
getOverflowNames
Get the names of the avatars hidden behind the overflow avatar, in rendering order.- Returns:
- the names; an entry is
nullwhen that avatar has no name
-
assertNames
Assert the names of the visible avatars, in order.- Parameters:
names- the expected names
-
assertOverflowNames
Assert the names of the avatars hidden behind the overflow avatar, in order.- Parameters:
names- the expected names
-
assertVisibleCount
public void assertVisibleCount(int count) Assert the number of visible avatars, excluding the overflow avatar.- Parameters:
count- the expected visible avatar count
-
assertHasOverflow
public void assertHasOverflow()Assert that some avatars are hidden behind the overflow avatar. -
assertHasNoOverflow
public void assertHasNoOverflow()Assert that no avatar is hidden behind the overflow avatar. -
assertOverflowOpen
public void assertOverflowOpen()Assert that the overflow overlay is open. -
assertOverflowClosed
public void assertOverflowClosed()Assert that the overflow overlay is closed. -
getById
Get anAvatarGroupElementby itsid, searching the entire page.A fallback for a component without a user-visible name: prefer the label or text lookups when there is one. The id must match in full; two components with that id fail with a strict-mode error.
- Parameters:
page- the Playwright pageid- the fullid- Returns:
- the matching
AvatarGroupElement
-
getById
Get anAvatarGroupElementby itsid, scoped to the given locator.A fallback for a component without a user-visible name. The id must match in full; two components with that id inside the scope fail with a strict-mode error.
- Parameters:
locator- the locator whose subtree is searchedid- the fullid- Returns:
- the matching
AvatarGroupElement
-
getByTestId
Get anAvatarGroupElementby its test id, searching the entire page.The test id is Playwright's test id attribute,
data-testidunless reconfigured — the attribute Flow'sComponent.setTestId(String)sets. A fallback for a component without a user-visible name; it must match in full, and two components with that test id fail with a strict-mode error.- Parameters:
page- the Playwright pagetestId- the full test id- Returns:
- the matching
AvatarGroupElement
-
getByTestId
public static AvatarGroupElement getByTestId(com.microsoft.playwright.Locator locator, String testId) Get anAvatarGroupElementby its test id, scoped to the given locator.See
getByTestId(Page, String); only components inside the scope are considered.- Parameters:
locator- the locator whose subtree is searchedtestId- the full test id- Returns:
- the matching
AvatarGroupElement
-