Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c70c38e
Add E2E tests for Scalable RTR app
mraible Nov 5, 2025
51d6bc5
Update action version comments to match exact commit hashes
mraible Nov 5, 2025
bc20f75
Update Playwright to 1.56.1 for security fixes
mraible Nov 5, 2025
85e873c
Simplify app install/uninstall logic using AppCatalogPage pattern
mraible Nov 5, 2025
0831fc8
Support both 'Save and install' and 'Install app' button texts
mraible Nov 5, 2025
6d15531
Improve E2E test install wait logic
mraible Nov 6, 2025
c68b09e
Rename and document API integration config method for future framewor…
mraible Nov 6, 2025
cbe3f11
Add install/uninstall status verification to AppCatalogPage
mraible Nov 6, 2025
ac8330a
Trust install toast message, reduce catalog verification wait to 10s
mraible Nov 6, 2025
4a5c40f
Fix E2E navigation to use two-step Custom Apps menu pattern
mraible Nov 6, 2025
2b9da66
Update e2e.yml action versions and remove ServiceNow references from …
mraible Nov 6, 2025
910f4a5
Update all workflow action versions to latest
mraible Nov 6, 2025
41516ef
Simplify configureApiIntegrationIfNeeded to no-op for scalable-rtr
mraible Nov 6, 2025
3e680cc
Remove unnecessary error throw from getPagePath()
mraible Nov 6, 2025
129bc61
Make waiter and getCurrentUrl() public to avoid bracket notation access
mraible Nov 6, 2025
6b0b896
Restore gofalcon to 0.18.0 to match main branch
mraible Nov 6, 2025
c48247b
Fix E2E navigation with App Manager fallback
mraible Nov 7, 2025
32196ad
test(e2e): fix menu button selector using data-testid
mraible Nov 10, 2025
56c695f
chore: add *.log to e2e/.gitignore
mraible Nov 10, 2025
81027fa
Resolve merge conflicts from main branch
mraible Nov 11, 2025
8f379da
Fix toast detection to use more specific patterns
mraible Nov 11, 2025
84930c6
Fix toast detection to match exact app name in messages
mraible Nov 11, 2025
dfeb76c
Fix GitHub action version comments to match actual versions
mraible Nov 11, 2025
cf65595
Fix GitHub action version comments in rebuild.yml
mraible Nov 11, 2025
21d5e6f
Fix typo
mraible Nov 13, 2025
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
167 changes: 167 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
name: Scalable RTR E2E Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

# Serialize E2E tests to prevent deployment and UI collisions
concurrency:
group: e2e-tests-${{ github.repository }}
cancel-in-progress: false # Let running tests finish before starting new ones

permissions:
contents: read

jobs:
e2e:
runs-on: ubuntu-latest
timeout-minutes: 15
if: github.actor != 'dependabot[bot]'
env:
FOUNDRY_API_CLIENT_ID: ${{ secrets.FOUNDRY_API_CLIENT_ID }}
FOUNDRY_API_CLIENT_SECRET: ${{ secrets.FOUNDRY_API_CLIENT_SECRET }}
FOUNDRY_CID: ${{ secrets.FOUNDRY_CID }}
FOUNDRY_CLOUD_REGION: ${{ secrets.FOUNDRY_CLOUD_REGION }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.13.2
with:
egress-policy: audit

- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@1ccc07ccd8b9519f44d3e5eaa1b41dd90310adf0 # 2024-10-25

- name: Install required tools
run: |
brew tap crowdstrike/foundry-cli
brew install crowdstrike/foundry-cli/foundry yq

- name: Create directory for Foundry CLI
run: mkdir -p ~/.config/foundry

- name: Prepare app manifest
run: |
# Remove IDs from manifest
yq -i 'del(.. | select(has("id")).id) | del(.. | select(has("app_id")).app_id)' manifest.yml

# Generate unique app name with length safety
REPO_NAME="${{ github.event.repository.name }}"
ACTOR="${{ github.actor }}"
SHORT_ACTOR="${ACTOR/dependabot\[bot\]/deps}"
UNIQUE_NAME="${REPO_NAME}-${SHORT_ACTOR}-$(date +"%m%d%H%M")"

# Truncate if too long by removing foundry- prefix
if [ ${#UNIQUE_NAME} -gt 50 ]; then
REPO_BASE="${REPO_NAME#foundry-}"
UNIQUE_NAME="${REPO_BASE}-${SHORT_ACTOR}-$(date +"%m%d%H%M")"
fi

# Export for yq and set the manifest name
export UNIQUE_NAME
yq -i '.name = env(UNIQUE_NAME)' manifest.yml

# Set app name as environment variable
APP_NAME=$(yq '.name' manifest.yml)
echo "APP_NAME=$APP_NAME" >> $GITHUB_ENV

echo "Prepared manifest with app name: $APP_NAME"

- name: Deploy app to Falcon
run: |
foundry apps deploy --change-type=major --change-log="e2e deploy"
echo "App deployment initiated"

- name: Wait for deployment and release app
run: |
echo "Waiting for deployment to complete..."
timeout=300 # 5 minute timeout
elapsed=0

while [ $elapsed -lt $timeout ]; do
if foundry apps list-deployments | grep -i "successful"; then
echo "Deployment successful, releasing app..."
foundry apps release --change-type=major --notes="e2e release"
echo "App released successfully"

# Brief wait for release to complete - E2E tests handle app discovery with retries
echo "Allowing brief time for release to complete..."
sleep 15

# Verify deployment status and get app details
echo "Verifying final deployment status..."
foundry apps list-deployments

echo "Final deployed app name: $APP_NAME"

exit 0
fi

if foundry apps list-deployments | grep -i "failed"; then
echo "Deployment failed"
exit 1
fi

sleep 5
elapsed=$((elapsed + 5))
done

echo "Deployment timeout after ${timeout} seconds"
exit 1

# Parallelize Node setup while deployment happens
- name: Install Node LTS
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 22
cache: 'npm'
cache-dependency-path: e2e/package-lock.json

- name: Install dependencies
run: npm ci
working-directory: e2e

- name: Install Playwright browsers
run: npx playwright install chromium --with-deps
working-directory: e2e

- name: Make envfile
uses: SpicyPizza/create-envfile@6da099c0b655bd3abd8273c4e2fe7c59e63fa88a # v2.0.3
with:
envkey_FALCON_USERNAME: ${{ secrets.FALCON_USERNAME }}
envkey_FALCON_PASSWORD: ${{ secrets.FALCON_PASSWORD }}
envkey_FALCON_AUTH_SECRET: ${{ secrets.FALCON_AUTH_SECRET }}
envkey_APP_NAME: $APP_NAME
directory: e2e

- name: Run Playwright tests
run: npx dotenvx run --quiet -- npx playwright test
working-directory: e2e
env:
CI: true

- name: Upload Playwright report
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
if: ${{ !cancelled() }}
with:
name: playwright-report-${{ env.APP_NAME }}
path: e2e/playwright-report/
retention-days: 7

- name: Upload test results and screenshots
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
if: ${{ !cancelled() }}
with:
name: playwright-test-results-${{ env.APP_NAME }}
path: e2e/test-results/
retention-days: 7

- name: Delete app from Falcon
if: always()
run: |
echo "Deleting app: $APP_NAME"
foundry apps delete -f || echo "App deletion failed, may already be deleted"
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
with:
egress-policy: audit

- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v5.0.0
- name: Setup Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v6.0.0
with:
go-version: '1.23.x'
- name: Install Go dependencies
Expand All @@ -30,23 +30,23 @@ jobs:
go build -C functions/Func_Jobs
go build -C functions/job_history
- name: Use Node 22
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v6.0.0
with:
node-version: 22
cache: 'yarn'
cache-dependency-path: ui/pages/scalable-rtr-react/yarn.lock
- name: Run yarn install
uses: borales/actions-yarn@2a18ac083c150a32c8ae27a3d68fc8f77b2ad4be # v5
uses: borales/actions-yarn@2a18ac083c150a32c8ae27a3d68fc8f77b2ad4be # v5.3.0
with:
cmd: install
dir: ui/pages/scalable-rtr-react
- name: Build React app
uses: borales/actions-yarn@2a18ac083c150a32c8ae27a3d68fc8f77b2ad4be # v5
uses: borales/actions-yarn@2a18ac083c150a32c8ae27a3d68fc8f77b2ad4be # v5.3.0
with:
cmd: build
dir: ui/pages/scalable-rtr-react
- name: Test the React app
uses: borales/actions-yarn@2a18ac083c150a32c8ae27a3d68fc8f77b2ad4be # v5
uses: borales/actions-yarn@2a18ac083c150a32c8ae27a3d68fc8f77b2ad4be # v5.3.0
with:
cmd: test
dir: ui/pages/scalable-rtr-react
12 changes: 5 additions & 7 deletions .github/workflows/rebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,24 @@ jobs:
if: github.repository == 'CrowdStrike/foundry-sample-scalable-rtr'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
- name: Harden Runner
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
with:
egress-policy: audit

- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v5.0.0
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v6.0.0
with:
node-version: 22
cache: 'yarn'
cache-dependency-path: ui/pages/scalable-rtr-react/yarn.lock
- name: Run yarn install
uses: borales/actions-yarn@2a18ac083c150a32c8ae27a3d68fc8f77b2ad4be # v5
uses: borales/actions-yarn@2a18ac083c150a32c8ae27a3d68fc8f77b2ad4be # v5.3.0
with:
cmd: install
dir: ui/pages/scalable-rtr-react
- name: Build React app
uses: borales/actions-yarn@2a18ac083c150a32c8ae27a3d68fc8f77b2ad4be # v5
uses: borales/actions-yarn@2a18ac083c150a32c8ae27a3d68fc8f77b2ad4be # v5.3.0
with:
cmd: build
dir: ui/pages/scalable-rtr-react
Expand All @@ -44,7 +42,7 @@ jobs:
git add .
git commit -a -m "Rebuild with latest dependencies" || true
- name: Create Pull Request
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'Rebuild with latest dependencies'
Expand Down
5 changes: 5 additions & 0 deletions e2e/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
APP_NAME=foundry-sample-scalable-rtr
FALCON_BASE_URL=https://falcon.us-2.crowdstrike.com
FALCON_USERNAME=your-falcon-username
FALCON_PASSWORD=your-falcon-password
FALCON_AUTH_SECRET=your-mfa-secret
20 changes: 20 additions & 0 deletions e2e/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Environment variables
.env
.env.local
.env.keys

# Playwright
/test-results/
/playwright-report/
/playwright/.cache/
/playwright/.auth/

# Dependencies
node_modules/

# Test artifacts
*.png
*.jpg
*.mp4
*.webm
*.log
28 changes: 28 additions & 0 deletions e2e/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# E2E Tests

## Setup

```bash
npm ci
npx playwright install chromium
cp .env.sample .env
# Edit .env with your credentials
```

## Run Tests

```bash
npm test # All tests
npm run test:debug # Debug mode
npm run test:ui # Interactive UI
```

## Environment Variables

```env
APP_NAME=foundry-sample-scalable-rtr
FALCON_BASE_URL=https://falcon.us-2.crowdstrike.com
FALCON_USERNAME=your-username
FALCON_PASSWORD=your-password
FALCON_AUTH_SECRET=your-mfa-secret
```
1 change: 1 addition & 0 deletions e2e/constants/AuthFile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const AUTH_FILE = 'playwright/.auth/user.json';
Loading