Skip to content
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

Open
heathiviesyncro opened this issue Apr 25, 2022 · 4 comments
Open

[Feature] Add soft assertions #1272

heathiviesyncro opened this issue Apr 25, 2022 · 4 comments

Comments

@heathiviesyncro
Copy link

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

@mxschmitt mxschmitt changed the title Can we please get soft assertions added to the python tools [Feature] Add soft assertions Jun 1, 2022
@vlado48
Copy link

vlado48 commented Jun 2, 2022

Any idea how to implement this now? Try/Except with short timeout or is there a better way?

@aspenboy
Copy link

aspenboy commented Dec 7, 2022

I am using pytest-check for soft assertions. Adds another dependency to the project, but it works great.

@jfp1992
Copy link

jfp1992 commented Sep 27, 2023

I am using pytest-check for soft assertions. Adds another dependency to the project, but it works great.

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.

@aspenboy
Copy link

I tried this one but couldn't get it working with expect(). Do you have an example of this?

It's a separate assertion mechanism, so you don't use it within expect(). Pretty nice examples are included on the github page: https://github.com/okken/pytest-check

Also - you can mix assertions in your tests, so it's fine to use assert, expect() and check().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants