-
Notifications
You must be signed in to change notification settings - Fork 948
Build out e2e subdirectories #9065
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
Merged
Merged
Changes from 11 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
962a2df
Build out e2e subdirectories
hsubox76 bd3dd47
Set up template and READMEs
hsubox76 f6bb556
license I guess
hsubox76 2537155
test on this pr
hsubox76 43cf0bf
test on this pr
hsubox76 41e4e1a
add s
hsubox76 b51e601
use latest
hsubox76 fc58bcd
fix script path
hsubox76 25e1cd3
indent
hsubox76 8fdadd3
fix version
hsubox76 b2ac830
revert chagnes in yml for testing
hsubox76 99e35d6
address comments
hsubox76 423d6b7
address comments
hsubox76 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,11 @@ | ||
# Firebase JS SDK E2E Tests | ||
# E2E Tests | ||
|
||
This directory contains end-to-end tests for the Firebase JS SDK package as well as minimal quick start sample apps for debugging and development. | ||
This directory is for Firebase E2E tests that are completely independent of the main SDK workspaces. Packages in here should | ||
|
||
hsubox76 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
## E2E Tests | ||
* Have a start trigger independent of the main CI PR/push triggers (e.g., manual trigger, repository_dispatch, from an external runner like Kokoro, etc.) | ||
|
||
A common use case might be to clone this repo, cd into the chosen directory under e2e, npm install, and run npm scripts. | ||
|
||
### Setup | ||
* Have a self-contained set of NPM dependencies. They should not depend on the local version of Firebase in the SDK nor assume inherited availability of any packages in the top level package.json of this repo (typescript, firebase, karma, etc.). | ||
|
||
Before running the tests, you will need: | ||
|
||
- a project config | ||
- a test user with an email/password login which has read/write privileges for Storage, Realtime Database, and Firestore | ||
- an App Check debug token | ||
- to deploy the `callTest` Cloud Function | ||
|
||
#### Project Config and Test User | ||
|
||
Create a file named `firebase-config.js` in the top level of this `e2e/` directory. The contents of the file should be: | ||
|
||
```javascript | ||
// A config for a project | ||
export const config = { | ||
apiKey: ************, | ||
authDomain: ************, | ||
databaseURL: ************, | ||
projectId: ************, | ||
storageBucket: ************, | ||
messagingSenderId: ************, | ||
appId: ************, | ||
measurementId: ************ | ||
}; | ||
* | ||
// A user account with read/write privileges in that project | ||
// for storage, database, firestore | ||
export const testAccount = { | ||
email: ************, | ||
password: ************ | ||
} | ||
``` | ||
|
||
#### App Check Debug Token | ||
|
||
Create an App Check debug token in the Firebase Console. Assign it to an environment variable in your shell named `APP_CHECK_DEBUG_TOKEN`. | ||
|
||
#### Deploy `callTest` Cloud Function | ||
|
||
From the top level of the firebase repo, ensure you have the Firebase CLI (`firebase-tools`) installed (if not, `npm install -g firebase-tools`). | ||
|
||
Ensure you are logged in using the CLI (`firebase login`); | ||
|
||
Then deploy the function with: | ||
`firebase deploy --only functions:callTest --project YOUR_PROJECT_ID` | ||
|
||
### Running the Tests | ||
|
||
To run the tests on the default modular API: | ||
|
||
``` | ||
yarn test:modular | ||
``` | ||
|
||
To run the tests on the compat API: | ||
|
||
``` | ||
yarn test:compat | ||
``` | ||
|
||
## Sample Apps | ||
|
||
Two minimal sample apps are provided for quick debugging and development. These apps import and initialize every product in the SDK and call some basic methods. Products can easily be commented out to focus on one or more products you are interested in looking at. | ||
|
||
### Setup | ||
|
||
The setup is the same as for the E2E tests above. Certain tests can be skipped if you are commenting out that product (e.g, no need to deploy the Cloud Function if you are commenting out the `callFunctions()` line in the sample app, and no need to set the App Check debug token env variable if not using App Check). | ||
|
||
### Running Sample Apps | ||
|
||
To run the modular sample app (uses current default version of the API): | ||
|
||
``` | ||
yarn start:modular | ||
``` | ||
|
||
Then open `localhost:8080` in a browser. | ||
|
||
To run the compat sample app (uses current compat version of the API): | ||
|
||
``` | ||
yarn start:compat | ||
``` | ||
|
||
Then open `localhost:8080` in a browser. | ||
See the `template/` directory for an example. |
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# Firebase JS SDK E2E Tests | ||
|
||
This directory contains end-to-end tests for the Firebase JS SDK package as well as minimal quick start sample apps for debugging and development. | ||
|
||
## E2E Tests | ||
|
||
### Setup | ||
|
||
Before running the tests, you will need: | ||
|
||
- a project config | ||
- a test user with an email/password login which has read/write privileges for Storage, Realtime Database, and Firestore | ||
- an App Check debug token | ||
- to deploy the `callTest` Cloud Function | ||
|
||
#### Project Config and Test User | ||
|
||
Create a file named `firebase-config.js` in the top level of this `s` directory. The contents of the file should be: | ||
hsubox76 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```javascript | ||
// A config for a project | ||
export const config = { | ||
apiKey: ************, | ||
authDomain: ************, | ||
databaseURL: ************, | ||
projectId: ************, | ||
storageBucket: ************, | ||
messagingSenderId: ************, | ||
appId: ************, | ||
measurementId: ************ | ||
}; | ||
* | ||
// A user account with read/write privileges in that project | ||
// for storage, database, firestore | ||
export const testAccount = { | ||
email: ************, | ||
password: ************ | ||
} | ||
``` | ||
|
||
#### App Check Debug Token | ||
|
||
Create an App Check debug token in the Firebase Console. Assign it to an environment variable in your shell named `APP_CHECK_DEBUG_TOKEN`. | ||
|
||
#### Deploy `callTest` Cloud Function | ||
|
||
From the top level of the firebase repo, ensure you have the Firebase CLI (`firebase-tools`) installed (if not, `npm install -g firebase-tools`). | ||
|
||
Ensure you are logged in using the CLI (`firebase login`); | ||
|
||
Then deploy the function with: | ||
`firebase deploy --only functions:callTest --project YOUR_PROJECT_ID` | ||
|
||
### Running the Tests | ||
|
||
To run the tests on the default modular API: | ||
|
||
``` | ||
yarn test:modular | ||
``` | ||
|
||
To run the tests on the compat API: | ||
|
||
``` | ||
yarn test:compat | ||
``` | ||
|
||
## Sample Apps | ||
|
||
Two minimal sample apps are provided for quick debugging and development. These apps import and initialize every product in the SDK and call some basic methods. Products can easily be commented out to focus on one or more products you are interested in looking at. | ||
|
||
### Setup | ||
|
||
The setup is the same as for the E2E tests above. Certain tests can be skipped if you are commenting out that product (e.g, no need to deploy the Cloud Function if you are commenting out the `callFunctions()` line in the sample app, and no need to set the App Check debug token env variable if not using App Check). | ||
|
||
### Running Sample Apps | ||
|
||
To run the modular sample app (uses current default version of the API): | ||
|
||
``` | ||
yarn start:modular | ||
``` | ||
|
||
Then open `localhost:8080` in a browser. | ||
|
||
To run the compat sample app (uses current compat version of the API): | ||
|
||
``` | ||
yarn start:compat | ||
``` | ||
|
||
Then open `localhost:8080` in a browser. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this meant to be hard coded?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.