Open adazh opened 5 years ago
@goderbauer
Adding error codes sounds good. Unfortunately, most exceptions are currently just caught by a catch-all. It would be very helpful if you can post all exception types you run into on this bug and I can then go through them to give them specific error codes.
A few off the top of my mind: 1) Timeout; 2) No matching widget; 3) Multiple matching; ...
I think we could start with these three.
Currently when the error occurs when talking to the Flutter testing/driver APIs, the API returns a text containing error message and traces. It would be brittle if Espresso/EarlGrey relies on passing the error text to interpret the error.
Two examples: 1) When no matching UI element is found: JSON-RPC Request sent to uri ws://127.0.0.1:45257/Q-Bxibr0quE=/ws:
JSON-RPC response received:
2) When there are multiple UI element matches: JSON-RPC Request sent to uri ws://127.0.0.1:38582/Bc3XMX9_8wk=/ws:
JSON-RPC response received:
Proposal: 1) Using error codes in the responses to better present the errors; 2) Possibly clean up the error messages to make it more user-readable.