Skip to content

feat: accept many selectors in assertSeeIn() and assertNotSeeIn() - #214

Open
Amoifr wants to merge 1 commit into
zenstruck:1.xfrom
Amoifr:feat-16-assert-see-in-selectors
Open

feat: accept many selectors in assertSeeIn() and assertNotSeeIn()#214
Amoifr wants to merge 1 commit into
zenstruck:1.xfrom
Amoifr:feat-16-assert-see-in-selectors

Conversation

@Amoifr

@Amoifr Amoifr commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Closes #16.

assertSeeIn() and assertNotSeeIn() now also take an iterable of selectors, exactly as sketched in the issue. Every selector must contain the text for the positive assertion, and none may for the negative one.

assertNotSeeIn() was not part of the request. I did it anyway because leaving the pair asymmetric would be surprising, happy to drop it if you would rather keep the change minimal.

The README's opening example is the case from the issue, two consecutive assertSeeIn with the same expected text, so I left it alone and documented the new form in the assertion list instead. Say the word if you want the headline example switched over too.

Checking the same text in several places took one call per selector. Both
methods now also take an iterable of selectors: every one of them must
contain the text, and for the negative assertion none of them may.

assertNotSeeIn() was not in the request, but leaving the pair asymmetric
would have been surprising.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Allow assertSeeIn() selector to be array or string

1 participant