I have developed an Android app that integrates with Firebase
Firestore
and Realtime Database
. I now want to perform End-to-End (E2E) tests that involve Firebase.
Test Setup:
The goal is to synchronize the Python script with the Espresso tests:
I want to ensure that the updates and tests run in sync.
Are there any test frameworks that facilitate synchronisation between Python scripts and Espresso tests? Alternatively, what approaches or tools can help achieve this synchronisation effectively?
I am already using Mockk to mock Firebase for component tests. However, for E2E tests, I do not want to mock the Firebase database as I need to test real delays and avoid adding complexity to the mock objects.
Any insights or recommendations are appreciated!
My solution: I created a Flask server that acts as an interface between the Android Emulator and the Firebase Emulator.
Before (@BeforeClass) the tests I use OkHttp3 to send HTTP requests from the tests to the Flask server. These requests specify the data I want to load into Firebase. When the Flash server receives a request, it uses the Firebase Admin SDK to upload the data.