ExamPage.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /**
  2. * ExamPage - 检查页面Page Object Model
  3. * 用于检查界面的元素选择器和操作方法
  4. */
  5. class ExamPage {
  6. /**
  7. * 获取检查页面主容器
  8. */
  9. getExamPage() {
  10. return cy.get('[data-testid="exam-page"]');
  11. }
  12. /**
  13. * 获取工具栏(设备区域)
  14. */
  15. getToolbar() {
  16. return cy.get('[data-testid="exam-toolbar"]');
  17. }
  18. /**
  19. * 获取内容区域
  20. */
  21. getContentArea() {
  22. return cy.get('[data-testid="exam-content-area"]');
  23. }
  24. /**
  25. * 获取患者信息区域
  26. * TODO: 需要在ContentAreaLarge中添加此data-testid
  27. */
  28. getPatientInfo() {
  29. return cy.get('[data-testid="exam-patient-info"]');
  30. }
  31. /**
  32. * 获取患者姓名
  33. * TODO: 需要在患者信息组件中添加此data-testid
  34. */
  35. getPatientName() {
  36. return cy.get('[data-testid="exam-patient-name"]');
  37. }
  38. /**
  39. * 获取检查ID
  40. * TODO: 需要在患者信息组件中添加此data-testid
  41. */
  42. getStudyId() {
  43. return cy.get('[data-testid="exam-study-id"]');
  44. }
  45. /**
  46. * 验证检查界面已加载
  47. */
  48. verifyExamPageLoaded() {
  49. // 验证检查页面主容器可见
  50. this.getExamPage().should('be.visible');
  51. // 验证工具栏可见
  52. this.getToolbar().should('be.visible');
  53. // 验证内容区域可见
  54. this.getContentArea().should('be.visible');
  55. }
  56. }
  57. export default ExamPage;