hako/scripts/e2e.sh
Felipe M. d71915a3fb
test(e2e): expand test suite with comprehensive coverage
- Add e2e tests for admin pages (archivers, extractors, rules)
- Add tests for archives, links, navigation, and error handling
- Add search and pagination test coverage
- Implement test web server with Docker container
- Add seed data and helper utilities for tests
- Update webapp components for permission handling
- Generate HTML reports with embedded screenshots

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-29 12:49:40 +01:00

33 lines
887 B
Shell
Executable file

#!/usr/bin/env bash
set -e
echo "🧪 Running Hako E2E Tests"
# Environment setup
export TESTCONTAINERS_RYUK_DISABLED=false
export DOCKER_HOST="${DOCKER_HOST:-unix:///var/run/docker.sock}"
# Check Docker
if ! docker info > /dev/null 2>&1; then
echo "❌ Error: Docker is not running"
exit 1
fi
# Install Playwright if needed
if ! go run github.com/playwright-community/playwright-go/cmd/playwright@latest --help > /dev/null 2>&1; then
echo "📦 Installing Playwright browsers..."
go run github.com/playwright-community/playwright-go/cmd/playwright@latest install --with-deps chromium
fi
# Build webapp (required for embed)
echo "🏗️ Building webapp..."
make build-webapp
# Create screenshots directory
mkdir -p e2e/screenshots
# Run tests
echo "🚀 Running e2e tests..."
cd e2e && CGO_ENABLED=0 go test -v -timeout=60m ./...
echo "✅ E2E tests completed"