Skip to main content

CardElement

Playwright element wrapper for <vaadin-card> exposing slot-aware accessors for title, subtitle, header/footer, media, and content areas.

Component Tag

vaadin-card

Implements

  • HasThemeElement - Theme variant support
  • HasStyleElement - CSS class and style management

Constructor

Locator
required
Playwright locator for the <vaadin-card> element

Static Factory Methods

getByTitle

Get a card by its title text.
Page
Playwright page
Locator
Scope to search within
String
Card’s title text (matches slot=“title” content)

Slot Locators

getTitleLocator

Locator for the title slot (slot="title").

getSubtitleLocator

Locator for the subtitle slot (slot="subtitle").

getHeaderLocator

Locator for the header slot (slot="header").

getHeaderPrefixLocator

Locator for the header prefix slot (slot="header-prefix").

getHeaderSuffixLocator

Locator for the header suffix slot (slot="header-suffix").

getMediaLocator

Locator for the media slot (slot="media").

getFooterLocator

Locator for the footer slot (slot="footer").

getContentLocator

Locator for the default content slot (non-slotted first child).

Assertion Methods

assertTitle

Assert the card title text, or absence when null.
String
Expected title text, or null to assert absence

assertSubtitle

Assert the card subtitle text, or absence when null.
String
Expected subtitle text, or null to assert absence

Usage Examples

Access Card Slots

Find Nested Components