Initial commit: Telegram Management System
Some checks failed
Deploy / deploy (push) Has been cancelled
Some checks failed
Deploy / deploy (push) Has been cancelled
Full-stack web application for Telegram management - Frontend: Vue 3 + Vben Admin - Backend: NestJS - Features: User management, group broadcast, statistics 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
71
frontend/run-tests.sh
Executable file
71
frontend/run-tests.sh
Executable file
@@ -0,0 +1,71 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "🚀 统一注册系统批量账号检测测试"
|
||||
echo "================================"
|
||||
|
||||
# 检查是否在frontend目录
|
||||
if [ ! -f "package.json" ]; then
|
||||
echo "❌ 请在frontend目录下运行此脚本"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 检查并安装Playwright
|
||||
echo "📦 检查Playwright安装状态..."
|
||||
|
||||
if ! npm list @playwright/test > /dev/null 2>&1; then
|
||||
echo "📥 安装Playwright..."
|
||||
npm install --save-dev @playwright/test
|
||||
|
||||
echo "📥 安装浏览器..."
|
||||
npx playwright install
|
||||
else
|
||||
echo "✅ Playwright已安装"
|
||||
fi
|
||||
|
||||
# 检查前端服务是否运行
|
||||
echo "🔍 检查前端服务状态..."
|
||||
|
||||
if ! curl -s http://localhost:8080 > /dev/null; then
|
||||
echo "⚠️ 前端服务未运行,尝试启动..."
|
||||
|
||||
# 后台启动前端服务
|
||||
npm run dev &
|
||||
FRONTEND_PID=$!
|
||||
|
||||
echo "⏳ 等待前端服务启动..."
|
||||
sleep 20
|
||||
|
||||
# 再次检查
|
||||
if ! curl -s http://localhost:8080 > /dev/null; then
|
||||
echo "❌ 前端服务启动失败,请手动启动: npm run dev"
|
||||
kill $FRONTEND_PID 2>/dev/null
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ 前端服务已启动"
|
||||
STARTED_FRONTEND=true
|
||||
else
|
||||
echo "✅ 前端服务已运行"
|
||||
STARTED_FRONTEND=false
|
||||
fi
|
||||
|
||||
# 运行测试
|
||||
echo "🧪 开始运行Playwright测试..."
|
||||
echo ""
|
||||
|
||||
npx playwright test unified-register-test.js --reporter=line
|
||||
|
||||
# 生成测试报告
|
||||
echo ""
|
||||
echo "📊 生成详细测试报告..."
|
||||
npx playwright show-report test-results/html-report
|
||||
|
||||
# 清理
|
||||
if [ "$STARTED_FRONTEND" = true ]; then
|
||||
echo "🧹 清理后台进程..."
|
||||
kill $FRONTEND_PID 2>/dev/null
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "✅ 测试完成!"
|
||||
echo "📄 详细报告已生成在: test-results/html-report/"
|
||||
Reference in New Issue
Block a user