Integration testing fundamentals
These tests verify the behavior of a complete app or a significant part of it, often involving multiple widgets and interactions. They ensure that the whole app works together as expected.
You can use the integration_test
package to run the app on a device or emulator, testing the full app’s interaction with real services and user flows. Also, you can add Firebase Test Lab so that you have support for multiple devices.
In this section, we’ll work on an improved version of widget testing that will interact between various components and logic to help us avoid having to use integration tests that will be run on a real device. On top of that, it will effectively validate the interactions between various parts of the app, making them closer to integration tests as defined by the Flutter documentation.
Creating a fake repository
Recall that we created FakeCartRepository
at the beginning of this chapter. At this point, we also need...