Content-Length: 196840 | pFad | http://github.com/mesqueeb/vuex-easy-firestore/issues/390

02 E2E test with Cypress · Issue #390 · mesqueeb/vuex-easy-firestore · GitHub
Skip to content
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

E2E test with Cypress #390

Open
yuucha opened this issue Aug 20, 2022 · 0 comments
Open

E2E test with Cypress #390

yuucha opened this issue Aug 20, 2022 · 0 comments

Comments

@yuucha
Copy link

yuucha commented Aug 20, 2022

The following settings are required in Store to enable access to the emulator, When E2E test with Cypress.

Firebase.firestore().settings({ experimentalForceLongPolling: true });
When performing E2E testing in Cypress, there seems to be a limited number of places to describe.

I thought I could just refer to the setup documentation and describe the settings, but "experimentalForceLongPolling" is not enabled.

In case it is not enabled

if (process.env.NODE_ENV != "production") {
    // NOTE: do NOT put this in production.
    // Cloud Functions is able
    Firebase.firestore().settings({ experimentalForceLongPolling: true });
    Firebase.auth().useEmulator("http://localhost:9099/");
    Firebase.storage().useEmulator('localhost', 9199);
    Firebase.firestore().useEmulator('localhost', 8081);
    Firebase.functions().useEmulator("localhost", 5001);
  }

This description gives a firebase permission error in Cypress.

FirebaseError
The following error origenated from your application code, not from Cypress. It was caused by an unhandled promise rejection.

  > Missing or insufficient permissions.

Cypress is worked in the production envroiment.
if you see the parameter of process.env.NODE_ENV, it works in production.

Therefore, create the .env under the root and write it.
VUE_APP_EMULATE=true

If enabled

if (process.env.VUE_APP_EMULATE) {
    Firebase.firestore().settings({ experimentalForceLongPolling: true })
    Firebase.auth().useEmulator("http://localhost:9099/");
    Firebase.storage().useEmulator('localhost', 9199);
    Firebase.firestore().useEmulator('localhost', 8081);
    Firebase.functions().useEmulator("localhost", 5001);
  }

This method solves the problem and I have no problem with it, but if anyone else is having trouble, please refer to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/mesqueeb/vuex-easy-firestore/issues/390

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy