feat: infraestructura base para E2E tests con Playwright
Proyecto Node.js independiente en e2e/ con Playwright + Chromium headless. Incluye setup-element.sh para descargar y servir Element Web localmente (puerto 8090 por defecto, 8080 ocupado por Docker). Scripts de instalacion y placeholder para ejecucion de tests. Cierra issue 0022a. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Executable
+42
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env bash
|
||||
# install.sh — instalar dependencias para E2E tests
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
E2E_DIR="$REPO_ROOT/e2e"
|
||||
|
||||
echo "=== Instalacion de E2E tests ==="
|
||||
|
||||
# 1. Verificar Node.js
|
||||
if ! command -v node &>/dev/null; then
|
||||
echo "ERROR: Node.js no encontrado."
|
||||
echo "Instalar Node.js v18+ con:"
|
||||
echo " curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -"
|
||||
echo " sudo apt-get install -y nodejs"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
NODE_VERSION=$(node -v | sed 's/v//' | cut -d. -f1)
|
||||
if [ "$NODE_VERSION" -lt 18 ]; then
|
||||
echo "ERROR: Se requiere Node.js v18+, encontrado v$(node -v)"
|
||||
exit 1
|
||||
fi
|
||||
echo "Node.js $(node -v) OK"
|
||||
|
||||
# 2. Instalar dependencias del proyecto
|
||||
echo "Instalando dependencias npm..."
|
||||
cd "$E2E_DIR"
|
||||
npm ci
|
||||
|
||||
# 3. Instalar Chromium para Playwright
|
||||
echo "Instalando Chromium para Playwright..."
|
||||
npx playwright install chromium
|
||||
|
||||
# 4. Instalar dependencias del sistema para Playwright
|
||||
echo "Instalando dependencias del sistema (requiere sudo)..."
|
||||
sudo npx playwright install-deps chromium
|
||||
|
||||
echo ""
|
||||
echo "=== Instalacion completa ==="
|
||||
echo "Siguiente paso: copiar e2e/.env.example a e2e/.env y configurar credenciales"
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
# run.sh — ejecutar E2E tests con Playwright
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
E2E_DIR="$REPO_ROOT/e2e"
|
||||
|
||||
# Verificar dependencias instaladas
|
||||
if [ ! -d "$E2E_DIR/node_modules" ]; then
|
||||
echo "ERROR: node_modules no encontrado. Ejecutar primero:"
|
||||
echo " ./dev-scripts/e2e/install.sh"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Verificar .env
|
||||
if [ ! -f "$E2E_DIR/.env" ]; then
|
||||
echo "ERROR: e2e/.env no encontrado. Crear desde el template:"
|
||||
echo " cp e2e/.env.example e2e/.env"
|
||||
echo " # editar e2e/.env con credenciales"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Los tests E2E se agregan en el issue 0022c."
|
||||
echo "Cuando esten listos, ejecutar:"
|
||||
echo " cd $E2E_DIR && npx playwright test"
|
||||
Reference in New Issue
Block a user