Add package:http requests to network integration test#9016
Add package:http requests to network integration test#9016srawlins merged 3 commits intoflutter:masterfrom
Conversation
| } | ||
|
|
||
| // TODO WebSocket | ||
| // TODO package:http - BrowserClient - https://pub.dev/documentation/http/latest/browser_client/BrowserClient-class.html |
There was a problem hiding this comment.
I forgot that Flutter DevTools is not geared towards Flutter Web apps, where users will more likely use their browser's developer tools in order to examine network requests. So 'package:http - BrowserClient' and fetch_client are out.
There was a problem hiding this comment.
Correct, only some of the tools are available for web apps. Any screen that has requiresDartVm: true is not enabled for web: https://github.com/flutter/devtools/blob/master/packages/devtools_app/lib/src/shared/framework/screen.dart/#L80
| await helper.clear(); | ||
|
|
||
| // Instruct the app to make a POST request via the 'http' package. | ||
| await helper.triggerRequest('packageHttp/post/'); |
There was a problem hiding this comment.
do we need a mirrored change in the test app to support this api?
There was a problem hiding this comment.
No they were already there (as dead code); I missed them.
|
|
||
| // Instruct the app to make a GET request via the 'http' package. | ||
| await helper.triggerRequest('packageHttp/get/'); | ||
| _expectInRequestTable('GET'); |
There was a problem hiding this comment.
this expect statement could be true because of the get request on line 41. We need to ensure we can uniquely identify the requests in the table, either with some key or by checking findsNWidgets instead which should increase for each request of the same method.
There was a problem hiding this comment.
We press the 'Clear' button between test cases.
There was a problem hiding this comment.
Ah okay. Just to be certain, can we add an expect statement at the end of the helper.clear() method that verifies screenControllers.lookup().requests.value is empty?
There was a problem hiding this comment.
Oh, excellent, done!
Work towards #7554.