mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
This adds a smoke test for every single API example. It also fixes 17 tests that had bugs in them, or were otherwise broken, and even fixes one actual bug in the framework, and one limitation in the framework. The bug in the framework is that NetworkImage's _loadAsync method had await response.drain<List<int>>();, but if the response is null, it will throw a cryptic exception saying that Null can't be assigned to List<int>. The fix was just to use await response.drain<void>(); instead. The limitation is that RelativePositionedTransition takes an Animation<Rect> rect parameter, and if you want to use a RectTween with it, the value emitted there is Rect?, and one of the examples was just casting from Animation<Rect> to Animation<Rect?>, which is invalid, so I modified RelativePositionedTransition to take a Rect? and just use Rect.zero if the rect is null.
Flutter Web integration tests
To run the tests in this package download the chromedriver matching the
version of Chrome. To find out the version of your Chrome installation visit chrome://version.
Start chromedriver using the following command:
chromedriver --port=4444
Here's an example of running an integration test:
flutter drive --target=test_driver/text_editing_integration.dart -d web-server --browser-name=chrome
More resources:
- chromedriver: https://chromedriver.chromium.org/getting-started
- FlutterDriver: https://github.com/flutter/flutter/wiki/Running-Flutter-Driver-tests-with-Web
package:integration_test: https://pub.dev/packages/integration_test