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

feat(commands): command for creating a user #88

Open
prescottprue opened this issue Feb 8, 2020 · 4 comments
Open

feat(commands): command for creating a user #88

prescottprue opened this issue Feb 8, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@prescottprue
Copy link
Owner

As mentioned in #14 by @fabiocarneiro there is a need for creating user's during tests:

I would like to have it like this:

cy.firebaseSignUp(email, password)
cy.firebaseSignIn(email, password)
other authentication options would also be interesting

Notes

  • Documentation should clearly specify that password should be stored in the cypress environment only (preferably passed in by CLI flag or passed from the environment running cypress)

Open Questions

  • Which other user auth methods need to be supported?
  • Is this best practice? Running a number of tests will cause the amount of users to build up over time - it is better practice to clean up after completing tests
@fabiocarneiro
Copy link

fabiocarneiro commented Feb 8, 2020

Although I also think in the direction passwords should not be in the code, I tend to think preventing this is not so much responsibility of the library (warnings are fine). I suggest to focus in two directions:

  • Help the library users to obtain one or multiple account data in a convenient way. Single env variable can be quite cumbersome with large userbase.
  • Allowing accounts to be easily created, either with defined usernames/passwords or with pattern/randomly created credentials.

@prescottprue
Copy link
Owner Author

prescottprue commented May 2, 2020

Something of note: Just using a UID that doesn't already exist creates the user if you are using cy.login since it is generating a custom auth token through firebase-admin which does this automatically.

Does that handle your case @fabiocarneiro? I would like to avoid directly advocating for creating new users in tests since it would require cleanup - this would add tons and tons of new accounts even after of a short time of having tests run as part of a CI flow where builds/tests are run regularly

@btjones
Copy link

btjones commented Jul 1, 2021

@prescottprue for my use case, I'm using the email returned from an authenticated session to do something in my app. I could likely rewrite my app logic to grab the email in another way but having this built into cypress-firebase would be a nice addition.

By the way, thanks for all of your work on cypress-firebase!

@damienromito
Copy link

cy.deleteUser() would be the most usefull because when I test the account creation, I need to manually delete the user in the firebase authentification emulator

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

No branches or pull requests

4 participants