Skip to content

fix: accept pseudo option in LocatorAssertions.not_to_have_css (#3244) - #3255

Closed
Abhinav Maurya (Fire162) wants to merge 1 commit into
microsoft:mainfrom
Fire162:fix/locator-assertions-not-to-have-css-pseudo
Closed

Abhinav Maurya (Fire162) wants to merge 1 commit into
microsoft:mainfrom
Fire162:fix/locator-assertions-not-to-have-css-pseudo

Conversation

@Fire162

Copy link
Copy Markdown

Fixes #3244.

LocatorAssertions.not_to_have_css rejected the pseudo parameter that to_have_css accepted, causing TypeError: LocatorAssertions.not_to_have_css() got an unexpected keyword argument 'pseudo'.

This PR:

  1. Adds pseudo: Literal["after", "before"] = None to not_to_have_css in playwright/_impl/_assertions.py and forwards it to self._not.to_have_css.
  2. Updates generated sync and async LocatorAssertions.not_to_have_css wrappers in playwright/async_api/_generated.py and playwright/sync_api/_generated.py.
  3. Adds regression tests for to_have_css and not_to_have_css using pseudo="before" in both async and sync assertion test suites.

@pavelfeldman

Copy link
Copy Markdown
Member

Thanks for the report and the fix! The public API is now generated from the upstream docs, so _generated.py can't be edited by hand: the next regeneration would drop the change. We added the option to the docs in microsoft/playwright#43414 and made the Python change in #3261. Closing this in favor of that one.

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.

[Bug]: LocatorAssertions.not_to_have_css does not accept the pseudo option that to_have_css accepts

2 participants