Flutter Integration Tests in Intellij IDEA
IntelliJ IDEA is a brilliant IDE and it has been becoming a “industrial standard” when the subject is IDE. However, IntelliJ has some tricks when we are working with integration tests using Flutter Driver. Only to clarify, Flutter Driver is a standalone tool for integration/functional testing (end-to-end test application) for Flutter. This article will demonstrate how to run Flutter Driver tests using IntelliJ.
Systems Requirements
- Intellij IDEA
- Flutter Driver
- Flutter 1.20.4
- DART 2.9.2
STEP 01: Create a ‘Run Configurations’
Here, two Run Configurations should be done:
- Flutter
- Dart Command Line App
All the configurations highlighted above are mandatory, and it is so important to emphasize that whether ‘Dart file’ or ‘Dart Entrypoint’ should be pointed to the Flutter-Driver folder.
IMPORTANT: When we use the option “ — disable-service-auth-codes” there is no need to apply the “App Token” in the “Environment variables — VM_SERVICE_URL”. However, only use this option in local testing environment because in automated scenarios it represents security risk.
STEP 02: Run the ‘Integration Tests’
Here, three “Runnings procedures” will be shown, and their sequence (below) are mandatory.
STEP 03: Restarting the tests in ‘Android Emulator’
To restart a test, you ought to:
- Select your “Flutter Running Configuration” (configuration done in picture 04)
- Use a “ Flutter Hot Restart” to restart your Integration test
In a Nutshell:
As you could see, “Flutter Integration Tests in Intellij IDEA” are not the “rocket science”. As you know, we are here to simplify everything for you! Please follow us, of course, if you like “Complex Contents” in a easy, simple and short steps. See you soon.
Github:
https://github.com/simplerdevdrops/02_flutter_tests_intellij
Credits and Sources:
https://medium.com/flutter-community/hot-reload-for-flutter-integration-tests-e0478b63bd54https://medium.com/@richard_62650/as-of-the-date-i-am-writing-this-this-no-longer-works-quite-like-this-1aa2c9fb4c33https://medium.com/@jdbaddley/for-anyone-coming-here-in-here-in-the-future-and-having-this-issue-dart-did-update-something-with-f749a54645a5https://www.youtube.com/watch?v=Vfi0uyDWIuM&list=PLUiueC0kTFqLvpFk_Zg55geh_TBTKnbnA&index=3