65 lines
No EOL
1.5 KiB
Bash
Executable file
65 lines
No EOL
1.5 KiB
Bash
Executable file
#!/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}" |