Advertisement
Guest User

patient

a guest
Dec 23rd, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.06 KB | None | 0 0
  1. checklist.po
  2.  
  3. var commonHelper = require('./../../helpers/common.helper.js');
  4.  
  5. var ChecklistPage = function () {
  6.  
  7. //--------------------------------------------------------------------------
  8. // Elements
  9. //--------------------------------------------------------------------------
  10.  
  11.  
  12. //--------------------------------------------------------------------------
  13. // Functions
  14. //--------------------------------------------------------------------------
  15.  
  16. this.clickCheckbox = function (value) {
  17. element(by.cssContainingText('span', value)).click()
  18. };
  19.  
  20. this.getCheckbox = function (value) {
  21. return element(by.cssContainingText('span', value))
  22. }
  23.  
  24. };
  25.  
  26. module.exports = ChecklistPage;
  27.  
  28. -----------------------------------------------------------------------
  29. data/patient/index
  30.  
  31. module.exports = {
  32. link: browser.baseUrl + '/app/#/patient/',
  33. patient: {
  34. firstName: 'John',
  35. lastName: 'Woods',
  36. mrn: '000739493',
  37. or: 'OR2',
  38. dob: 'November 25, 1980',
  39. physicalStatus: 'ASA 1',
  40. diagnosis: 'Eumycetoma',
  41. icd: 'B470',
  42. procedure: 'Glossectomy',
  43. cpt: '41120',
  44. surgeon: 'Alex Cobb',
  45. mdSignature: 'Pranvera E2E',
  46. }
  47. };
  48.  
  49. -------------------------------------------------------------
  50. pages.js
  51.  
  52. var bottlejs = require('bottlejs').pop('test');
  53.  
  54. bottlejs.factory('PageObject', function () {
  55. return {
  56. getSignInPage: function () {
  57. var signInPage = require('./sign_in/sign_in.po.js');
  58. return new signInPage();
  59. },
  60. getPatientListPage: function () {
  61. var patientListPage = require('./patient_list/patient_list.po.js');
  62. return new patientListPage();
  63. },
  64. getPatientPage: function () {
  65. var patientPage = require('./patient/patient.po.js');
  66. return new patientPage();
  67. },
  68. getProvidersPage: function () {
  69. var providersPage = require('./patient/providers.po.js');
  70. return new providersPage();
  71. },
  72. getPreopPage: function () {
  73. var preopPage = require('./patient/preop.po.js');
  74. return new preopPage();
  75. },
  76. getChecklistPage: function () {
  77. var checklistPage = require('./patient/checklist.po.js');
  78. return new checklistPage();
  79. }
  80. }
  81. });
  82.  
  83. module.exports = bottlejs;
  84.  
  85. ---------------------------------------------------
  86. patient.po
  87.  
  88. this.btnPatient = element(by.id('patient'));
  89.  
  90. this.btnProviders = element(by.id('providers'));
  91.  
  92. this.btnConsentForm = element(by.id('consent_form'));
  93.  
  94. this.btnPreop = element(by.id('preop'));
  95.  
  96. this.btnChecklist = element(by.id('checklist'));
  97.  
  98. this.btnRegional = element(by.id('regional'));
  99.  
  100. this.btnChart = element(by.id('chart'));
  101.  
  102. this.btnEmergence = element(by.id('emergence'));
  103.  
  104. this.btnNotes = element(by.id('notes'));
  105.  
  106. this.btnLabs = element(by.id('pacu_blood_gas'));
  107.  
  108. this.btnSignatures = element(by.id('signatures'));
  109.  
  110. this.btnPqrs = element(by.id('pqrs'));
  111.  
  112. this.btnPostop = element(by.id('postop'));
  113.  
  114. this.btnPostopOrders = element(by.id('postop_orders'));
  115.  
  116. this.btnBilling = element(by.id('billing'));
  117.  
  118. //--------------------------------------------------------------------------
  119. // Functions
  120. //--------------------------------------------------------------------------
  121.  
  122. this.clickPatient = function () {
  123. this.btnPatient.click()
  124. };
  125.  
  126. this.clickProviders = function () {
  127. this.btnProviders.click()
  128. };
  129.  
  130. this.clickConsentForm = function () {
  131. this.btnConsentForm.click()
  132. };
  133.  
  134. this.clickPreop = function () {
  135. this.btnPreop.click()
  136. };
  137.  
  138. this.clickChecklist = function () {
  139. this.btnChecklist.click()
  140. };
  141.  
  142. this.clickChart = function () {
  143. this.btnChart.click()
  144. };
  145.  
  146. this.clickEmergence = function () {
  147. this.btnEmergence.click()
  148. };
  149.  
  150. this.clickRegional = function () {
  151. this.btnRegional.click()
  152. };
  153.  
  154. this.clickNotes = function () {
  155. this.btnNotes.click()
  156. };
  157.  
  158. this.clickLabs = function () {
  159. this.btnLabs.click()
  160. };
  161.  
  162. this.clickSignatures = function () {
  163. this.btnSignatures.click()
  164. };
  165.  
  166. this.clickPqrs = function () {
  167. this.btnPqrs.click()
  168. };
  169.  
  170. this.clickPostop = function () {
  171. this.btnPostop.click()
  172. };
  173.  
  174. this.clickPostopOrders = function () {
  175. this.btnPostopOrders.click()
  176. };
  177.  
  178. this.clickBilling = function () {
  179. this.btnBilling.click()
  180. };
  181.  
  182. this.getNumberOfWarningPatient = function () {
  183. return this.btnPatient.getText();
  184. };
  185.  
  186. this.getNumberOfWarningProviders = function () {
  187. return this.btnProviders.getText();
  188. };
  189.  
  190. this.getNumberOfWarningPreop = function () {
  191. return this.btnPreop.getText();
  192. };
  193.  
  194. this.getNumberOfWarningChecklist = function () {
  195. return this.btnChecklist.getText();
  196. };
  197.  
  198. this.getNumberOfWarningEmergence = function () {
  199. return this.btnEmergence.getText();
  200. };
  201.  
  202. this.getNumberOfWarningPqrs = function () {
  203. return this.btnPqrs.getText();
  204. };
  205.  
  206. --------------------------------------------------
  207. preop.po
  208.  
  209. var commonHelper = require('./../../helpers/common.helper.js');
  210.  
  211. var PreopPage = function () {
  212.  
  213. //--------------------------------------------------------------------------
  214. // Elements
  215. //-------------------------------------------------------------------------
  216.  
  217. this.eleMDSignature = $('[class^="mbsc-label"]');
  218.  
  219. this.btnAddSignature = $('[ng-click="sign(\'PreopMain\')"]');
  220.  
  221. this.btnSendPropPdf = $('[ng-click="UploadPDF()"]');
  222.  
  223. this.btnAddPreopSignature =$('[ng-click="sign(\'PreopOther\', preopSig.UserID)"]')
  224.  
  225. //--------------------------------------------------------------------------
  226. // Functions
  227. //--------------------------------------------------------------------------
  228.  
  229. this.clickAddSignature = function () {
  230. browser.executeScript('document.getElementsByClassName("row next-prev-fixed ng-scope")[0].style.display = "none"');
  231. this.btnAddSignature.click();
  232. };
  233.  
  234. this.clickAddPreopSignature = function () {
  235. this.btnAddPreopSignature.click();
  236. };
  237.  
  238. this.getMDSignature = function () {
  239. return this.eleMDSignature.getText();
  240. };
  241. };
  242.  
  243. module.exports = PreopPage;
  244.  
  245. -----------------------------------------------------------
  246. providerss.po
  247.  
  248. var commonHelper = require('./../../helpers/common.helper.js');
  249.  
  250. var ProvidersPage = function () {
  251.  
  252. //--------------------------------------------------------------------------
  253. // Elements
  254. //--------------------------------------------------------------------------
  255.  
  256. this.btnAddSurgeon = $('[ng-click="btnAddNewSurgeonClick()"]');
  257.  
  258. this.txtSurgeon = $('[value="Choose a surgeon"]');
  259.  
  260. this.selectSurgeon = $('#newSurgeon input[aria-label="Select box"]');
  261.  
  262. this.selectResult = $$('[ng-bind="item.text"]').first();
  263.  
  264. this.btnDeleteSurgeon = $('[ng-click="btnDeletePersonnel_click(\'Surgeon\', s)"]');
  265.  
  266.  
  267. //--------------------------------------------------------------------------
  268. // Functions
  269. //--------------------------------------------------------------------------
  270. this.clickAddSurgeon = function () {
  271. this.btnAddSurgeon.click();
  272. };
  273.  
  274. this.fillSurgeon = function (value) {
  275. this.txtSurgeon.click();
  276. this.selectSurgeon.sendKeys(value);
  277. this.selectResult.click();
  278. commonHelper.waitUntilElementPresent(this.btnDeleteSurgeon)
  279. };
  280.  
  281. };
  282.  
  283. module.exports = ProvidersPage;
  284. -------------------------------------------------------
  285. smoke_tests.spec
  286.  
  287. var pageObject = require('./../../po/pages').container.PageObject;
  288. var signInPage = pageObject.getSignInPage();
  289. var patientListPage = pageObject.getPatientListPage();
  290. var patientPage = pageObject.getPatientPage();
  291. var providersPage = pageObject.getProvidersPage();
  292. var preopPage = pageObject.getPreopPage();
  293. var checklistPage = pageObject.getChecklistPage();
  294. var signInData = require('./../../data/sign_in/index');
  295. var patientData = require('./../../data/patient/index');
  296. var commonHelper = require('./../../helpers/common.helper.js');
  297.  
  298. describe('Smoke Tests', function () {
  299.  
  300. var username = signInData.existingUser.username;
  301. var password = signInData.existingUser.password;
  302.  
  303. var mrn = patientData.patient.mrn;
  304. var firstName = patientData.patient.firstName + commonHelper.randomAlphaNumeric();
  305. var lastName = patientData.patient.lastName + commonHelper.randomAlphaNumeric();
  306. var or = patientData.patient.or;
  307. var dob = patientData.patient.dob;
  308. var physicalStatus = patientData.patient.physicalStatus;
  309. var diagnosis = patientData.patient.diagnosis;
  310. var procedure = patientData.patient.procedure;
  311. var surgeon = patientData.patient.surgeon;
  312. var mdSignature = patientData.patient.mdSignature;
  313.  
  314.  
  315. describe('checking for basic workflow', function () {
  316.  
  317. beforeAll(function () {
  318. browser.get(signInData.link);
  319. });
  320.  
  321. afterAll(function () {
  322. commonHelper.clearAllData();
  323. });
  324.  
  325. it('should login as existing user',function () {
  326. signInPage.login(username, password);
  327. });
  328.  
  329. it('should open new patient page',function () {
  330. patientListPage.clickAddNewPatient();
  331. commonHelper.waitUntilElementVisible(patientPage.btnSavePatient);
  332. });
  333.  
  334. it('should not show additional patient menu elements',function () {
  335. expect(patientPage.eleProvidersMenuItem.isPresent()).toBeFalsy();
  336. expect(patientPage.eleConsentFormMenuItem.isPresent()).toBeFalsy();
  337. expect(patientPage.eleChecklistMenuItem.isPresent()).toBeFalsy();
  338. expect(patientPage.eleRegionalMenuItem.isPresent()).toBeFalsy();
  339. expect(patientPage.eleChartMenuItem.isPresent()).toBeFalsy();
  340. expect(patientPage.eleEmergenceMenuItem.isPresent()).toBeFalsy();
  341. expect(patientPage.eleNotesMenuItem.isPresent()).toBeFalsy();
  342. expect(patientPage.eleLabsMenuItem.isPresent()).toBeFalsy();
  343. expect(patientPage.eleSignaturesMenuItem.isPresent()).toBeFalsy();
  344. expect(patientPage.elePqrsMenuItem.isPresent()).toBeFalsy();
  345. expect(patientPage.elePostopMenuItem.isPresent()).toBeFalsy();
  346. expect(patientPage.elePostopOrdersMenuItem.isPresent()).toBeFalsy();
  347. });
  348.  
  349. it('should fill new patient required fields',function () {
  350. patientPage.fillMrn(mrn);
  351. patientPage.fillFirstName(firstName);
  352. patientPage.fillLastName(lastName);
  353. patientPage.selectOr(or);
  354. });
  355.  
  356. it('should save patient',function () {
  357. patientPage.clickSavePatient();
  358. commonHelper.waitUntilElementVisible(patientPage.btnFinalize);
  359. });
  360.  
  361. it('should show additional patient menu elements',function () {
  362. expect(patientPage.btnFinalize.isPresent()).toBeTruthy();
  363. expect(patientPage.eleProvidersMenuItem.isPresent()).toBeTruthy();
  364. expect(patientPage.eleConsentFormMenuItem.isPresent()).toBeTruthy();
  365. expect(patientPage.eleChecklistMenuItem.isPresent()).toBeTruthy();
  366. expect(patientPage.eleRegionalMenuItem.isPresent()).toBeTruthy();
  367. expect(patientPage.eleChartMenuItem.isPresent()).toBeTruthy();
  368. expect(patientPage.eleEmergenceMenuItem.isPresent()).toBeTruthy();
  369. expect(patientPage.eleNotesMenuItem.isPresent()).toBeTruthy();
  370. expect(patientPage.eleLabsMenuItem.isPresent()).toBeTruthy();
  371. expect(patientPage.eleSignaturesMenuItem.isPresent()).toBeTruthy();
  372. expect(patientPage.elePqrsMenuItem.isPresent()).toBeTruthy();
  373. expect(patientPage.elePostopMenuItem.isPresent()).toBeTruthy();
  374. expect(patientPage.elePostopOrdersMenuItem.isPresent()).toBeTruthy();
  375. });
  376.  
  377. it('should show correct quick info',function () {
  378. expect(patientPage.fullNameQuickInfo()).toEqual(firstName + ' ' + lastName);
  379. expect(patientPage.mrnQuickInfo()).toContain(mrn);
  380. });
  381.  
  382. it('should click finalize and see number of errors', function () {
  383. patientPage.clickFinalize();
  384.  
  385. expect(patientPage.getNumberOfWarning()).toContain('16');
  386. expect(patientPage.eleFinalizeWarning.count()).toEqual(16);
  387. expect(patientPage.getNumberOfWarningPatient()).toContain('3');
  388. expect(patientPage.getNumberOfWarningProviders()).toContain('2');
  389. expect(patientPage.getNumberOfWarningPreop()).toContain('2');
  390. expect(patientPage.getNumberOfWarningChecklist()).toContain('2');
  391. expect(patientPage.getNumberOfWarningEmergence()).toContain('1');
  392. expect(patientPage.getNumberOfWarningPqrs()).toContain('4');
  393. patientPage.clickFinalize();
  394. });
  395.  
  396. it('should fill DOB', function () {
  397. patientPage.fillDOB(dob);
  398. });
  399.  
  400. it('should fill diagnosis', function () {
  401. patientPage.fillDiagnosis(diagnosis);
  402.  
  403. expect(patientPage.btnDeleteDiagnosis.isDisplayed()).toBeTruthy();
  404. });
  405.  
  406. it('should fill procedure', function () {
  407. patientPage.fillProcedure(procedure);
  408.  
  409. expect(patientPage.btnDeleteProcedure.isDisplayed()).toBeTruthy();
  410. });
  411.  
  412. it('should set dates', function () {
  413. // patientPage.setAnesStart();
  414. patientPage.setTimeOut();
  415. patientPage.setIncision();
  416. patientPage.setSurgeryEnd();
  417. //patientPage.setAnesEnd();
  418. patientPage.setPhysicalStatus(physicalStatus);
  419. });
  420.  
  421. it('should redirect on providers page', function () {
  422. patientPage.clickProviders();
  423.  
  424. expect(providersPage.btnAddSurgeon.isDisplayed()).toBeTruthy();
  425. });
  426.  
  427. it('should add surgeon', function () {
  428. providersPage.fillSurgeon(surgeon);
  429.  
  430. expect(providersPage.btnDeleteSurgeon.isDisplayed()).toBeTruthy();
  431. });
  432.  
  433. it('should redirect on providers page', function () {
  434. patientPage.clickPreop();
  435.  
  436. expect(preopPage.btnAddSignature.isDisplayed()).toBeTruthy();
  437. });
  438.  
  439. it('should add signature', function () {
  440. preopPage.clickAddSignature();
  441.  
  442. commonHelper.waitUntilElementVisible(preopPage.btnSendPropPdf);
  443. expect(preopPage.getMDSignature()).toContain(mdSignature)
  444. });
  445.  
  446. it('should add preop signature', function () {
  447. preopPage.clickAddPreopSignature();
  448. });
  449.  
  450. it('should refirect on checklist page', function () {
  451. patientPage.clickChecklist();
  452.  
  453. commonHelper.waitUntilElementVisible(checklistPage.getCheckbox('Patient Re-Evaluated Prior to Induction'));
  454. expect(checklistPage.getCheckbox('Patient Re-Evaluated Prior to Induction').isDisplayed()).toBeTruthy();
  455. });
  456. //
  457. // it('should fill checkboxes', function () {
  458. // checklistPage.clickCheckbox('Patient Re-Evaluated Prior to Induction');
  459. // checklistPage.clickCheckbox('Genera');
  460. // checklistPage.clickCheckbox('GA-TIVA');
  461. // checklistPage.clickCheckbox('Inhalation');
  462. // checklistPage.clickCheckbox('MAC');
  463. // checklistPage.clickCheckbox('Local');
  464. // checklistPage.clickCheckbox('Regional');
  465. // checklistPage.clickCheckbox('Spinal');
  466. // checklistPage.clickCheckbox('Epidural');
  467. // });
  468. });
  469. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement