Преглед изворни кода

sync: 更新测试说明与同步元数据

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
liaoxg пре 6 месеци
родитељ
комит
2ec6e29bc0
3 измењених фајлова са 14 додато и 3 уклоњено
  1. 2 2
      系统测试/.test-sync.json
  2. 1 1
      系统测试/README.md
  3. 11 0
      系统测试/run-tests.js

+ 2 - 2
系统测试/.test-sync.json

@@ -9,7 +9,7 @@
   },
   "changes": {
     "added": [
-      {"id": "TASK-005", "description": "设置任务分类(学习类/生活类/运动类/其他)", "priority": "P0", "module": "任务发布"},
+      {"id": "TASK-005", "description": "设置任务分类(学习类/生活类/运动类/游戏类/其他)", "priority": "P0", "module": "任务发布"},
       {"id": "REWARD-001A", "description": "家长填写所需积分后心愿进入奖励库", "priority": "P0", "module": "奖励体系"},
       {"id": "REWARD-002A", "description": "家庭奖励库(多个家长都可调整)", "priority": "P0", "module": "奖励体系"},
       {"id": "REWARD-002B", "description": "多孩子心愿单隔离", "priority": "P0", "module": "奖励体系"},
@@ -26,7 +26,7 @@
     "removed": []
   },
   "requirements": [
-    {"id": "TASK-005", "description": "设置任务分类(学习类/生活类/运动类/其他)", "priority": "P0"},
+    {"id": "TASK-005", "description": "设置任务分类(学习类/生活类/运动类/游戏类/其他)", "priority": "P0"},
     {"id": "POINT-002", "description": "超额完成获得额外积分(提前或超质完成,家长制定规则)", "priority": "P0"},
     {"id": "POINT-009", "description": "积分不清零,可设置积分有效期(按任务设置)", "priority": "P0"},
     {"id": "REWARD-001A", "description": "家长填写所需积分后心愿进入奖励库", "priority": "P0"},

+ 1 - 1
系统测试/README.md

@@ -75,7 +75,7 @@ open test-reports/test-report-*.html
 | TASK-001 | 家长可创建任务,设置任务名称 | ✅ |
 | TASK-002 | 设置任务积分值(1-10分,默认2分) | ✅ |
 | TASK-003 | 设置任务截止时间(精确到分钟) | ✅ |
-| TASK-005 | 设置任务分类(学习类/生活类/运动类/其他) | ✅ |
+| TASK-005 | 设置任务分类(学习类/生活类/运动类/游戏类/其他) | ✅ |
 | TASK-008 | 孩子可查看今日任务列表 | ✅ |
 | TASK-009 | 孩子点击"完成"按钮提交任务 | ✅ |
 | TASK-012A | 打卡支持照片上传 | ✅ |

+ 11 - 0
系统测试/run-tests.js

@@ -74,6 +74,15 @@ class RequirementsParser {
     return this.requirements;
   }
 
+  markCoverageFromTestCases(testCasesContent) {
+    this.requirements.forEach(req => {
+      req.hasTestCase = testCasesContent.includes(`super('${req.id}'`) || testCasesContent.includes(`super("${req.id}"`);
+      req.testCaseFile = req.hasTestCase ? CONFIG.testCasesPath : null;
+    });
+
+    return this.requirements;
+  }
+
   /**
    * 获取指定优先级的需求
    */
@@ -556,6 +565,8 @@ class TestRunner {
   async init() {
     console.log('正在解析需求文档...');
     const requirements = this.parser.parse();
+    const testCasesContent = fs.readFileSync(CONFIG.testCasesPath, 'utf-8');
+    this.parser.markCoverageFromTestCases(testCasesContent);
     console.log(`已解析 ${requirements.length} 个需求项`);
     
     // 检测需求变更