Multi-env serviceAccount.json usage
alexzavg opened this issue · 1 comments
Hello,
This is neither a bug nor a feature request, just a question.
I'm using cypress for automation.
Our app uses Firestore DB on multiple envs (dev, staging), which means there are multiple projects inside Firebase Console https://take.ms/vB4PL
My initial task is to run the same set of specs on different envs (currently on 2 - dev & staging).
In this cypress-firebase documentation there's info that a file serviceAccount.json is used when calling method cy.callFirestore()
The issue is that serviceAccount.json
contains auth info for a single env, so I'm able to run tests on, for example, dev
env with one config, but when I try to run same test for staging
env - the same serviceAccount.json
file is being used.
Maybe I haven't read the module info carefully enough, but I can't seem to find the solution on how the serviceAccount.json
file path is being passed to cy.callFirestore
method.
I've thougth about creating 2 separate files, each containing auth info for the specific Firebase project.
If possible, could you please guide me on how can I conditionally make Cypress use specific file depending on the env I'm running my tests against?
P.S. Current guide isn't clear on where to get the tenant token https://github.com/prescottprue/cypress-firebase#cylogin
Specifically, this text isn't clear To specify a tenant ID, either pass the ID as a parameter to cy.login, or set it as environment variable TEST_TENANT_ID. Read more about [Firebase multi-tenancy] (the link is broken btw) (https://firebase.google.com/docs/reference/admin/node/admin.auth.Tenant).
It would be great if more specific steps were provided regarding this issue. Thanks.
Hello @alexzavg where you able to solve this issue?
This is a really interesting use case.
Thank you.