Initial commit: Complete NodeJS-native setup
- Migrated from Python pre-commit to NodeJS-native solution - Reorganized documentation structure - Set up Husky + lint-staged for efficient pre-commit hooks - Fixed Dockerfile healthcheck issue - Added comprehensive documentation index
This commit is contained in:
55
scripts/setup-e2e.sh
Executable file
55
scripts/setup-e2e.sh
Executable file
@@ -0,0 +1,55 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 🎭 Playwright E2E Test Setup Script
|
||||
|
||||
echo "🎭 Setting up Playwright for E2E testing..."
|
||||
|
||||
# Check if we're in the right directory
|
||||
if [[ ! -f "package.json" ]]; then
|
||||
echo "❌ Error: Must be run from project root directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Install Playwright if not already installed
|
||||
echo "📦 Installing Playwright..."
|
||||
if command -v bun &> /dev/null; then
|
||||
bun add -D @playwright/test
|
||||
else
|
||||
npm install -D @playwright/test
|
||||
fi
|
||||
|
||||
# Install browser binaries
|
||||
echo "🌐 Installing browser binaries..."
|
||||
npx playwright install
|
||||
|
||||
# Install system dependencies (Linux)
|
||||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
echo "🐧 Installing system dependencies for Linux..."
|
||||
npx playwright install-deps
|
||||
fi
|
||||
|
||||
# Create .gitignore entries for Playwright
|
||||
echo "📝 Updating .gitignore for Playwright artifacts..."
|
||||
if ! grep -q "test-results" .gitignore; then
|
||||
echo "" >> .gitignore
|
||||
echo "# Playwright artifacts" >> .gitignore
|
||||
echo "test-results/" >> .gitignore
|
||||
echo "playwright-report/" >> .gitignore
|
||||
echo "playwright/.cache/" >> .gitignore
|
||||
fi
|
||||
|
||||
# Verify installation
|
||||
echo "✅ Verifying Playwright installation..."
|
||||
npx playwright --version
|
||||
|
||||
echo ""
|
||||
echo "🎉 Playwright setup complete!"
|
||||
echo ""
|
||||
echo "📋 Quick start commands:"
|
||||
echo " bun run test:e2e # Run all E2E tests"
|
||||
echo " bun run test:e2e:ui # Run tests in UI mode"
|
||||
echo " bun run test:e2e:debug # Debug tests"
|
||||
echo " bun run test:e2e:report # View test report"
|
||||
echo ""
|
||||
echo "📚 Documentation: tests/e2e/README.md"
|
||||
echo "⚙️ Configuration: playwright.config.ts"
|
||||
Reference in New Issue
Block a user