enter_worklist.cy.ts 6.1 KB

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