Advertisement
Guest User

view_case

a guest
Dec 30th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.82 KB | None | 0 0
  1. viev_case.spec
  2.  
  3. var pageObject = require('./../../../po/pages').container.PageObject;
  4. var signInPage = pageObject.getSignInPage();
  5. var patientListPage = pageObject.getPatientListPage();
  6. var patientPage = pageObject.getPatientPage();
  7. var providersPage = pageObject.getProvidersPage();
  8. var preopPage = pageObject.getPreopPage();
  9. var checklistPage = pageObject.getChecklistPage();
  10. var emergencePage = pageObject.getEmergencePage();
  11. var signInData = require('./../../../data/sign_in/index');
  12. var patientData = require('./../../../data/patient/index');
  13. var commonHelper = require('./../../../helpers/common.helper.js');
  14.  
  15. describe('View case', function () {
  16.  
  17. var username = signInData.existingUser.username;
  18. var password = signInData.existingUser.password;
  19.  
  20. var mrn = patientData.patient.mrn;
  21. var firstName = patientData.patient.firstName + commonHelper.randomAlphaNumeric();
  22. var lastName = patientData.patient.lastName + commonHelper.randomAlphaNumeric();
  23. var or = patientData.patient.or;
  24. var dob = patientData.patient.dob;
  25. var facility = patientData.patient.facility;
  26. var accountNumber = patientData.patient.accountNumber;
  27. var physicalStatus = patientData.patient.physicalStatus;
  28. var diagnosis = patientData.patient.diagnosis;
  29. var procedure = patientData.patient.procedure;
  30. var surgeon = patientData.patient.surgeon;
  31. var mdSignature = patientData.patient.mdSignature;
  32.  
  33. describe('checking for view case', function () {
  34.  
  35. beforeAll(function () {
  36. browser.get(signInData.link);
  37. });
  38.  
  39. afterAll(function () {
  40. commonHelper.clearAllData();
  41. });
  42.  
  43. it('should login as existing user',function () {
  44. signInPage.login(username, password);
  45. });
  46.  
  47. it('should see correct facility',function () {
  48. expect(patientListPage.facilityName(facility).isPresent()).toBeTruthy();
  49. });
  50.  
  51. it('should open new patient page',function () {
  52. patientListPage.clickAddNewPatient();
  53. commonHelper.waitUntilElementVisible(patientPage.btnSavePatient);
  54. });
  55.  
  56. it('should fill new patient required fields',function () {
  57. patientPage.fillMrn(mrn);
  58. patientPage.fillAccountNumber(accountNumber);
  59. patientPage.fillFirstName(firstName);
  60. patientPage.fillLastName(lastName);
  61. patientPage.selectOr(or);
  62. patientPage.selectScheduledStart();
  63. patientPage.selectEncounterType('Office Based');
  64. });
  65.  
  66. it('should see correct facility',function () {
  67. expect(patientPage.selectedFacility()).toEqual(facility);
  68. });
  69.  
  70. it('should save patient',function () {
  71. patientPage.clickSavePatient();
  72. commonHelper.waitUntilElementVisible(patientPage.btnFinalize);
  73. });
  74.  
  75. it('should show correct quick info',function () {
  76. expect(patientPage.fullNameQuickInfo()).toEqual(firstName + ' ' + lastName);
  77. expect(patientPage.mrnQuickInfo()).toContain(mrn);
  78. });
  79.  
  80. it('should fill DOB', function () {
  81. patientPage.fillDOB(dob);
  82. });
  83.  
  84. it('should fill diagnosis', function () {
  85. patientPage.fillDiagnosis(diagnosis);
  86.  
  87. expect(patientPage.btnDeleteDiagnosis.isDisplayed()).toBeTruthy();
  88. });
  89.  
  90. it('should fill procedure', function () {
  91. patientPage.fillProcedure(procedure);
  92.  
  93. expect(patientPage.btnDeleteProcedure.isDisplayed()).toBeTruthy();
  94. });
  95.  
  96. it('should set dates', function () {
  97. patientPage.setAnesStart();
  98. patientPage.setTimeOut();
  99. patientPage.setIncision();
  100. patientPage.setSurgeryEnd();
  101. patientPage.setAnesEnd();
  102. patientPage.setPhysicalStatus(physicalStatus);
  103. });
  104.  
  105. it('should redirect on providers page', function () {
  106. patientPage.clickProviders();
  107.  
  108. expect(providersPage.btnAddSurgeon.isDisplayed()).toBeTruthy();
  109. });
  110.  
  111. it('should add surgeon', function () {
  112. providersPage.fillSurgeon(surgeon);
  113.  
  114. expect(providersPage.btnDeleteSurgeon.isDisplayed()).toBeTruthy();
  115. });
  116.  
  117. it('should redirect on preop page', function () {
  118. patientPage.clickPreop();
  119.  
  120. expect(preopPage.btnAddSignature.isDisplayed()).toBeTruthy();
  121. });
  122.  
  123. it('should add md signature', function () {
  124. preopPage.clickAddSignature();
  125.  
  126. expect(preopPage.getMDSignature()).toContain(mdSignature)
  127. });
  128.  
  129. it('should redirect on checklist page', function () {
  130. var checkboxLabel = 'Patient Re-Evaluated Prior to Induction';
  131.  
  132. patientPage.clickChecklist();
  133. commonHelper.waitUntilElementVisible(checklistPage.getCheckboxPreProcedure(checkboxLabel));
  134.  
  135. expect(checklistPage.getCheckboxPreProcedure(checkboxLabel).isDisplayed()).toBeTruthy();
  136. });
  137.  
  138. it('should check checkboxes', function () {
  139. checklistPage.clickCheckboxPreProcedure('Patient Re-Evaluated Prior to Induction');
  140. checklistPage.clickCheckboxAnesthesia('General');
  141. checklistPage.clickCheckboxAnesthesia('GA-TIVA');
  142. checklistPage.clickCheckboxAnesthesia('Inhalation');
  143. });
  144.  
  145. it('should open emergence page', function () {
  146. patientPage.clickEmergence();
  147.  
  148. expect(emergencePage.btnAddIntraopSignature.isDisplayed()).toBeTruthy();
  149. });
  150.  
  151. it('should add intraop signature', function () {
  152. emergencePage.clickAddIntraopSignature();
  153. });
  154.  
  155. it('should open pqrs', function () {
  156. patientPage.clickPqrs();
  157.  
  158. commonHelper.waitUntilElementVisible(emergencePage.selPqrsDescription(1));
  159. });
  160.  
  161. it('should add pqrs', function () {
  162. emergencePage.selectTemperature('Not Applicable');
  163. emergencePage.selectPacu('PACU handover checklist used');
  164. emergencePage.selectIcu('ICU Handover Checklist Used');
  165. emergencePage.selectEvent('Not Applicable');
  166. });
  167.  
  168. it('should click finalize', function () {
  169. commonHelper.waitUntilElementVisible(patientPage.btnFinalize)
  170. patientPage.clickFinalize();
  171. });
  172.  
  173. it('should see green checkbox', function () {
  174. commonHelper.waitUntilElementVisible(patientPage.chkGreen);
  175. });
  176.  
  177. it('should click link to finalize', function () {
  178. patientPage.clickLinkToFinalize();
  179. commonHelper.waitUntilElementVisible(patientPage.elePdfViewer);
  180. });
  181.  
  182. it('should click back button', function () {
  183. patientPage.clickBack();
  184. });
  185.  
  186. it('should show patient list page', function () {
  187. commonHelper.waitUntilElementVisible(patientListPage.btnAddNewPatient);
  188. });
  189.  
  190. it('should open complited case', function () {
  191. patientListPage.clickComplitedCases();
  192.  
  193. expect(patientListPage.getComplitedCasesCard(firstName + ' ' + lastName).isDisplayed()).toBeTruthy()
  194. });
  195.  
  196. it('should see patient card', function () {
  197. expect(patientListPage.getPatientInfo(firstName).isDisplayed()).toBeTruthy();
  198. expect(patientListPage.getPatientInfo(lastName).isDisplayed()).toBeTruthy();
  199. expect(patientListPage.getPatientInfo(mrn).isDisplayed()).toBeTruthy();
  200. expect(patientListPage.getPatientInfo(or).isDisplayed()).toBeTruthy();
  201. });
  202.  
  203. it('should click on view case', function () {
  204. patientListPage.clickViewCase();
  205.  
  206. commonHelper.waitUntilElementVisible(patientPage.btnUnlock)
  207. });
  208. });
  209. });
  210. ------------------------------------------------------------
  211. patient.po
  212.  
  213. this.btnUnlock = $('[ng-show="canUnlock()"]')
  214. ---------------------------------------------------------------------
  215. patient_list.po
  216.  
  217. var commonHelper = require('./../../helpers/common.helper.js');
  218.  
  219. var PatientListPage = function () {
  220.  
  221. //--------------------------------------------------------------------------
  222. // Elements
  223. //--------------------------------------------------------------------------
  224.  
  225. this.btnAddNewPatient = element(by.id('add_new_patient'));
  226.  
  227. this.btnComplitedCases = element(by.id('statusGroup3'));
  228.  
  229. this.btnViewCase = element(by.id('enter_case'))
  230.  
  231. //--------------------------------------------------------------------------
  232. // Functions
  233. //--------------------------------------------------------------------------
  234.  
  235. this.clickViewCase = function () {
  236. this.btnViewCase.click();
  237. };
  238.  
  239. this.clickComplitedCases = function () {
  240. this.btnComplitedCases.click();
  241. };
  242.  
  243. this.clickAddNewPatient = function() {
  244. commonHelper.waitUntilElementVisible(this.btnAddNewPatient);
  245. this.btnAddNewPatient.click();
  246. };
  247.  
  248. this.facilityName = function(value) {
  249. return element(by.cssContainingText('[ng-repeat="f in p.Data.Lookups.Facilities"]', value));
  250. };
  251.  
  252. this.getComplitedCasesCard = function (name) {
  253. return element(by.cssContainingText('#CompletedCases', name))
  254. };
  255.  
  256. this.getPatientInfo = function (value) {
  257. return element(by.cssContainingText('[class^="col-sm-6 ng-binding"]', value))
  258. }
  259. };
  260. module.exports = PatientListPage;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement