本测试方案覆盖从Worklist和History列表双击进入检查的功能。根据任务的曝光状态,系统会自动导航到不同的界面:
worklistToExam(task) {
1. 调用 fetchTaskDetails(StudyID) 获取完整检查信息
2. 转换数据格式,包含所有Views(体位)
3. 判断曝光状态:
- 所有体位已曝光 → 进入"处理界面"(businessFlow: 'process')
- 有未曝光体位 → 进入"检查界面"(businessFlow: 'exam')
4. 更新Redux状态:
- clearWorks() - 清空缓存
- addWork(updatedTask) - 保存任务
- setBusinessFlow() - 设置流程
}
src/domain/patient/worklistToExam.ts
- 核心业务逻辑src/pages/patient/worklist.tsx
- Worklist页面(双击触发)src/pages/patient/HistoryList.tsx
- History页面(双击触发)测试文件:cypress/e2e/patient/worklist-enter-exam-unexposed.cy.ts
前置条件:
测试步骤:
验证点:
GET /dr/api/v1/auth/study/{id}
被正确调用examWorksCache
包含正确的任务数据businessFlow
状态为 'exam'测试文件:cypress/e2e/patient/worklist-enter-process-exposed.cy.ts
前置条件:
测试步骤:
验证点:
GET /dr/api/v1/auth/study/{id}
被正确调用examWorksCache
包含正确的任务数据businessFlow
状态为 'process'bodyPositionList
已正确转换测试文件:cypress/e2e/patient/history-enter-exam-unexposed.cy.ts
前置条件:
测试步骤:
验证点:
测试文件:cypress/e2e/patient/history-enter-process-exposed.cy.ts
前置条件:
测试步骤:
验证点:
mockGetStudyDetailsUnexposed(studyId: string)
expose_status: 'Unexposed'
mockGetStudyDetailsExposed(studyId: string)
expose_status: 'Exposed'
mockFetchTwoWorks()
mockFetchTwoHistoryWorks()
需要添加:
findTableAndDoubleClickFirstRow() {
cy.get('table').within(() => {
cy.get('tbody tr[data-testid="row-0"]')
.scrollIntoView()
.should('be.visible')
.dblclick({ force: true });
});
}
已有的验证方法:
verifyExamPageLoaded()
- 验证检查界面加载getToolbar()
- 获取工具栏getContentArea()
- 获取内容区域需要创建新的Page Object来验证处理界面元素
cy.window()
.its('store')
.invoke('getState')
.its('examWorksCache')
.its('works')
.should('have.length', 1)
.its(0)
.should('have.property', 'StudyID');
cy.window()
.its('store')
.invoke('getState')
.its('businessFlow')
.its('currentFlow')
.should('eq', 'exam'); // 或 'process'
cy.window()
.its('store')
.invoke('getState')
.its('bodyPositionList')
.its('positions')
.should('have.length.greaterThan', 0);
worklist-enter-exam-unexposed.cy.ts
worklist-enter-process-exposed.cy.ts
history-enter-exam-unexposed.cy.ts
history-enter-process-exposed.cy.ts
cy.wait()
等待API调用完成后再验证状态所有4个测试场景都应: