Skip to content

Fix the expectNotVisible assertion to properly handle 0 elements present#105

Merged
tanyafortuna merged 1 commit into
mainfrom
feat/pw-improve-not-visible-assertion
May 20, 2026
Merged

Fix the expectNotVisible assertion to properly handle 0 elements present#105
tanyafortuna merged 1 commit into
mainfrom
feat/pw-improve-not-visible-assertion

Conversation

@tanyafortuna
Copy link
Copy Markdown
Collaborator

The expectNotVisible assertion was intended to pass (and documented as such) when:

  • there is exactly 1 element, and it's not visible, or
  • there are 0 elements with the target test id on the page

And it should fail if there is exactly 1 element and it's visible, or if there are 2+ elements of any visibility.

The bug is that the code currently only passes if there is exactly 1 invisible element, and the 0 elements case isn't covered.

This bugfix adds the second condition so it will properly pass if the element isn't there at all.

@tanyafortuna tanyafortuna self-assigned this May 18, 2026
@tanyafortuna tanyafortuna changed the title Fix the expectNotVisible assertion to properly handle 0 elements presnt Fix the expectNotVisible assertion to properly handle 0 elements present May 18, 2026
@tanyafortuna
Copy link
Copy Markdown
Collaborator Author

@belsrc @brandonjpierce another one for you, a small bugfix to make the expectNotVisible functionality match what the skill says it should be. Thanks!

@tanyafortuna tanyafortuna merged commit 8c1b202 into main May 20, 2026
6 checks passed
@tanyafortuna tanyafortuna deleted the feat/pw-improve-not-visible-assertion branch May 20, 2026 16:33
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.

2 participants