Skip to content

feat(assertions): support attribute presence checks - #3136

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

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

Conversation

@Skn0tt

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
Simon Knott (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