-
Notifications
You must be signed in to change notification settings - Fork 971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firestore emulator does not work in Cypress #1975
Comments
I am not familiar with Cypress, but is there something here that leads you to believe this is an issue with the Firebase emulators or the Firebase CLI? Can you see network traffic going out to the right host/port but the emulators not responding? To my (untrained) eye it seems like the issue is likely to be inside Cypress since this works in a "standard" web testing setup. |
I also run into the same problem, having the newest version of Java and Cypress 4.0.2 installed. I was able to make it work by using |
That is the same workaround we are using in cypress. I think the underlying problem is that Cypress is intercepting all network traffic so it can monitor and sometimes mock. However, the webchannel protocol used by firestore has multiple replies over the same http request. The Cypress code cannot handle this and will only forward the first reply and ignore the rest. |
@wvanderdeijl thanks for pointing this out! Since Cypress is intercepting all network requests we can't support any issues caused by that. So I am going to close this in favor of looking for a solution from the Cypress team over at cypress-io/cypress#2374 |
[REQUIRED] Environment info
firebase-tools: 7.13.0
Platform: macOS
[REQUIRED] Test case
yarn install
yarn emulators
yarn seed
yarn start
localhost:3000
in your browser - notice that data loads from both emulated databasesYou should see projects from Firestore and RTDB appear in the view. This is expected - the next section covers what is unexpected
[REQUIRED] Steps to reproduce
yarn test
At this point the data does not load from the Firestore emulator within Cypress even though they will load in the browser (pictured below). This error appears in the console of the window opened by Cypress:

[REQUIRED] Expected behavior
The expected behavior is that the Firestore emulator works within a browser window Cypress the same way it does in a normal browser - the same way RTDB emulator works
An issue was also filed on the Cypress Repo
[REQUIRED] Actual behavior
Connecting to the Firestore emulator within browser window opened by Cypress does work the way it does in a default browser. When attempting to open the app in Cypress it shows the "Could Not reach Firestore backend" error:
Happens in both Chrome and Electron
This issue has also been mentioned by another user in this stackoverflow post.
The text was updated successfully, but these errors were encountered: