enter_worklist.cy.ts 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. /// <reference types="cypress" />
  2. import LoginPage from '../../../support/pageObjects/LoginPage';
  3. import MainPage from '../../../support/pageObjects/MainPage';
  4. import WorklistPage from '../../../support/pageObjects/WorklistPage';
  5. describe('Enter Worklist', () => {
  6. const loginPage = new LoginPage();
  7. const mainPage = new MainPage();
  8. const worklistPage = new WorklistPage();
  9. beforeEach(() => {
  10. cy.intercept('GET', '/dr/api/v1/auth/study*', {
  11. statusCode: 200,
  12. body: {
  13. "code": "0x000000",
  14. "description": "Success",
  15. "solution": "",
  16. "data": {
  17. "@type": "type.googleapis.com/dr.study.StudyList",
  18. "count": 1992,
  19. "studies": [
  20. {
  21. "study_instance_uid": "2.25.156.999999.0000.1.2.2831189249.819691.1757656379.100635",
  22. "study_id": "20250912135259444",
  23. "public_study_id": "",
  24. "specific_character_set": "ISO_IR 192",
  25. "accession_number": "ACC0012345",
  26. "ref_physician": "Dr. Smith (Vet)",
  27. "patient_id": "PET007",
  28. "patient_name": "乾隆-==皇上",
  29. "patient_english_name": "Buddy en",
  30. "patient_former_name": "Buddy f",
  31. "patient_size": "Large",
  32. "other_patient_ids": "",
  33. "other_patient_names": "",
  34. "patient_age": "5Y",
  35. "patient_dob": "2025-06-10T03:12:36.181739Z",
  36. "patient_sex": "M",
  37. "sex_neutered": "",
  38. "pregnancy_status": "",
  39. "patient_state": "",
  40. "admitting_time": null,
  41. "priority": "",
  42. "reg_source": "",
  43. "study_description": "",
  44. "study_start_datetime": "2025-09-12T05:52:59.699143Z",
  45. "study_end_datetime": null,
  46. "scheduled_procedure_step_start_date": null,
  47. "performed_physician": "",
  48. "study_lock": "Unlocked",
  49. "folder_path": "",
  50. "operator_name": "OP987",
  51. "modality": "DX",
  52. "weight": 25,
  53. "thickness": 15,
  54. "length": 60,
  55. "patient_type": "Human",
  56. "study_type": "Normal",
  57. "owner_name": "owner1",
  58. "chip_number": "CHIP123456789",
  59. "variety": "Golden Retriever",
  60. "is_anaesthesia": true,
  61. "is_sedation": true,
  62. "mwl": "",
  63. "is_exported": false,
  64. "is_edited": false,
  65. "is_appended": false,
  66. "department": "",
  67. "mapped_status": false,
  68. "qc_result": false,
  69. "comment": "一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四",
  70. "study_status": "Arrived",
  71. "sort": 0,
  72. "product": "DROS",
  73. "series": []
  74. },
  75. {
  76. "study_instance_uid": "2.25.156.999999.0000.1.2.2831189249.819691.1757656379.100627",
  77. "study_id": "20250912135259265",
  78. "public_study_id": "",
  79. "specific_character_set": "ISO_IR 192",
  80. "accession_number": "ACC0012345",
  81. "ref_physician": "Dr. Smith (Vet)",
  82. "patient_id": "PET007",
  83. "patient_name": "Buddy (Dog)",
  84. "patient_english_name": "Buddy en",
  85. "patient_former_name": "Buddy f",
  86. "patient_size": "Large",
  87. "other_patient_ids": "",
  88. "other_patient_names": "",
  89. "patient_age": "5Y",
  90. "patient_dob": "2025-06-10T03:12:36.181739Z",
  91. "patient_sex": "M",
  92. "sex_neutered": "",
  93. "pregnancy_status": "",
  94. "patient_state": "",
  95. "admitting_time": null,
  96. "priority": "",
  97. "reg_source": "",
  98. "study_description": "",
  99. "study_start_datetime": "2025-09-12T05:52:59.573182Z",
  100. "study_end_datetime": null,
  101. "scheduled_procedure_step_start_date": null,
  102. "performed_physician": "",
  103. "study_lock": "Unlocked",
  104. "folder_path": "",
  105. "operator_name": "OP987",
  106. "modality": "DX",
  107. "weight": 25,
  108. "thickness": 15,
  109. "length": 60,
  110. "patient_type": "Human",
  111. "study_type": "Normal",
  112. "owner_name": "owner1",
  113. "chip_number": "CHIP123456789",
  114. "variety": "Golden Retriever",
  115. "is_anaesthesia": true,
  116. "is_sedation": true,
  117. "mwl": "",
  118. "is_exported": false,
  119. "is_edited": false,
  120. "is_appended": false,
  121. "department": "",
  122. "mapped_status": false,
  123. "qc_result": false,
  124. "comment": "一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四",
  125. "study_status": "Arrived",
  126. "sort": 0,
  127. "product": "DROS",
  128. "series": []
  129. },
  130. ]
  131. }
  132. }
  133. }).as('getStudyList');
  134. loginPage.visit();
  135. loginPage.getUsernameInput().should('be.visible');
  136. loginPage.getPasswordInput().should('be.visible');
  137. loginPage.getSubmitButton().should('be.visible');
  138. });
  139. it('should navigate to the worklist and verify data', () => {
  140. loginPage.login('admin', '123456');
  141. cy.contains('登录成功').should('be.visible', { timeout: 10000 });
  142. mainPage.clickPatientManagementButton();
  143. mainPage.clickWorklistButton();
  144. cy.wait('@getStudyList');
  145. worklistPage.getTable().should('be.visible');
  146. worklistPage.getTable().find('tr').should('have.length.at.least', 2); // Assuming there's a header row
  147. });
  148. });