From 8e75a7d2e4d57f3bb857fb416edaea421ce1a8c3 Mon Sep 17 00:00:00 2001 From: cat_shark <1716967236@qq.com> Date: Sat, 4 Jul 2026 00:07:46 +0800 Subject: [PATCH] =?UTF-8?q?test(e2e)=EF=BC=9Astart-task=20=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E8=A1=A5=E5=85=85=E9=A2=84=E6=9C=9F=E4=B8=8E=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E8=8D=89=E7=A8=BF=E6=8E=A5=E5=8F=A3=20mock?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 学习预期改为强制弹窗后,原有用例需 mock 已存在的预期数据避免阻塞 --- e2e/start-task.spec.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/e2e/start-task.spec.ts b/e2e/start-task.spec.ts index f2ea790..3150d87 100644 --- a/e2e/start-task.spec.ts +++ b/e2e/start-task.spec.ts @@ -58,6 +58,24 @@ test.describe('StartTask - 暂停后继续', () => { body: JSON.stringify(mockApiResponse(200, [])), }), ); + + // mock 学习预期(已存在,避免强制弹窗阻塞流程) + await page.route('**/api/study-sessions/*/expectation', (route) => + route.fulfill({ + status: 200, + contentType: 'application/json', + body: JSON.stringify(mockApiResponse(200, { sessionNum: 'SESSION_001', description: '测试预期' })), + }), + ); + + // mock 报告草稿 + await page.route('**/api/study-sessions/*/report-draft', (route) => + route.fulfill({ + status: 200, + contentType: 'application/json', + body: JSON.stringify(mockApiResponse(200, '')), + }), + ); }); test('暂停后点击开始,应触发 continue API', async ({ page }) => {