#!/bin/bash # Simple Test Runner - Clean Output set -e # Colors GREEN='\033[0;32m' RED='\033[0;31m' YELLOW='\033[1;33m' NC='\033[0m' echo -e "${YELLOW}๐Ÿงช Running Trip Planner E2E Tests${NC}" # Check if npm packages are installed if [ ! -d "node_modules" ]; then echo -e "${YELLOW}๐Ÿ“ฆ Installing dependencies...${NC}" npm install > /dev/null 2>&1 fi # Check if frontend is accessible if ! curl -s -o /dev/null http://localhost:5173; then echo -e "${RED}โŒ Frontend not accessible at http://localhost:5173${NC}" exit 1 fi echo -e "${GREEN}โœ… Environment ready${NC}" # Default to running all tests TEST_FILE="" # Parse simple arguments case "${1:-}" in --full) TEST_FILE="specs/integration/full-auth-flow.test.js" echo -e "${YELLOW}๐Ÿ”„ Running full authentication flow test...${NC}" ;; --integration) TEST_FILE="specs/integration" echo -e "${YELLOW}๐Ÿ”— Running integration tests...${NC}" ;; --auth) TEST_FILE="specs/auth" echo -e "${YELLOW}๐Ÿ”‘ Running authentication tests...${NC}" ;; --clean) TEST_FILE="specs/auth/auth-clean.test.js" echo -e "${YELLOW}๐Ÿงน Running clean authentication tests...${NC}" ;; *) echo -e "${YELLOW}๐ŸŒŸ Running all tests...${NC}" ;; esac # Create screenshots directory mkdir -p screenshots # Run tests with timing logs visible if [ -n "$TEST_FILE" ]; then HEADLESS=false npm test -- "$TEST_FILE" else HEADLESS=false npm test fi echo -e "${GREEN}โœ… Tests completed!${NC}"