#!/usr/bin/env bash # Test runner script for shadcn/ui Rust project # Ensures tests auto-close and provides better output set -e echo "๐Ÿงช Running Playwright tests with auto-close..." # Function to cleanup on exit cleanup() { echo "๐Ÿงน Cleaning up test environment..." # Kill any remaining Playwright processes pkill -f "playwright" || true pkill -f "chromium" || true pkill -f "firefox" || true echo "โœ… Cleanup complete" } # Set trap to cleanup on exit trap cleanup EXIT # Run tests with auto-close echo "๐Ÿš€ Starting tests..." pnpm exec playwright test --reporter=line "$@" # Tests completed, cleanup will happen automatically echo "โœ… All tests completed successfully!"