-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: adopt firebase function user-flows, add gh action to test fb fu…
…nction
- Loading branch information
Showing
6 changed files
with
85 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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,35 @@ | ||
# This file was auto-generated by the Firebase CLI | ||
# https://github.com/firebase/firebase-tools | ||
|
||
# Deploy to Firebase Preview Channel Hosting on PR and test preview branch | ||
name: E2E Firebase Function on PR | ||
'on': pull_request | ||
jobs: | ||
deploy_firebase_preview: | ||
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
cache: npm | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Production build for static file hosting (client + prerender + function) | ||
run: npm run nx firebase-function:build:production | ||
|
||
- name: Test firebase preview channel hosting | ||
uses: push-based/[email protected] | ||
with: | ||
verbose: on | ||
url: http://127.0.0.1:4402/angular-movies-a12d3/us-central1/ssr | ||
rcPath: projects/firebase-function/.user-flowrc.json | ||
outPath: dist/user-flow/firebase-function | ||
serveCommand: "nx run firebase-function:serve", | ||
awaitServeStdout: "Other reserved ports" |
This file contains 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,10 @@ | ||
{ | ||
"collect": { | ||
"ufPath": "projects/firebase-function/user-flows" | ||
}, | ||
"persist": { | ||
"format": [ | ||
"md" | ||
] | ||
} | ||
} |
This file contains 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 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,27 @@ | ||
import {UserFlowContext, UserFlowInteractionsFn, UserFlowOptions, UserFlowProvider,} from '@push-based/user-flow'; | ||
import {MovieListPageUFO} from '../../movies-user-flows/src'; | ||
|
||
const flowOptions: UserFlowOptions = { | ||
name: 'Basic user flow to ensure basic functionality', | ||
}; | ||
|
||
const interactions: UserFlowInteractionsFn = async ( | ||
ctx: UserFlowContext | ||
): Promise<any> => { | ||
const {flow, collectOptions} = ctx; | ||
const url = `${collectOptions.url}/list/category/popular`; | ||
const movieListPage = new MovieListPageUFO(ctx); | ||
|
||
await flow.navigate(url, { | ||
stepName: '🧭 Initial navigation' | ||
}); | ||
await movieListPage.awaitHeadingContent(); | ||
return Promise.resolve(); | ||
}; | ||
|
||
export const userFlowProvider: UserFlowProvider = { | ||
flowOptions, | ||
interactions, | ||
}; | ||
|
||
module.exports = userFlowProvider; |
This file contains 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 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