|
|
@@ -706,6 +706,56 @@ class API_017_TestCase extends ApiTestCase {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+* API-018: 创建小游戏类任务(minigameCode字段)
|
|
|
+*/
|
|
|
+class API_018_TestCase extends ApiTestCase {
|
|
|
+ constructor() {
|
|
|
+ super('API-018', '创建小游戏类任务', 'P1', '/api/tasks', 'POST');
|
|
|
+ }
|
|
|
+
|
|
|
+ async run() {
|
|
|
+ try {
|
|
|
+ this.requestData = {
|
|
|
+ childId: 2,
|
|
|
+ title: '完成舒尔特方格训练',
|
|
|
+ category: '小游戏类',
|
|
|
+ minigameCode: 'schulte',
|
|
|
+ points: 5,
|
|
|
+ deadline: '2026-04-20T18:00:00',
|
|
|
+ needReview: 0
|
|
|
+ };
|
|
|
+ const response = await this.sendRequest(this.requestData);
|
|
|
+ this.logResult(response.status === 200);
|
|
|
+ } catch (error) {
|
|
|
+ this.logResult(false, error);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+* API-019: 完成小游戏任务(调用MiniGameService)
|
|
|
+*/
|
|
|
+class API_019_TestCase extends ApiTestCase {
|
|
|
+ constructor() {
|
|
|
+ super('API-019', '完成小游戏任务获积分', 'P1', '/api/tasks/1/complete', 'POST');
|
|
|
+ }
|
|
|
+
|
|
|
+ async run() {
|
|
|
+ try {
|
|
|
+ this.requestData = {
|
|
|
+ childId: 2,
|
|
|
+ completionTime: 45,
|
|
|
+ score: 80
|
|
|
+ };
|
|
|
+ const response = await this.sendRequest(this.requestData);
|
|
|
+ this.logResult(response.status === 200);
|
|
|
+ } catch (error) {
|
|
|
+ this.logResult(false, error);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
// ============================================================================
|
|
|
// Web管理端 浏览器测试用例
|
|
|
// ============================================================================
|
|
|
@@ -1223,7 +1273,10 @@ module.exports = {
|
|
|
API_014_TestCase, // 指导师审核任务
|
|
|
API_015_TestCase, // 小游戏-舒尔特方格
|
|
|
API_016_TestCase, // 小游戏-猜数字
|
|
|
- API_017_TestCase // 任务模板创建
|
|
|
+ API_017_TestCase, // 任务模板创建
|
|
|
+ // 小游戏任务类型(新增)
|
|
|
+ API_018_TestCase, // 创建小游戏类任务
|
|
|
+ API_019_TestCase // 完成小游戏任务获积分
|
|
|
},
|
|
|
|
|
|
// Web浏览器测试用例(管理后台)
|