Integration Test Demo
Integration test setup + demo. Take your app from 🐴 to 🦄 .
Setup Steps
Clone this project (or create one with very_good_cli).
very_good create your_amazing_enterprise_project
Enable the platform you want to run your integration tests on:
cd your_amazing_enterprise_project
flutter create . --platforms=macos && rm test/widget_test.dart
Add a reference to integration_test
in your pubspec.yaml
, despite the fact that the integration_test
package shows up as "discontinued." (Anyone know why? File an issue and tell us why!)
Run integration tests!
flutter test integration_test -d macos
Note: Your folder has to be called integration_test
. All of your integration tests should be in this folder. The name integration_test
is a magic name that tells flutter it contains integration tests. 🤦♀️ I'm sorry, but that's just the way it is.
Integration tests run on the entire app on an actual device. How many services inside your app that you choose to mock is up to you.
For example, if you want to fully test your app, and your app downloads data from the internet, you could create a testing script that also runs a local web server to provide dummy data for your app's integration test scenario(s).
In the flutter space, integration tests are also sometimes called end-to-end (e2e) tests, despite many considering those two types of tests to be different. You are free to use the terminology that your organization uses, as long as you abide by flutter's rule to call that folder integration_test
.
Credits
Generated by the Very Good CLI 🦄 🤖
Allison helped a lot.