/** * ExamPage - 检查页面Page Object Model * 用于检查界面的元素选择器和操作方法 */ class ExamPage { /** * 获取检查页面主容器 */ getExamPage() { return cy.get('[data-testid="exam-page"]'); } /** * 获取工具栏(设备区域) */ getToolbar() { return cy.get('[data-testid="exam-toolbar"]'); } /** * 获取内容区域 */ getContentArea() { return cy.get('[data-testid="exam-content-area"]'); } /** * 获取患者信息区域 * TODO: 需要在ContentAreaLarge中添加此data-testid */ getPatientInfo() { return cy.get('[data-testid="exam-patient-info"]'); } /** * 获取患者姓名 * TODO: 需要在患者信息组件中添加此data-testid */ getPatientName() { return cy.get('[data-testid="exam-patient-name"]'); } /** * 获取检查ID * TODO: 需要在患者信息组件中添加此data-testid */ getStudyId() { return cy.get('[data-testid="exam-study-id"]'); } /** * 验证检查界面已加载 */ verifyExamPageLoaded() { // 验证检查页面主容器可见 this.getExamPage().should('be.visible'); // 验证工具栏可见 this.getToolbar().should('be.visible'); // 验证内容区域可见 this.getContentArea().should('be.visible'); } } export default ExamPage;