Skip to main content

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:
  • HasThemeElement
  • HasStyleElement

Constructors

NotificationElement(Page page)

Create a NotificationElement from the page by locating the first <vaadin-notification-card> element.
Page
required
The Playwright page instance

NotificationElement(Locator locator)

Create a NotificationElement from an existing locator.
Locator
required
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