-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add support for conditional logic around elements #672
Comments
You can try/catch expectations and branch from that to the rest of your logic. So:
|
Tests with branches are bad tests in my opinion. Try making your input predictable by mocking what needs to be mocked. |
Try/catch will work thanks! — We need the branching logic to setup the tests the same on different logged in accounts- the tests themselves definitely shouldn’t branch. — Using mocked data doesn’t work for our use case since we want to test dependent services as well. |
This is a request to expose the ability to run code conditionally in detox tests based on the existence of elements.
For example:
The text was updated successfully, but these errors were encountered: