-
Notifications
You must be signed in to change notification settings - Fork 911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Add soft assertions #1272
Comments
Any idea how to implement this now? Try/Except with short timeout or is there a better way? |
I am using |
I tried this one but couldn't get it working with expect(). Do you have an example of this? Also +1 for soft assertions to be implemented in python as well as typescript. |
It's a separate assertion mechanism, so you don't use it within Also - you can mix assertions in your tests, so it's fine to use |
I agree, it would be really useful to have soft assertions in Python version of Playwright. Right now I'm using workarounds in some of my projects, similar to what was already mentioned above. I spent some time exploring the code and came up with an approach that seems to work. Here’s an example of how it looks: def test_foo(page: Page) -> None:
# ...
with soft_assertions() as expect:
expect(page.locator("div")).to_have_text("foo")
expect(page.locator("div")).to_have_text("bar")
At first, I considered an Would love any feedback on this! |
It would be nice to get the soft assertions that are available in node to be available in python.
https://playwright.dev/docs/test-assertions#soft-assertions
Thank you
The text was updated successfully, but these errors were encountered: