mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-01-11 19:56:44 +00:00
|
Some checks are pending
Push Release Images to Docker Hub and GitHub Container Registry / app-docker-image-deploy (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / accounts-docker-image-deploy (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / ai-agent-docker-image-deploy (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / publish-npm-packages (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / generate-build-number (push) Waiting to run
Push Release Images to Docker Hub and GitHub Container Registry / read-version (push) Waiting to run
Push Release Images to Docker Hub and GitHub Container Registry / helm-chart-deploy (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / mcp-docker-image-deploy (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / nginx-docker-image-deploy (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / e2e-docker-image-deploy (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / isolated-vm-docker-image-deploy (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / home-docker-image-deploy (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / test-server-docker-image-deploy (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / otel-collector-docker-image-deploy (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / status-page-docker-image-deploy (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / test-docker-image-deploy (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / probe-ingest-docker-image-deploy (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / server-monitor-ingest-docker-image-deploy (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / telemetry-docker-image-deploy (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / incoming-request-ingest-docker-image-deploy (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / probe-docker-image-deploy (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / admin-dashboard-docker-image-deploy (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / dashboard-docker-image-deploy (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / docs-docker-image-deploy (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / worker-docker-image-deploy (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / workflow-docker-image-deploy (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / publish-terraform-provider (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / api-reference-docker-image-deploy (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / Push release tags before GitHub release (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / infrastructure-agent-deploy (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / test-e2e-release-saas (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / test-e2e-release-self-hosted (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / Create draft GitHub release (push) Blocked by required conditions
Push Release Images to Docker Hub and GitHub Container Registry / Publish GitHub release (push) Blocked by required conditions
|
||
|---|---|---|
| .. | ||
| Tests | ||
| .gitignore | ||
| Config.ts | ||
| Dockerfile.tpl | ||
| package-lock.json | ||
| package.json | ||
| playwright.config.ts | ||
| README.md | ||
| tsconfig.json | ||
E2E Tests
End-to-end tests for OneUptime using Playwright.
Prerequisites
- Node.js (v18 or higher recommended)
- npm
Installation
cd E2E
npm install
This will automatically install Playwright browsers and dependencies via the preinstall script.
Configuration
The tests use environment variables for configuration. Set the following variables before running tests in config.env:
| Variable | Description | Default |
|---|---|---|
HOST |
The hostname to test against | localhost |
HTTP_PROTOCOL |
Protocol to use (http or https) |
http |
BILLING_ENABLED |
Enable billing-related tests | false |
E2E_TEST_IS_USER_REGISTERED |
Whether a test user is already registered | false |
E2E_TEST_REGISTERED_USER_EMAIL |
Email of the registered test user | - |
E2E_TEST_REGISTERED_USER_PASSWORD |
Password of the registered test user | - |
E2E_TEST_STATUS_PAGE_URL |
URL of a status page to test | - |
E2E_TESTS_FAILED_WEBHOOK_URL |
Webhook URL to call on test failure | - |
Example
export HOST=staging.oneuptime.com
export HTTP_PROTOCOL=https
export BILLING_ENABLED=true
Running Tests
Run all tests
npm test
Run tests in debug mode
npm run debug-tests
Run specific test file
npx playwright test Tests/Home/Landing.spec.ts
Run tests for a specific browser
# Chromium only
npx playwright test --project=chromium
# Firefox only
npx playwright test --project=firefox
Run tests with UI mode
npx playwright test --ui
Run a specific test by name
npx playwright test -g "oneUptime link navigate to homepage"
Test Structure
E2E/
├── Tests/
│ ├── Accounts/ # Account-related tests (login, registration)
│ ├── App/ # Main application tests
│ ├── Home/ # Homepage tests
│ ├── IncomingRequestIngest/
│ ├── ProbeIngest/
│ ├── StatusPage/ # Status page tests
│ └── TelemetryIngest/
├── Config.ts # Environment configuration
├── playwright.config.ts # Playwright configuration
└── package.json
Viewing Test Reports
After running tests, an HTML report is generated. Open it with:
npx playwright show-report
Test Configuration
The Playwright configuration (playwright.config.ts) includes:
- Timeout: 240 seconds per test
- Retries: 3 retries on failure
- Browsers: Chromium and Firefox
- Tracing: Enabled for debugging failed tests
Debugging
View traces
When tests fail, traces are collected. View them with:
npx playwright show-trace test-results/<test-name>/trace.zip
Run in headed mode
npx playwright test --headed
Slow down execution
npx playwright test --headed --slow-mo=1000
CI/CD
For CI environments, the CI environment variable is automatically detected:
test.onlyusage will fail the build- Parallel test execution is disabled (workers: 1)
Troubleshooting
Playwright browsers not installed
npx playwright install
npx playwright install-deps
Clear and reinstall dependencies
npm run clear-modules