Skip to content

feat(assertions): support attribute presence checks#3136

Open
Skn0tt wants to merge 1 commit into
microsoft:mainfrom
Skn0tt:skn0tt-fix-3133
Open

feat(assertions): support attribute presence checks#3136
Skn0tt wants to merge 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
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