> ## Documentation Index
> Fetch the complete documentation index at: https://parttio-dramafinder-4.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# DetailsElement

> Playwright element wrapper for Vaadin Details component

# DetailsElement

Playwright element wrapper for `<vaadin-details>` providing helpers to open/close and access the summary and content areas.

## Component Tag

`vaadin-details`

## Implements

* `HasStyleElement` - CSS class and style management
* `HasThemeElement` - Theme variant support
* `HasTooltipElement` - Tooltip text

## Constructor

<ParamField path="locator" type="Locator" required>
  Playwright locator for the `<vaadin-details>` element
</ParamField>

## Static Factory Methods

### getBySummaryText

Get a details component by its summary text.

```java theme={null}
DetailsElement.getBySummaryText(Page page, String summary)
```

<ParamField path="page" type="Page">
  Playwright page
</ParamField>

<ParamField path="summary" type="String">
  Summary text to match
</ParamField>

## Methods

### isOpen

Whether the details is opened.

```java theme={null}
boolean isOpen()
```

### setOpen

Set the opened state by clicking the summary when necessary.

```java theme={null}
void setOpen(boolean open)
```

<ParamField path="open" type="boolean">
  Desired open state
</ParamField>

### getSummaryLocator

Locator for the summary element.

```java theme={null}
Locator getSummaryLocator()
```

### getSummaryText

Text content of the summary element.

```java theme={null}
String getSummaryText()
```

### getContentLocator

Locator for the currently visible content container.

```java theme={null}
Locator getContentLocator()
```

## Assertion Methods

### assertEnabled

Assert that the component is enabled.

```java theme={null}
void assertEnabled()
```

### assertDisabled

Assert that the component is disabled.

```java theme={null}
void assertDisabled()
```

### assertOpened

Assert that the details is opened.

```java theme={null}
void assertOpened()
```

### assertClosed

Assert that the details is closed.

```java theme={null}
void assertClosed()
```

### assertContentVisible

Assert that the content is visible.

```java theme={null}
void assertContentVisible()
```

### assertContentNotVisible

Assert that the content is not visible.

```java theme={null}
void assertContentNotVisible()
```

## Usage Examples

### Toggle Details Open/Close

```java theme={null}
DetailsElement details = DetailsElement.getBySummaryText(page, "Click to expand");
details.assertClosed();
details.setOpen(true);
details.assertOpened();
details.assertContentVisible();
```

### Check Summary and Content

```java theme={null}
DetailsElement details = DetailsElement.getBySummaryText(page, "More info");
String summaryText = details.getSummaryText();
assertEquals("More info", summaryText);

if (details.isOpen()) {
    assertThat(details.getContentLocator()).containsText("Additional details");
}
```

### Work with Disabled Details

```java theme={null}
DetailsElement details = new DetailsElement(page.locator("vaadin-details").first());
details.assertDisabled();
details.getSummaryLocator().click();
details.assertClosed(); // Should still be closed
```
