Pulse/tests/integration
rcourtman b1a2f2aba3
Some checks failed
Helm CI / Lint and Render Chart (push) Has been cancelled
Build and Test / Secret Scan (push) Waiting to run
Build and Test / Frontend & Backend (push) Waiting to run
Core E2E Tests / Playwright Core E2E (push) Waiting to run
Update Integration Tests / Update Flow Integration Tests (push) Waiting to run
Fix v5 integration update test defaults
2026-04-14 20:25:09 +01:00
..
api fix: use 12+ char password for security setup test 2025-12-18 18:10:36 +00:00
mock-github-server Improve update integration diagnostics 2025-11-12 22:27:05 +00:00
scripts fix: remediate default branch dependency alerts 2026-04-09 10:28:54 +01:00
tests fix: remediate default branch dependency alerts 2026-04-09 10:28:54 +01:00
.gitignore Add integration test package-lock.json to version control 2025-11-12 00:05:45 +00:00
docker-compose.test.yml Fix v5 integration update test defaults 2026-04-14 20:25:09 +01:00
package-lock.json Add integration test package-lock.json to version control 2025-11-12 00:05:45 +00:00
package.json fix(ai): improve AI settings UX with validation and smart fallbacks 2025-12-17 18:30:19 +00:00
playwright.config.ts fix: remediate default branch dependency alerts 2026-04-09 10:28:54 +01:00
QUICK_START.md docs: standardize markdown syntax and remove deprecated sensor-proxy docs 2026-01-20 09:43:49 +00:00
README.md docs: standardize markdown syntax and remove deprecated sensor-proxy docs 2026-01-20 09:43:49 +00:00
tsconfig.json Add comprehensive integration test suite for update flow 2025-11-11 09:31:52 +00:00

Integration Tests (Playwright)

End-to-end Playwright tests that validate critical user flows against a running Pulse instance.

Architecture

┌─────────────────┐     ┌──────────────────┐     ┌─────────────────────┐
│  Playwright     │────▶│  Pulse Server    │────▶│  Mock GitHub API    │
│  (Browser UI)   │     │  (Test Instance) │     │  (Controlled        │
│                 │     │                  │     │   Responses)        │
└─────────────────┘     └──────────────────┘     └─────────────────────┘

Test Scenarios

  • tests/00-diagnostic.spec.ts — smoke test that the stack boots and the UI renders.
  • tests/01-core-e2e.spec.ts — critical UI flows:
    • Bootstrap setup wizard (fresh instance)
    • Login + authenticated state
    • Alerts thresholds create/delete
    • Settings persistence across refresh
    • Add/delete a Proxmox node (test-only)

Running Tests

Local Development (Docker compose stack)

cd tests/integration
./scripts/setup.sh   # one-time (installs deps + builds docker images)
npm test

The docker-compose stack seeds a deterministic bootstrap token for first-run setup:

  • Override via PULSE_E2E_BOOTSTRAP_TOKEN
  • Default token value is defined in tests/integration/docker-compose.test.yml

Credentials used by the E2E suite can be overridden:

  • PULSE_E2E_USERNAME (default admin)
  • PULSE_E2E_PASSWORD (default adminadminadmin)
  • PULSE_E2E_ALLOW_NODE_MUTATION=1 to enable the optional "Add Proxmox node" test (disabled by default for safety)

Run Against An Existing Pulse Instance

cd tests/integration
PULSE_E2E_SKIP_DOCKER=1 \
PULSE_BASE_URL='http://your-pulse-host:7655' \
PULSE_E2E_USERNAME='admin' \
PULSE_E2E_PASSWORD='adminadminadmin' \
npm test

If the instance is behind self-signed TLS:

PULSE_E2E_INSECURE_TLS=1 PULSE_E2E_SKIP_DOCKER=1 PULSE_BASE_URL='https://...' npm test

CI Pipeline

  • Core E2E flows run via .github/workflows/test-e2e.yml
  • Update flow coverage remains in .github/workflows/test-updates.yml

Test Data (Update Flow Only)

The mock GitHub server (mock-github-server/) provides controllable responses:

  • /api/releases - List all releases
  • /api/releases/latest - Latest stable release
  • /download/{version}/pulse-{version}-linux-amd64.tar.gz - Release tarballs
  • /download/{version}/checksums.txt - Checksum files

Response behavior can be controlled via environment variables:

  • MOCK_CHECKSUM_ERROR=true - Return invalid checksums
  • MOCK_NETWORK_ERROR=true - Simulate network failures
  • MOCK_RATE_LIMIT=true - Enable aggressive rate limiting
  • MOCK_STALE_RELEASE=true - Mark releases as stale

Success Criteria

  • Core E2E flows pass reliably in CI
  • Update flow remains covered via API integration test + smoke UI check