- Set up Playwright in dedicated e2e directory - Multi-environment support (local, staging) - TOTP authentication handling with otplib - Test coverage for organizations, devices, alerts, status indicators - Helper utilities for common test operations - Comprehensive README with setup and usage instructions - Setup script for quick initialization
33 lines
779 B
Bash
Executable file
33 lines
779 B
Bash
Executable file
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
echo "🎭 Setting up Playwright E2E tests..."
|
|
|
|
# Install dependencies
|
|
echo "📦 Installing npm dependencies..."
|
|
npm install
|
|
|
|
# Install Playwright browsers
|
|
echo "🌐 Installing Playwright browsers..."
|
|
npx playwright install
|
|
|
|
# Create .env if it doesn't exist
|
|
if [ ! -f .env ]; then
|
|
echo "📝 Creating .env file from template..."
|
|
cp .env.example .env
|
|
echo ""
|
|
echo "⚠️ IMPORTANT: Edit .env and set your test user credentials!"
|
|
echo " TEST_USER_EMAIL, TEST_USER_PASSWORD, and TEST_USER_TOTP_SECRET"
|
|
echo ""
|
|
fi
|
|
|
|
# Create .auth directory
|
|
mkdir -p tests/.auth
|
|
|
|
echo "✅ Setup complete!"
|
|
echo ""
|
|
echo "Next steps:"
|
|
echo " 1. Edit .env with your test user credentials"
|
|
echo " 2. Create a test user (see README.md)"
|
|
echo " 3. Run: npm test"
|