You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Test environment config generation (including custom auth token) with [`createTestEnvFile`](#createTestEnvFile):
12
+
13
+
`cypress-firebase createTestEnvFile`
12
14
*[Custom cypress commands](https://docs.cypress.io/api/cypress-api/custom-commands.html#Syntax) for auth and database interactions:
13
15
*[`cy.login`][1]
14
16
*[cy.logout][4]
@@ -100,15 +102,24 @@ Tests will run faster locally if you tests against the build version of your app
100
102
1. In another terminal window, run a test command such as `npm run test:open`
101
103
102
104
## Docs
105
+
103
106
### CLI Commands
104
107
108
+
#### createTestEnvFile {#createTestEnvFile}
109
+
Create test environment file (`cypress.env.json`) which contains custom auth token generated using `firebase-admin` SDK and `serviceAccount.json`.
110
+
111
+
##### Examples
112
+
113
+
```bash
114
+
cypress-firebase createTestEnvFile
115
+
```
116
+
105
117
### Custom Cypress Commands
106
118
107
119
#### Table of Contents
108
120
109
121
-[cy.login][1]
110
122
-[Examples][2]
111
-
- [currentUser][3]
112
123
-[cy.logout][4]
113
124
-[Examples][5]
114
125
-[cy.callRtdb][6]
@@ -118,39 +129,41 @@ Tests will run faster locally if you tests against the build version of your app
118
129
-[Parameters][10]
119
130
-[Examples][11]
120
131
121
-
### cy.login
132
+
####cy.login
122
133
123
134
Login to Firebase auth using `FIREBASE_AUTH_JWT` environment variable
124
135
which is generated using `firebase-admin` authenticated with serviceAccount
125
136
during `build:testConfig` phase.
126
137
127
-
#### Examples
138
+
#####Examples
128
139
129
140
```javascript
130
141
cy.login()
131
142
```
132
143
133
-
### cy.logout
144
+
####cy.logout
134
145
135
146
Log out of Firebase instance
136
147
137
-
#### Examples
148
+
#####Examples
138
149
139
150
```javascript
140
151
cy.logout()
141
152
```
142
-
### cy.callRtdb
153
+
154
+
#### cy.callRtdb
143
155
144
156
Call Real Time Database path with some specified action. Authentication is through `FIREBASE_TOKEN` since firebase-tools is used (instead of firebaseExtra).
145
157
146
-
### Parameters
158
+
#####Parameters
147
159
148
160
-`action`**[String][11]** The action type to call with (set, push, update, remove)
149
161
-`actionPath`**[String][11]** Path within RTDB that action should be applied
150
162
-`opts`**[Object][12]** Options
151
163
-`opts.args`**[Array][13]** Command line args to be passed
0 commit comments