Search code examples
firebasetestingandroid-espressofirebase-test-lab

Can you test multiple devices using different accounts on Firebase?


If I ran a test using a batch of 4 physical devices on Firebase is it possible to have a different account for my app on each device?

Edit: I am working on testing an app that requires a user to sign in to an account and any changes made will be recorded on a database. Previously i was attempting to run tests using multiple devices however due to the fact that Firebase runs tests in parallel(or whenever the device is ready to receive the test) it can cause issues if 2 devices attempt to change the same thing at the same time. Im wondering is it possible to test multiple devices but use a different account on each one.


Solution

  • Test Lab has no built-in functionality for users to pass different configurations (test fixtures) to different device tests. You have to do this yourself. Couple of ideas:

    1. Use a device to account map. Identify the device in test and choose the account appropriately.
    2. Submit 4 "one device" tests, instead of just 1 "four device" test, and use environment variables to configure the test differently per test. Gcloud can accept environment variables via --environment-variables. Take a look at this Stackoverflow answer in case you need to know how to read them in your test.