cd /app/cfc/cfc-backend
mvn spring-boot:run
# 后端服务运行在 http://localhost:9082
cd /app/cfc/cfc-frontend
npm run dev:h5
# 前端 H5 服务运行在 http://localhost:8080
cd /app/cfc/tests
npm install
npx playwright install
cd /app/cfc/tests
npm run test:e2e
# 运行测评订单流程
npx playwright test tests/e2e/assessment-order-flow.spec.js
# 运行家庭成员管理流程
npx playwright test tests/e2e/family-member-management.spec.js
# 运行心愿兑换流程
npx playwright test tests/e2e/wish-exchange-flow.spec.js
npm run test:e2e:headed
npm run test:report
# 报告保存在 playwright-report/ 目录
| 文件 | 描述 | 场景数 |
|---|---|---|
assessment-order-flow.spec.js |
测评订单全流程 | 7 |
family-member-management.spec.js |
家庭成员管理 | 9 |
wish-exchange-flow.spec.js |
心愿兑换审批 | 9 |
planner-bind-invite.spec.js |
规划师绑定邀请 | 7 |
growth-record-sync.spec.js |
成长记录同步 | 6 |
energy-system.spec.js |
能量系统收支 | 6 |
product-purchase.spec.js |
商品购买支付 | 9 |
daily-checkin-streak.spec.js |
连续签到奖励 | 8 |
/#/pages/assessment/apply)每个测试文件都包含以下里程碑验证:
原因:前端页面结构可能与测试选择器不匹配
解决:
page.waitForSelector() 等待元素出现原因:后端服务未启动或响应慢
解决:
原因:依赖的数据未初始化
解决: