Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"permissions": {
"allow": [
"Bash(git add:*)"
],
"deny": [],
"ask": []
}
}
11 changes: 8 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@
REACT_APP_FIREBASE_API_KEY=your_api_key_here
REACT_APP_FIREBASE_AUTH_DOMAIN=your_project_id.firebaseapp.com
REACT_APP_FIREBASE_PROJECT_ID=your_project_id
REACT_APP_FIREBASE_DATABASE_URL=https://your_project_id-default-rtdb.firebaseio.com/
REACT_APP_FIREBASE_STORAGE_BUCKET=your_project_id.appspot.com
REACT_APP_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
REACT_APP_FIREBASE_APP_ID=your_app_id

# Optional: Add other environment variables as needed for your project
# REACT_APP_API_URL=http://localhost:3001
# REACT_APP_DEBUG=true
# Environment Configuration
# Set to 'true' to use Firebase emulators (for local development)
REACT_APP_USE_EMULATOR=true

# Staging/Production URLs (for E2E testing)
REACT_APP_STAGING_URL=https://your-staging-url.com
REACT_APP_PRODUCTION_URL=https://your-production-url.com
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "reactjs-template-demo"
}
}
104 changes: 104 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: E2E Tests

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

jobs:
test-local:
runs-on: ubuntu-latest
name: E2E Tests (Local Emulator)

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Install dependencies
run: pnpm install

- name: Install Firebase CLI
run: npm install -g firebase-tools

- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps

- name: Start Firebase Emulator
run: |
firebase emulators:start --import=./seed --export-on-exit &
sleep 10
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}

- name: Build React App (Emulator)
run: pnpm run build
env:
REACT_APP_USE_EMULATOR: 'true'

- name: Serve Built App
run: |
npx serve -s build -p 3000 &
sleep 5

- name: Run E2E Tests (Local)
run: pnpm run test:e2e:local
env:
PLAYWRIGHT_BASE_URL: http://localhost:3000

- name: Upload Playwright Report
uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report-local
path: playwright-report/
retention-days: 30

test-staging:
runs-on: ubuntu-latest
name: E2E Tests (Staging)
needs: [test-local]
if: github.ref == 'refs/heads/main'

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Install dependencies
run: pnpm install

- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps

- name: Run E2E Tests (Staging)
run: pnpm run test:e2e:staging
env:
PLAYWRIGHT_BASE_URL: ${{ vars.STAGING_URL || 'https://your-staging-url.com' }}

- name: Upload Playwright Report
uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report-staging
path: playwright-report/
retention-days: 30
Loading
Loading