I have setted up Flutter Integration Testing on my project as defined here: https://flutter.dev/docs/testing/integration-tests
I used the following devDepencendies:
integration_test: ^1.0.0
flutter_test:
sdk: flutter
flutter_driver:
sdk: flutter
The test driver is just a C&P from project page:
import 'package:integration_test/integration_test_driver.dart';
Future<void> main() => integrationDriver();
The final test:
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
testWidgets('CPCSA-TC-016: Vehicle Card with no alert',
(WidgetTester tester) async {
app.main();
// Execute test code.
});
}
Finally I run my tests with
flutter drive --driver=test_driver/integration_test.dart --target=integration_test/test.dart
Which is basically fine, but it compiles at every execution and this is very time consuming. Is there a chance that I can run the integration test and have the same hot reload feature as I would have for regular development? How to achieve this?
Or is there any other workaround? I am thinking about writing the test code as unit/widget test first and just port it into integration tests once the execution is correct.