Overview
NotificationElement is a Playwright wrapper for notification cards <vaadin-notification-card>. It provides utilities to verify notification visibility and access notification content.
Component tag: vaadin-notification-card
Implements:
HasThemeElementHasStyleElement
Constructors
NotificationElement(Page page)
Create aNotificationElement from the page by locating the first <vaadin-notification-card> element.
The Playwright page instance
NotificationElement(Locator locator)
Create aNotificationElement from an existing locator.
The Playwright locator for the notification element
Methods
isOpen()
Check whether the notification is open (visible). Returns:boolean - True if the notification is visible
assertOpen()
Assert that the notification is open and visible. Verifies: The element is visible in the DOM.assertClosed()
Assert that the notification is closed or hidden. Verifies: The element is hidden in the DOM.getContentLocator()
Get the locator for the notification content. Returns:Locator - The notification element itself (content is within the card)
Usage Example
Notes
- Notifications typically auto-close after a duration unless configured otherwise
- The notification card appears as an overlay on the page
- Multiple notifications can be shown simultaneously
- Content can be plain text or component-based