Class NotificationLocator
java.lang.Object
com.vaadin.browserless.locator.Locator<Notification,NotificationLocator>
com.vaadin.flow.component.notification.NotificationLocator
- All Implemented Interfaces:
Clickable<Notification>,HasThemeFilter<Notification,NotificationLocator>
@Generated("com.vaadin.browserless.locator.processor.LocatorProcessor")
public class NotificationLocator
extends Locator<Notification,NotificationLocator>
implements Clickable<Notification>, HasThemeFilter<Notification,NotificationLocator>
Generated locator for
Notification, derived from
NotificationTester. Filter steps are inherited from
Locator; action methods delegate to a fresh tester
around the resolved component, so behavioral changes belong on the
tester, not here.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidSimulates auto-close of the notification, because of show duration timeout.voidEnsures the component is in a usable state before interaction.Gets the component being tested.getText()Gets the text of the notification.Methods inherited from class com.vaadin.browserless.locator.Locator
atIndex, component, components, exists, inside, inside, invalidate, self, with, withAttribute, withAttribute, withClassName, withCondition, withId, withoutAttribute, withoutAttribute, withoutClassName, withTestIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.browserless.Clickable
click, click, click, middleClick, middleClick, rightClick, rightClickMethods inherited from interface com.vaadin.browserless.locator.HasThemeFilter
withoutTheme, withTheme
-
Constructor Details
-
NotificationLocator
public NotificationLocator() -
NotificationLocator
-
-
Method Details
-
getComponent
Description copied from interface:ClickableGets the component being tested.- Specified by:
getComponentin interfaceClickable<Notification>- Returns:
- the component under test
-
ensureComponentIsUsable
public void ensureComponentIsUsable()Description copied from interface:ClickableEnsures the component is in a usable state before interaction.- Specified by:
ensureComponentIsUsablein interfaceClickable<Notification>
-
getText
Gets the text of the notification. If the notification is not displayed an IllegalStateException will be thrown as the end user would not be able to see the contents. Javadoc copied fromNotificationTester.getText().- Returns:
- the text of the notification
- Throws:
IllegalStateException- is notification is not displayed
-
autoClose
public void autoClose()Simulates auto-close of the notification, because of show duration timeout. If notification is not displayed or auto-close is disabled setting duration to 0 or negative, anIllegalStateExceptionis thrown. Javadoc copied fromNotificationTester.autoClose().- Throws:
IllegalStateException- if the notification is not displayed or has auto-close disabled.
-