Skip to content

feat(assertions): support attribute presence checks#3136

Merged
Skn0tt merged 1 commit into
microsoft:mainfrom
Skn0tt:skn0tt-fix-3133
Jul 16, 2026
Merged

feat(assertions): support attribute presence checks#3136
Skn0tt merged 1 commit into
microsoft:mainfrom
Skn0tt:skn0tt-fix-3133

Conversation

@Skn0tt

@Skn0tt Skn0tt commented Jul 16, 2026

Copy link
Copy Markdown
Member

This lets Python users assert attribute presence or absence by omitting value:

expect(locator).to_have_attribute("disabled")
expect(locator).not_to_have_attribute("readonly")

The driver expression already exists. Calls without value use it, while existing string and regular-expression checks keep their current behaviour.

The generated metadata comes from microsoft/playwright#41813, which should merge first.

Fixes #3133

Fixes: microsoft#3133

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 861a91ea-4320-4455-adfe-ad164f6f0fc4
@Skn0tt
Skn0tt requested a review from dgozman July 16, 2026 08:43
@Skn0tt
Skn0tt merged commit 55fa500 into microsoft:main Jul 16, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Optional value in LocatorAssertions to_have_attribute and not_to_have_attribute

2 participants