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

Recipe for Firebase authentication #118

Open
Bkucera opened this issue Mar 2, 2018 · 5 comments
Open

Recipe for Firebase authentication #118

Bkucera opened this issue Mar 2, 2018 · 5 comments
Assignees
Labels

Comments

@Bkucera
Copy link
Member

@Bkucera Bkucera commented Mar 2, 2018

No description provided.

@Bkucera Bkucera added the recipe: new label Mar 2, 2018
@iancrowther

This comment has been minimized.

Copy link

@iancrowther iancrowther commented May 8, 2018

import firebase from 'firebase'

firebase.initializeApp({
  apiKey: '',
  authDomain: '',
  databaseURL: '',
  projectId: '',
  storageBucket: '',
  messagingSenderId: ''
})

describe('Home', () => {
  beforeEach(function () {
    cy.exec('firebase database:set / cypress/fixtures/seed.json --confirm')
    firebase.auth().signInWithEmailAndPassword('[username]', '[password]')
  })

  it('logs in programmatically without using the UI', function () {
    cy.visit('/')
    cy.get('#username').contains(firebase.auth().currentUser.email)
  })
})
@fikrikarim

This comment has been minimized.

Copy link

@fikrikarim fikrikarim commented Aug 17, 2018

Hi I'm trying to understand the solution here. Can you please explain the solution, and whether it is the best practice to mock firebase auth? I'm learning the best way to mock the firebase auth. Thanks!

@romines

This comment has been minimized.

Copy link

@romines romines commented Sep 11, 2018

@iancrowther I don't understand how you can call firebase.initializeApp({ ... }) if it is already called in app bootstrapping.

@bahmutov

This comment has been minimized.

Copy link
Collaborator

@bahmutov bahmutov commented Mar 26, 2019

I have looked at Firebase auth here: https://github.com/bahmutov/cypress-firebase-auth-example and it is pretty straightforward to log in using UI or firebase.auth().signInWithEmailAndPassword and I probably will a little bit more into this.

@bahmutov bahmutov self-assigned this Mar 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.