Is it possible to test different databaseUrls? #1312
Replies: 1 comment 1 reply
-
Hey - thanks for reaching out with the question! Calls to the database happen through tasks (on the node side) which are called by custom commands (browser side). Because of this, as mentioned in the setup section in the README, you must pass In export default defineConfig({
e2e: {
baseUrl: 'http://localhost:3000',
// NOTE: Add "supportFile" setting if separate location is used
setupNodeEvents(on, config) {
// e2e testing node events setup code
return cypressFirebasePlugin(on, config, admin, {
// Here is where you can pass special options.
// if your databaseURL is not just your projectId plus ".firebaseio.com", then you _must_ give it here, like so:
databaseURL: 'https://test-b-url.firebaseio.com',
});
},
},
}); This is because internally, the plugin initializes Since the question came up, I'll try to think of ways to make it more clear within the README - the "use different rtdb instance" section kinda touches on this, but that example is specific to emulator case and only different instances, not fully different DBs. Open to ideas around this |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for making this awesome lib!
It helps a lot in our testing.
I was wondering if this supports to test different dataBaseUrl?
We've tried to setup
https://test-a-url.firebaseio.com
as databaseUrl in firebase-admin in plugin/index.js, and init by below script withbut while running cy.callRtdb, it still reads
https://test-a-url.firebaseio.com
.I saw the "Make sure you use the same databaseURL when initializing the firebase instance within your app code", does it mean currently this lib only support single databaseURL? or there's any way to approch connecting multiple db urls in the tests?
Thanks again for creating this lib!
Beta Was this translation helpful? Give feedback.
All reactions