You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current Detox matchers/testers are all based on the native component tree. However it would be nice if also things from the React-Native JS side could be tested. This would allow one to get e.g. AsyncStorage, Redux state, element props etc., and run tests against them.
I am currently running my own implementation through a second websocket channel for this purpose. E.g.
Setup websocket server when starting detox tests
React Native connects back to this websocket server
Now I can from my tests send JS command to RN (which simply evals what is sent, wraps it in try/catch, waits if result is a promise, and sends the results back as a JSON (or return an error if it cannot be JSONified)). To be able to do this, important objects should be available in the eval scope, such as AsyncStorage, redux state, component refs etc.
I found this setup to be quite powerful for testing, however it adds some complexity because there is a second websocket channel etc. Is it somehow possible to re-use Detox's websocket, or even add this functionality to Detox itself?
The text was updated successfully, but these errors were encountered:
This is out of scope for Detox. Detox' main purpose is to test the end result of your app, be it native or RN, and the end result for mobile apps is native UI. What you are describing sounds more fit for unit testing and/or some kind of a higher level component test for RN, which are out of scope.
Current Detox matchers/testers are all based on the native component tree. However it would be nice if also things from the React-Native JS side could be tested. This would allow one to get e.g. AsyncStorage, Redux state, element props etc., and run tests against them.
I am currently running my own implementation through a second websocket channel for this purpose. E.g.
eval
s what is sent, wraps it in try/catch, waits if result is a promise, and sends the results back as a JSON (or return an error if it cannot be JSONified)). To be able to do this, important objects should be available in theeval
scope, such as AsyncStorage, redux state, component refs etc.I found this setup to be quite powerful for testing, however it adds some complexity because there is a second websocket channel etc. Is it somehow possible to re-use Detox's websocket, or even add this functionality to Detox itself?
The text was updated successfully, but these errors were encountered: