Hi! Today I’d like to show you how to run Flutter integration tests on devices using Firebase Test Lab.
Integration tests check how different parts of the app work together. Unlike unit tests, they are intended to be run on devices (physical or virtual) and are used for end-to-end testing instead of testing particular components in separation. Because of that, integrations tests are much slower than unit tests, but they are a great way to check if our app works correctly in real-life scenarios.
While running integrations tests is a great way of testing the app, we’re unfortunately limited to the devices we have. They can be either physical devices, emulators or simulators, but we have to setup each one of them to run tests on our machine. That can become problematic if we’d like to test it on many different devices.
With Firebase Test Lab, we have access to** thousands of Google-hosted devices** with different device configurations. They are all stored in a cloud, so we can have remote access to them. All we have to do is to upload our app’s tests and Firebase will run them for us.
For this example, I’m going to use the default counter app that’s generated when you run flutter create
command.
If you want to follow these steps along the way, you can check out this repository’s branch: flutter_integration_testing
#flutter #firebase