Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion docs/src/api/class-locatorassertions.md
Original file line number Diff line number Diff line change
Expand Up @@ -1591,7 +1591,8 @@ Expected attribute value. If not specified, the assertion verifies that the attr

## async method: LocatorAssertions.toHaveAttribute#2
* since: v1.39
* langs: js
* langs: js, java

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's expose it in other languages too

- alias-java: hasAttribute

Ensures the [Locator] points to an element with given attribute. The method will assert attribute
presence.
Expand All @@ -1603,6 +1604,11 @@ await expect(locator).toHaveAttribute('disabled');
await expect(locator).not.toHaveAttribute('open');
```

```java
assertThat(locator).hasAttribute("disabled");
assertThat(locator).not().hasAttribute("open");
```

### param: LocatorAssertions.toHaveAttribute#2.name
* since: v1.39
- `name` <[string]>
Expand All @@ -1615,6 +1621,9 @@ Attribute name.
### option: LocatorAssertions.toHaveAttribute#2.signal = %%-js-assertions-signal-%%
* since: v1.62

### option: LocatorAssertions.toHaveAttribute#2.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.39

## async method: LocatorAssertions.toHaveClass
* since: v1.20
* langs:
Expand Down