Skip to content
Open
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
138 changes: 138 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# ==============================================================================
# Agenix Playwright Grid - Local Development Environment Configuration
# ==============================================================================
# This file is used by the startup script (scripts/run-local-dev.sh) to run
# Hub, Dashboard, and 3 Workers locally while infrastructure runs in Docker.
#
# Prerequisites:
# docker compose up redis postgres prometheus grafana -d
#
# Start all services:
# bash scripts/run-local-dev.sh (macOS/Linux)
# .\scripts\run-local-dev.ps1 (Windows)
# ==============================================================================

# ==============================================================================
# INFRASTRUCTURE (Docker Compose services)
# ==============================================================================
PLAYWRIGHT_VERSION=1.54.2
POSTGRES_PASSWORD=postgres
POSTGRES_USER=postgres
POSTGRES_DB=playwrightgrid

# ==============================================================================
# HUB CONFIGURATION (runs on localhost:5100)
# ==============================================================================
# NOTE: Changed from port 5000 to 5100 to avoid conflict with macOS AirPlay Receiver.
# macOS Monterey+ uses port 5000 for AirPlay Receiver by default.
# The startup scripts will set ASPNETCORE_URLS=http://localhost:5100 for the Hub.
# ==============================================================================
REDIS_URL=localhost:6379
HUB_NODE_SECRET=node-secret
HUB_RESULTS_BACKEND=postgres
HUB_RESULTS_POSTGRES=Host=localhost;Port=5432;Username=postgres;Password=postgres;Database=playwrightgrid
HUB_BOOTSTRAP_ENABLED=1
HUB_BOOTSTRAP_ADMIN_USER=admin
HUB_BOOTSTRAP_ADMIN_PASSWORD=agenix-admin
HUB_BOOTSTRAP_DEFAULT_PROJECT=admin_default
HUB_BOOTSTRAP_ADMIN_EMAIL=agenix.admin@domain.com

# Telemetry (optional, for Prometheus/Grafana integration)
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
OTEL_SERVICE_NAME=hub

# ==============================================================================
# DASHBOARD CONFIGURATION (runs on localhost:3001)
# ==============================================================================
# The startup scripts will set ASPNETCORE_URLS=http://localhost:3001 for the Dashboard.
HUB_SIGNALR=http://localhost:5100/ws

# ==============================================================================
# WORKER SHARED CONFIGURATION
# ==============================================================================
HUB_URL=http://localhost:5100
NODE_SECRET=node-secret
NODE_NODE_SECRET=node-node-secret
PUBLIC_WS_SCHEME=ws
PUBLIC_WS_HOST=127.0.0.1

# Chromium arguments (applies to all Chromium workers)
CHROMIUM_ARGS=--disable-dev-shm-usage --no-sandbox --disable-setuid-sandbox --no-proxy-server --disable-ipv6 --disable-quic --disable-http2 --disable-features=UseDNSHttpsSvcb

# ==============================================================================
# WORKER 1 (Chromium, WebSocket port 5200, HTTP port 5210)
# ==============================================================================
# Note: These are overridden by the startup script for each worker instance
WORKER1_NODE_ID=worker1
WORKER1_PUBLIC_WS_PORT=5200
WORKER1_HTTP_PORT=5210
WORKER1_POOL_CONFIG=AppB:Chromium:UAT=3

# ==============================================================================
# WORKER 2 (Chromium, WebSocket port 5201, HTTP port 5211)
# ==============================================================================
WORKER2_NODE_ID=worker2
WORKER2_PUBLIC_WS_PORT=5201
WORKER2_HTTP_PORT=5211
WORKER2_POOL_CONFIG=AppB:Chromium:UAT=3

# ==============================================================================
# WORKER 3 (Firefox + WebKit, WebSocket port 5202, HTTP port 5212)
# ==============================================================================
WORKER3_NODE_ID=worker3
WORKER3_PUBLIC_WS_PORT=5202
WORKER3_HTTP_PORT=5212
WORKER3_POOL_CONFIG=AppB:Firefox:UAT=2,AppB:Webkit:UAT=2
WORKER3_FIREFOX_ARGS=--headless
WORKER3_FIREFOX_PREFS={"network.dns.disablePrefetch":true,"browser.cache.disk.enable":false}

# ==============================================================================
# LOGGING (applies to all services)
# ==============================================================================
LOG_LEVEL=Information
LOG_LEVEL_OVERRIDES=Microsoft.AspNetCore=Warning,System.Net.Http.HttpClient=Warning

# ==============================================================================
# OPTIONAL: Metrics and Tracing
# ==============================================================================
# Uncomment to enable OpenTelemetry metrics and tracing for workers
# OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
# OTEL_SERVICE_NAME=worker1 (set per worker in startup script)

# ==============================================================================
# EMAIL/SMTP CONFIGURATION (for password reset emails)
# ==============================================================================
# For local development with Mailpit (no real SMTP needed):
# docker compose up mailpit -d
# View emails at http://localhost:8025
SMTP_HOST=localhost
SMTP_PORT=1025
SMTP_USERNAME=test@localhost
SMTP_PASSWORD=test
SMTP_FROM_EMAIL=noreply@playwrightgrid.local
SMTP_FROM_NAME=Agenix Playwright Grid
SMTP_USE_SSL=false
DASHBOARD_URL=http://localhost:3001

# For production with Gmail (requires App Password):
# 1. Enable 2FA on your Google account
# 2. Generate App Password: https://myaccount.google.com/apppasswords
# 3. Use the 16-character password below
# SMTP_HOST=smtp.gmail.com
# SMTP_PORT=587
# SMTP_USERNAME=your-email@gmail.com
# SMTP_PASSWORD=your-app-specific-password
# SMTP_FROM_EMAIL=your-email@gmail.com
# SMTP_FROM_NAME=Agenix Playwright Grid
# SMTP_USE_SSL=true
# DASHBOARD_URL=https://your-domain.com

# For production with SendGrid:
# SMTP_HOST=smtp.sendgrid.net
# SMTP_PORT=587
# SMTP_USERNAME=apikey
# SMTP_PASSWORD=your-sendgrid-api-key
# SMTP_FROM_EMAIL=noreply@your-domain.com
# SMTP_FROM_NAME=Agenix Playwright Grid
# SMTP_USE_SSL=true
# DASHBOARD_URL=https://your-domain.com
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
*.nuget.targets.api-key-local-dev
44 changes: 44 additions & 0 deletions Agenix.PlaywrightGrid.Client/PlaywrightGrid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"$schema": "./PlaywrightGrid.schema.json",
"enabled": true,
"server": {
"url": "https://grid.agenix.com",
"project": "default_project",
"apiKey": "aa19555c-c9ce-42eb-bb11-87757225d535"
},
"launch": {
"name": "Demo Launch",
"description": "This is a demonstration launch showing the configuration capabilities",
"attributes": [
"t1",
"t2",
"platform:x64",
"env:development"
]
},
"suite": {
"name": "Default Suite",
"description": "Default suite configuration",
"attributes": [
"smoke",
"regression"
]
},
"testRun": {
"defaultLabelKey": "MyApp:Chromium:UAT:US-East",
"attributes": [
"automated",
"priority:high"
]
},
"timeout": {
"seconds": 30
},
"retry": {
"count": 3,
"delaySeconds": 2
},
"concurrency": {
"maxConcurrentRequests": 10
}
}
193 changes: 193 additions & 0 deletions Agenix.PlaywrightGrid.Client/PlaywrightGrid.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://raw.githubusercontent.com/agenixframework/agenix-playwright-grid/main/PlaywrightGrid.schema.json",
"title": "Agenix PlaywrightGrid Configuration",
"description": "Configuration file for Agenix PlaywrightGrid client library",
"type": "object",
"properties": {
"$schema": {
"type": "string",
"description": "Path to this JSON schema file"
},
"enabled": {
"type": "boolean",
"description": "Enable or disable PlaywrightGrid client functionality",
"default": true
},
"server": {
"type": "object",
"description": "Hub server connection settings",
"properties": {
"url": {
"type": "string",
"description": "Base URL of the PlaywrightGrid Hub server",
"format": "uri",
"examples": [
"https://grid.example.com",
"http://localhost:5001"
]
},
"project": {
"type": "string",
"description": "Project key for organizing test results",
"examples": [
"default_project",
"my-app-tests"
]
},
"apiKey": {
"type": "string",
"description": "API key for authentication with the Hub",
"format": "uuid",
"examples": [
"aa19555c-c9ce-42eb-bb11-87757225d535"
]
}
},
"required": [
"url",
"project"
]
},
"launch": {
"type": "object",
"description": "Default launch configuration (test session level)",
"properties": {
"name": {
"type": "string",
"description": "Default name for launches",
"examples": [
"Regression Suite",
"Nightly Tests"
]
},
"description": {
"type": "string",
"description": "Default description for launches",
"examples": [
"Daily regression test suite",
"End-to-end functional tests"
]
},
"attributes": {
"type": "array",
"description": "Default attributes/tags for launches",
"items": {
"type": "string"
},
"examples": [
[
"env:production",
"region:us-east",
"platform:x64"
]
]
}
}
},
"suite": {
"type": "object",
"description": "Default suite configuration (test feature/class level)",
"properties": {
"name": {
"type": "string",
"description": "Default name for suites",
"examples": [
"Login Tests",
"Shopping Cart Feature"
]
},
"description": {
"type": "string",
"description": "Default description for suites"
},
"attributes": {
"type": "array",
"description": "Default attributes/tags for suites",
"items": {
"type": "string"
}
}
}
},
"testRun": {
"type": "object",
"description": "Default test run configuration (individual test level)",
"properties": {
"defaultLabelKey": {
"type": "string",
"description": "Default label key for browser selection. Format: App:Browser:Environment:Region:OS",
"pattern": "^[^:]+:[^:]+:[^:]+.*$",
"examples": [
"MyApp:Chromium:UAT:US-East",
"AppB:Firefox:Production:EU-West:Linux",
"WebApp:WebKit:Staging:US-West"
]
},
"attributes": {
"type": "array",
"description": "Default attributes/tags for test runs",
"items": {
"type": "string"
},
"examples": [
[
"smoke",
"regression",
"priority:high"
]
]
}
}
},
"timeout": {
"type": "object",
"description": "HTTP client timeout settings",
"properties": {
"seconds": {
"type": "integer",
"description": "HTTP request timeout in seconds",
"default": 30,
"minimum": 1,
"maximum": 300
}
}
},
"retry": {
"type": "object",
"description": "HTTP client retry settings",
"properties": {
"count": {
"type": "integer",
"description": "Number of retry attempts for failed requests",
"default": 3,
"minimum": 0,
"maximum": 10
},
"delaySeconds": {
"type": "integer",
"description": "Base delay between retries in seconds (uses exponential backoff)",
"default": 2,
"minimum": 1,
"maximum": 30
}
}
},
"concurrency": {
"type": "object",
"description": "Concurrency settings",
"properties": {
"maxConcurrentRequests": {
"type": "integer",
"description": "Maximum number of concurrent HTTP requests",
"default": 10,
"minimum": 1,
"maximum": 100
}
}
}
},
"required": [
"server"
]
}
Loading
Loading