08ea5fbe98
添加用户管理视图、API和状态管理文件
59 lines
1.5 KiB
Bash
Executable File
59 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# TDD测试执行脚本
|
|
# 用于执行所有TDD测试套件
|
|
|
|
set -e
|
|
|
|
echo "🚀 开始执行TDD测试套件..."
|
|
echo ""
|
|
|
|
# 设置环境变量
|
|
export E2E_MOCK_ENABLED=false
|
|
export E2E_BASE_URL=http://localhost:5174
|
|
export VITE_E2E_TEST=true
|
|
|
|
# 检查后端服务
|
|
echo "🔍 检查后端API服务..."
|
|
if curl -s http://127.0.0.1:8080/api/actuator/health > /dev/null; then
|
|
echo "✅ 后端API服务运行正常"
|
|
else
|
|
echo "❌ 后端API服务未启动,请先启动后端服务"
|
|
exit 1
|
|
fi
|
|
|
|
# 检查前端服务
|
|
echo "🔍 检查前端Admin服务..."
|
|
if curl -s http://localhost:5174 > /dev/null; then
|
|
echo "✅ 前端Admin服务运行正常"
|
|
else
|
|
echo "❌ 前端Admin服务未启动,请先启动前端服务"
|
|
exit 1
|
|
fi
|
|
|
|
echo ""
|
|
echo "🧪 开始执行测试..."
|
|
echo ""
|
|
|
|
# 执行认证模块测试
|
|
echo "📋 执行用户认证模块测试..."
|
|
npx playwright test e2e/auth-complete.spec.ts --project=chromium --reporter=list || true
|
|
|
|
echo ""
|
|
echo "📋 执行用户管理模块测试..."
|
|
npx playwright test e2e/user-management-complete.spec.ts --project=chromium --reporter=list || true
|
|
|
|
echo ""
|
|
echo "📋 执行角色管理模块测试..."
|
|
npx playwright test e2e/role-management-complete.spec.ts --project=chromium --reporter=list || true
|
|
|
|
echo ""
|
|
echo "📋 执行菜单管理模块测试..."
|
|
npx playwright test e2e/menu-management-complete.spec.ts --project=chromium --reporter=list || true
|
|
|
|
echo ""
|
|
echo "✅ TDD测试套件执行完成!"
|
|
echo ""
|
|
echo "📊 查看测试报告:"
|
|
echo " npx playwright show-report"
|