Files
rxminder/scripts/setup-e2e.sh
William Valentin 8fa2d3fb60 feat: Switch project tooling from npm to bun and add enhanced pre-commit
checks

- Replace npm commands with bun/bunx in scripts, docs, and CI - Add
enhanced pre-commit checks with parallel execution - Document pre-commit
hook behavior in PRE_COMMIT_HOOKS.md - Update .gitignore/.dockerignore
for bun-debug.log - Refine ESLint config for bun and Prettier
integration - Add scripts/type-check-staged.sh for fast staged type
checks - Improve developer workflow and code quality automation
2025-09-07 12:40:57 -07:00

56 lines
1.6 KiB
Bash
Executable File

#!/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..."
bunx playwright install
# Install system dependencies (Linux)
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo "🐧 Installing system dependencies for Linux..."
bunx 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..."
bunx 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"