Created
November 24, 2018 03:54
-
-
Save prescottprue/83406f5bfc3cf873ba5313526e666d47 to your computer and use it in GitHub Desktop.
Attaching custom commands from cypress-firebase
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import firebase from 'firebase/app'; | |
import 'firebase/auth'; | |
import 'firebase/database'; | |
import 'firebase/firestore'; | |
import { attachCustomCommands } from 'cypress-firebase'; | |
const projectId = Cypress.env('FIREBASE_PROJECT_ID') | |
const env = Cypress.env('env') || 'stage' | |
const apiKey = Cypress.env('FIREBASE_API_KEY') | |
const fbConfig = { | |
apiKey, | |
authDomain: `${projectId}.firebaseapp.com`, | |
databaseURL: `https://${projectId}.firebaseio.com`, | |
projectId: `${projectId}`, | |
storageBucket: `${projectId}.appspot.com` | |
} | |
// Attach authed instance to window (so it can be picked up within the React App) | |
window.fbInstance = firebase.initializeApp(fbConfig); | |
// add cy.login, cy.logout, cy.callRtdb, and cy.callFirestore custom commands | |
attachCustomCommands({ Cypress, cy, firebase }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@prescottprue Do you have syntax for integration with typescript