Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- allergy.po
- var commonHelper = require('./../../../helpers/common.helper.js');
- var PreopAllergyPage = function () {
- //--------------------------------------------------------------------------
- // Elements
- //-------------------------------------------------------------------------
- this.parentSection = $('#allergies.content');
- this.allergySection = $$('[ng-if="preOp.showAllergies"]').get(0);
- this.selectFirstResult = $('[ng-bind-html="item.text | highlight: $select.search"]');
- this.btnDeleteAllergy = $('[ng-click="allergies.deleteAllergy(a)"]');
- //--------------------------------------------------------------------------
- // Functions
- //--------------------------------------------------------------------------
- this.getCheckbox = function(value) {
- return element(by.cssContainingText("label", value))
- };
- this.getCheckboxInput = function(section, value) {
- return this.getCheckbox(section, value).$('input');
- };
- this.eleAllergyField = function () {
- return $('[class="panel panel-primary"]:nth-of-type(1)')
- };
- this.fillAllergen = function (value) {
- this.eleAllergyField().$('[ng-click="$select.activate()"]').click();
- this.eleAllergyField().$('[ng-model="$select.search"]').sendKeys(value);
- this.selectFirstResult.click();
- commonHelper.waitUntilElementVisible(this.btnDeleteAllergy)
- };
- this.fillReaction = function (name) {
- this.eleAllergyField().$('[ng-focus="detectSelect()"]').click();
- $('[label="' + name + '"]').click();
- };
- this.fillSeverity = function (name) {
- this.eleAllergyField().$('[label="-Choose Severity-"]').click();
- $('[label="' + name + '"]').click();
- };
- };
- module.exports = PreopAllergyPage;
- -------------------------------------------------------
- day_of_sx.po
- var PreopDayOfSxPage = function () {
- //--------------------------------------------------------------------------
- // Elements
- //-------------------------------------------------------------------------
- this.daySection = $('[ng-if="!p.isFutureDate(p.Data.Proc.SurgeryDate)"]');
- //--------------------------------------------------------------------------
- // Functions
- //--------------------------------------------------------------------------
- this.getCheckbox = function(value) {
- return this.daySection.element(by.cssContainingText("label", value))
- };
- this.getCheckboxInput = function(section, value) {
- return this.getCheckbox(section, value).$('input');
- };
- this.clickCheckbox = function( value) {
- return this.getCheckbox( value).click();
- };
- this.txtNotes = function() {
- return this.airwaySection.$('textarea');
- };
- };
- module.exports = PreopDayOfSxPage;
- -----------------------------------------------------------
- labs.po
- var commonHelper = require('./../../../helpers/common.helper.js');
- var PreopLabsPage = function () {
- //--------------------------------------------------------------------------
- // Elements
- //-------------------------------------------------------------------------
- this.btnPlus = $('[ng-click="addLab()"]');
- this.btnDone = $('[ng-click="closeLabs()"]');
- //--------------------------------------------------------------------------
- // Functions
- //--------------------------------------------------------------------------
- this.getCheckbox = function(value) {
- return element(by.cssContainingText("label", value))
- };
- this.getCheckboxInput = function(section, value) {
- return this.getCheckbox(section, value).$('input');
- };
- this.clickCheckbox = function(value) {
- return this.getCheckbox(value).click();
- };
- this.clickGraphCell = function(name) {
- $('.' + name).click();
- };
- this.clickDone = function() {
- this.btnDone.click();
- commonHelper.waitUntilElementIsNotPresent(this.btnDone);
- };
- };
- module.exports = PreopLabsPage;
- -------------------------------------------------------
- med_sh.po
- var PreopMedHxPage = function () {
- //--------------------------------------------------------------------------
- // Elements
- //-------------------------------------------------------------------------
- this.historySection = element.all(by.id('pastMedicalHistory')).get(0);
- //--------------------------------------------------------------------------
- // Functions
- //--------------------------------------------------------------------------
- this.getCheckbox = function(value) {
- return element(by.cssContainingText("[ng-repeat*='hi in HealthIssuesCol'] label", value))
- };
- this.getCheckboxInput = function(section, value) {
- return this.getCheckbox(section, value).$('input');
- };
- this.clickCheckbox = function( value) {
- this.getCheckbox(value).click();
- };
- this.txtNotes = function() {
- return this.historySection.$('textarea');
- };
- };
- module.exports = PreopMedHxPage;
- ----------------------------------------------------
- pages.po
- var bottlejs = require('bottlejs').pop('test');
- bottlejs.factory('PageObject', function () {
- return {
- getSignInPage: function () {
- var signInPage = require('./sign_in/sign_in.po.js');
- return new signInPage();
- },
- getPatientListPage: function () {
- var patientListPage = require('./patient_list/patient_list.po.js');
- return new patientListPage();
- },
- getPatientPage: function () {
- var patientPage = require('./patient/patient.po.js');
- return new patientPage();
- },
- getProvidersPage: function () {
- var providersPage = require('./patient/providers.po.js');
- return new providersPage();
- },
- getPreopSummaryPage: function () {
- var preopSummaryPage = require('./patient/preop/summary.po.js');
- return new preopSummaryPage();
- },
- getPreopPtInfoPage: function () {
- var preopPtInfoPage = require('./patient/preop/pt_info.po.js');
- return new preopPtInfoPage();
- },
- getPreopMedHxPage: function () {
- var preopMedHxPage = require('./patient/preop/med_hx.po.js');
- return new preopMedHxPage();
- },
- getPreopMedsPage: function () {
- var preopMedsPage = require('./patient/preop/meds.po.js');
- return new preopMedsPage();
- },
- getPreopSxHxPage: function () {
- var preopSxHxPage = require('./patient/preop/sx_hx.po.js');
- return new preopSxHxPage();
- },
- getPreopAnesHxPage: function () {
- var preopAnesHxPage = require('./patient/preop/anes_hx.po.js');
- return new preopAnesHxPage();
- },
- getPreopSocialHxPage: function () {
- var preopSocialHxPage = require('./patient/preop/social_hx.po.js');
- return new preopSocialHxPage();
- },
- getPreopLabsPage: function () {
- var preopLabsPage = require('./patient/preop/labs.po.js');
- return new preopLabsPage();
- },
- getPreopVitalsPage: function () {
- var preopVitalsPage = require('./patient/preop/vitals.po.js');
- return new preopVitalsPage();
- },
- getPreopAirwayPage: function () {
- var preopAirwayPage = require('./patient/preop/airway.po.js');
- return new preopAirwayPage();
- },
- getPreopAllergyPage: function () {
- var preopAllergyPage = require('./patient/preop/allergy.po.js');
- return new preopAllergyPage();
- },
- getPreopAnesEvalPage: function () {
- var preopAnesEvalPage = require('./patient/preop/anes_eval.po.js');
- return new preopAnesEvalPage();
- },
- getPreopFollowupPage: function () {
- var preopFollowupPage = require('./patient/preop/followup.po.js');
- return new preopFollowupPage();
- },
- getPreopDayOfSxPage: function () {
- var preopDayOfSxPage = require('./patient/preop/day_of_sx.po.js');
- return new preopDayOfSxPage();
- },
- getPreopNotesPage: function () {
- var preopNotesPage = require('./patient/preop/notes.po.js');
- return new preopNotesPage();
- },
- getChecklistPage: function () {
- var checklistPage = require('./patient/checklist.po.js');
- return new checklistPage();
- },
- getEmergencePage: function () {
- var emergencePage = require('./patient/emergence.po.js');
- return new emergencePage();
- },
- getRegionalPage: function () {
- var regionalPage = require('./patient/regional.po.js');
- return new regionalPage();
- },
- getSignaturePage: function () {
- var signaturesPage = require('./patient/signatures.po.js');
- return new signaturesPage();
- },
- getPostopPage: function () {
- var postopPage = require('./patient/postop.po.js');
- return new postopPage();
- },
- getTemplatesPage: function () {
- var templatesPage = require('./patient/templates.po.js');
- return new templatesPage();
- }
- }
- });
- module.exports = bottlejs;
- ----------------------------------------------
- patient.po
- var commonHelper = require('./../../helpers/common.helper.js');
- var NewPatientPage = function () {
- //--------------------------------------------------------------------------
- // Locators
- //--------------------------------------------------------------------------
- var eventClick = '[ng-click="btnEventClick($event)"]:nth-of-type(1)';
- //--------------------------------------------------------------------------
- // Elements
- //--------------------------------------------------------------------------
- this.btnSavePatient = $('[ng-click="saveClick($event)"]');
- this.btnFinalize = $('[ng-click="finalizeClick(true)"]');
- this.txtMrn = element(by.model('p.Data.Patient.MRN'));
- this.txtFirstName = element(by.model('p.Data.Patient.FirstName'));
- this.txtLastName = element(by.model('p.Data.Patient.LastName'));
- this.txtAccountNumber = element(by.model('p.Data.Proc.AccountNumber'));
- this.txtDob = element(by.id('DOB'));
- this.selOr = $('[get-options="getFacilitiesORs()"] select');
- this.selEncounterType = $('[get-options="getEncounterTypes()"] select');
- this.eleProvidersMenuItem = element(by.id('providers'));
- this.eleConsentFormMenuItem = element(by.id('consent_form'));
- this.eleChecklistMenuItem = element(by.id('checklist'));
- this.eleRegionalMenuItem = element(by.id('regional'));
- this.eleChartMenuItem = element(by.id('chart'));
- this.eleEmergenceMenuItem = element(by.id('emergence'));
- this.eleNotesMenuItem = element(by.id('notes'));
- this.eleLabsMenuItem = element(by.id('pacu_blood_gas'));
- this.eleSignaturesMenuItem = element(by.id('signatures'));
- this.elePqrsMenuItem = element(by.id('pqrs'));
- this.elePostopMenuItem = element(by.id('postop'));
- this.elePostopOrdersMenuItem = element(by.id('postop_orders'));
- this.eleNumberFinalizeWarning = $('[ng-if="p.Data.validationList"]');
- this.eleFinalizeWarning = element.all(by.repeater('v in p.Data.validationList'));
- this.txtFullNameQuick = element(by.binding('p.Data.Patient.FirstName'));
- this.txtMrnQuick = element(by.binding('p.Data.Patient.MRN'));
- this.btnSet = $('.dwb0');
- this.txtDiagnosis = $('#diagnosis-new [class^="ui-input"]');
- this.eleDiagnosisSearch = $('[title="Diagnosis"] div[placeholder="-Search-"]');
- this.eleProcedureSearch = $('[title="Procedure"] div[placeholder="-Search-"]');
- this.selectDiagnosis = $('#diagnosis-new input[aria-owns^="ui-select-choices"]');
- this.btnDeleteDiagnosis = $('[ng-click="btnDeleteCode_click(\'Diagnosis\', d)"]');
- this.txtProcedure = $('#procedure-new [class^="ui-input"]')
- this.selectProcedure = $('#procedure-new input[aria-label="Select box"]');
- this.btnDeleteProcedure = $('[ng-click="btnDeleteCode_click(\'Procedure\', pr)"]');
- this.btnPhysicalStatus = element(by.cssContainingText('[ng-click="physicalStatusClick($event, t)"]', 'Physical Status'));
- this.btnTimeOut = $('#TimeOutTime ' + eventClick);
- this.btnIncision = $('#IncisionTime ' + eventClick);
- this.btnSurgeryEnd = $('#SurgeryEndTime ' + eventClick);
- this.btnAnesEnd = $('#AnesEnd ' + eventClick);
- this.btnAnesStart = $('#AnesStart ' + eventClick);
- this.eleDatePopup = $('[role="dialog"]');
- this.selectResult = $('.active[ng-repeat="item in $select.items track by $index"]');
- this.btnPatient = element(by.id('patient'));
- this.btnProviders = element(by.id('providers'));
- this.btnConsentForm = element(by.id('consent_form'));
- this.btnPreop = element(by.id('preop'));
- this.btnChecklist = element(by.id('checklist'));
- this.btnRegional = element(by.id('regional'));
- this.btnChart = element(by.id('chart'));
- this.btnEmergence = element(by.id('emergence'));
- this.btnNotes = element(by.id('notes'));
- this.btnLabs = element(by.id('pacu_blood_gas'));
- this.btnSignatures = element(by.id('signatures'));
- this.btnPqrs = element(by.id('pqrs'));
- this.btnPostop = element(by.id('postop'));
- this.btnPostopOrders = element(by.id('postop_orders'));
- this.btnBilling = element(by.id('billing'));
- this.selScheduledStart = element(by.model('p.Data.Proc.ScheduleStartTime'));
- this.chkGreen = $('.glyphicons-check.grass-d');
- this.lnkClickToFinalize = element(by.cssContainingText('div.col-xs-10', 'Validated! Click to finalize.'));
- this.elePdfViewer = $('#pdf_wrapper #pdfframe');
- this.btnBack = $('[ng-click="goBack()"]');
- this.btnUnlock = $('[ng-show="canUnlock()"]');
- this.btnRigthScreenSelect = element(by.id('account-nav'));
- this.btnViewRecords = $('[ng-click="print(pdfLink)"]');
- this.btnReport = $('[ng-click="go(\'app.reportAProblem\', $event)"]');
- this.btnLogout = $('[class="dropdown-menu pull-right"] [ng-click="logout()"]');
- this.btnUnlockYes = $('[ng-click="confirmYesCallback()"]');
- this.txtNotes = element(by.model('addendum.text'));
- this.btnSaveAndSign = $('[ng-click="confirmAddendum()"]');
- this.elePDF = element(by.id('pdf_wrapper'));
- this.btnCancel = $('[ng-click="cancelCaseClick()"]');
- this.btnCancelCaseSave = $('[ng-click="cancelCaseSave()"]');
- this.btnReactivate = $('[ng-click="reactivateCase()"]');
- this.btnTemplate = $('[ng-click="go(\'app.templates\', $event)"]')
- //--------------------------------------------------------------------------
- // Functions
- //--------------------------------------------------------------------------
- this.clickTemplate = function () {
- this.btnTemplate.click();
- };
- this.clickCancelCaseSave = function () {
- this.btnCancelCaseSave.click();
- };
- this.checkCancelReason = function (name) {
- element(by.cssContainingText('span', name)).click()
- };
- this.clickCancel = function () {
- this.btnCancel.click();
- };
- this.clickSaveAndSign = function () {
- this.btnSaveAndSign.click();
- };
- this.fillNotes = function (value) {
- this.txtNotes.clear();
- this.txtNotes.sendKeys(value);
- };
- this.clickUnlockYes = function () {
- this.btnUnlockYes.click();
- };
- this.clickUnlock = function () {
- this.btnUnlock.click();
- };
- this.clickRightScreenMenu = function () {
- this.btnRigthScreenSelect.click();
- };
- this.fillMrn = function(value) {
- this.txtMrn.clear();
- this.txtMrn.sendKeys(value);
- };
- this.fillAccountNumber = function(value) {
- this.txtAccountNumber.clear();
- this.txtAccountNumber.sendKeys(value);
- };
- this.fillFirstName = function(value) {
- this.txtFirstName.clear();
- this.txtFirstName.sendKeys(value);
- };
- this.fillLastName = function(value) {
- this.txtLastName.clear();
- this.txtLastName.sendKeys(value);
- };
- this.selectOr = function(option) {
- commonHelper.selectFromDropdown(this.selOr, option);
- };
- this.clickSavePatient = function() {
- this.btnSavePatient.click();
- };
- this.fullNameQuickInfo = function() {
- return this.txtFullNameQuick.getText();
- };
- this.mrnQuickInfo = function() {
- return this.txtMrnQuick.getText();
- };
- this.fillDOB = function (date) {
- browser.executeScript('$("#DOB").prop("value", "'+ date +'")');
- browser.executeScript('$("#DOB").trigger("change")');
- this.txtDob.click();
- this.clickSet();
- };
- this.fillDiagnosis = function (value) {
- this.txtDiagnosis.click();
- this.selectDiagnosis.sendKeys(value);
- commonHelper.waitUntilElementVisible(this.selectResult);
- this.selectResult.click();
- commonHelper.waitUntilElementPresent(this.btnDeleteDiagnosis);
- };
- this.fillProcedure = function (value) {
- this.txtProcedure.click();
- this.selectProcedure.sendKeys(value);
- commonHelper.waitUntilElementVisible(this.selectResult);
- this.selectResult.click();
- commonHelper.waitUntilElementPresent(this.btnDeleteProcedure);
- };
- this.selectedFacility = function() {
- return $('[model="p.Data.Patient.FacilityID"] option[selected="selected"]').getText();
- };
- this.selectScheduledStart = function() {
- this.selScheduledStart.click();
- this.clickSet();
- };
- this.selectEncounterType = function(option) {
- commonHelper.selectFromDropdown(this.selEncounterType, option);
- };
- // Time panel
- this.setTimeOut = function () {
- this.btnTimeOut.click();
- this.clickSet();
- commonHelper.waitUntilElementInvisible(this.eleDatePopup);
- };
- this.setIncision = function () {
- this.btnIncision.click();
- this.clickSet();
- commonHelper.waitUntilElementInvisible(this.eleDatePopup);
- };
- this.setSurgeryEnd = function () {
- this.btnSurgeryEnd.click();
- this.clickSet();
- commonHelper.waitUntilElementInvisible(this.eleDatePopup);
- };
- this.setAnesEnd = function () {
- this.btnAnesEnd.click();
- this.clickSet();
- commonHelper.waitUntilElementInvisible(this.eleDatePopup);
- };
- this.setAnesStart = function () {
- this.btnAnesStart.click();
- this.clickSet();
- commonHelper.waitUntilElementInvisible(this.eleDatePopup);
- };
- this.setPhysicalStatus = function (value) {
- this.btnPhysicalStatus.click();
- element(by.css('[data-val="' + value + '"]')).click();
- this.clickSet();
- };
- this.clickSet = function() {
- commonHelper.waitUntilElementVisible(this.btnSet);
- this.btnSet.click();
- browser.sleep(500);
- };
- // Warnings
- this.getNumberOfWarningPatient = function () {
- return this.btnPatient.getText();
- };
- this.getNumberOfWarningProviders = function () {
- return this.btnProviders.getText();
- };
- this.getNumberOfWarningPreop = function () {
- return this.btnPreop.getText();
- };
- this.getNumberOfWarningChecklist = function () {
- return this.btnChecklist.getText();
- };
- this.getNumberOfWarningEmergence = function () {
- return this.btnEmergence.getText();
- };
- this.getNumberOfWarningPqrs = function () {
- return this.btnPqrs.getText();
- };
- this.getNumberOfWarning = function () {
- return this.eleNumberFinalizeWarning.getText();
- };
- // Open page from left menu
- this.clickPatient = function () {
- this.btnPatient.click()
- };
- this.clickProviders = function () {
- this.btnProviders.click()
- };
- this.clickConsentForm = function () {
- this.btnConsentForm.click()
- };
- this.clickPreop = function () {
- this.btnPreop.click()
- };
- this.clickChecklist = function () {
- this.btnChecklist.click()
- };
- this.clickChart = function () {
- this.btnChart.click()
- };
- this.clickEmergence = function () {
- this.btnEmergence.click()
- };
- this.clickRegional = function () {
- this.btnRegional.click()
- };
- this.clickNotes = function () {
- this.btnNotes.click()
- };
- this.clickLabs = function () {
- this.btnLabs.click()
- };
- this.clickSignatures = function () {
- this.btnSignatures.click()
- };
- this.clickPqrs = function () {
- this.btnPqrs.click()
- };
- this.clickPostop = function () {
- this.btnPostop.click()
- };
- this.clickPostopOrders = function () {
- this.btnPostopOrders.click()
- };
- this.clickBilling = function () {
- this.btnBilling.click()
- };
- this.clickLinkToFinalize = function() {
- this.lnkClickToFinalize.click();
- };
- this.clickFinalize = function() {
- commonHelper.waitUntilElementVisible(this.btnFinalize)
- this.btnFinalize.click();
- };
- this.clickBack = function() {
- this.btnBack.click();
- };
- };
- module.exports = NewPatientPage;
- -------------------------------------------------------------------
- regional.po
- var commonHelper = require('./../../helpers/common.helper.js');
- var RegionalPage = function () {
- //--------------------------------------------------------------------------
- // Elements
- //--------------------------------------------------------------------------
- this.btnAddSignatureRegoinal = $('[ng-click="sign(\'Regional\')"]');
- this.selectNerveBlock = element(by.model('b.NerveBlock'));
- //--------------------------------------------------------------------------
- // Functions
- //--------------------------------------------------------------------------
- this.getTime = function () {
- return element(by.css('[ng-repeat*="Priority"]:nth-of-type(1) input'));
- };
- this.clickAddSignatureRegoinal = function () {
- this.btnAddSignatureRegoinal.click();
- };
- this.clickCheckbox = function(value) {
- return element(by.cssContainingText("label", value)).click();
- };
- };
- module.exports = RegionalPage;
- -------------------------------------------------------
- summary.po
- var PreopSummaryPage = function () {
- //--------------------------------------------------------------------------
- // Elements
- //-------------------------------------------------------------------------
- this.eleMDSignature = $$('[class^="mbsc-label"]').first();
- this.btnAddSignature = $('[ng-click="sign(\'PreopMain\')"]');
- this.btnSendPropPdf = $('[ng-click="UploadPDF()"]');
- this.btnAddPreopSignature =$('[ng-click="sign(\'PreopOther\', preopSig.UserID)"]');
- //--------------------------------------------------------------------------
- // Functions
- //--------------------------------------------------------------------------
- this.clickAddSignature = function () {
- browser.executeScript('document.getElementsByClassName("row next-prev-fixed ng-scope")[0].style.display = "none"');
- this.btnAddSignature.click();
- };
- this.clickAddPreopSignature = function () {
- browser.executeScript('document.getElementsByClassName("col-xs-12 text-charcoal")[0].style.display = "none"');
- browser.executeScript('document.getElementsByClassName("row next-prev-fixed ng-scope")[0].style.display = "none"');
- this.btnAddPreopSignature.click();
- };
- this.getMDSignature = function () {
- return this.eleMDSignature.getText();
- };
- this.openPreopSubtab = function(name) {
- element(by.cssContainingText('[ng-repeat="view in preOp.menuItems"]', name)).click();
- };
- this.openPreopSubtabTakeCase = function(name) {
- element(by.cssContainingText('[ng-repeat="view in preOp.menuItems"]', name)).click();
- };
- };
- module.exports = PreopSummaryPage;
- ---------------------------------------------------------------
- take_case.spec
- var pageObject = require('./../../../po/pages').container.PageObject;
- var signInPage = pageObject.getSignInPage();
- var patientListPage = pageObject.getPatientListPage();
- var patientPage = pageObject.getPatientPage();
- var providersPage = pageObject.getProvidersPage();
- var preopSummaryPage = pageObject.getPreopSummaryPage();
- var preopMedHxPage = pageObject.getPreopMedHxPage();
- var preopMedsPage = pageObject.getPreopMedsPage();
- var preopAllergyPage = pageObject.getPreopAllergyPage();
- var preopDayOfSxPage = pageObject.getPreopDayOfSxPage();
- var preopLabsPage = pageObject.getPreopLabsPage();
- var templatesPage = pageObject.getTemplatesPage();
- var checklistPage = pageObject.getChecklistPage();
- var regionalPage = pageObject.getRegionalPage();
- var emergencePage = pageObject.getEmergencePage();
- var signInData = require('./../../../data/sign_in/index');
- var patientData = require('./../../../data/patient/index');
- var commonHelper = require('./../../../helpers/common.helper.js');
- describe('Take case', function () {
- var username = signInData.existingUser.username;
- var password = signInData.existingUser.password;
- var mrn = patientData.patient.mrn;
- var firstName = patientData.patient.firstName + commonHelper.randomAlphaNumeric();
- var lastName = patientData.patient.lastName + commonHelper.randomAlphaNumeric();
- var fullName = firstName + ' ' + lastName;
- var or = patientData.patient.or;
- var dob = patientData.patient.dob;
- var physicalStatus = patientData.patient.physicalStatus;
- var diagnosis = patientData.patient.diagnosis;
- var procedure = patientData.patient.procedure;
- var surgeon = patientData.patient.surgeon;
- var userName = patientData.patient.mdSignature;
- describe('checking for take case functional - adding case', function () {
- beforeAll(function () {
- browser.get(signInData.link);
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should login as existing user',function () {
- signInPage.login(username, password);
- });
- it('should open new patient page',function () {
- patientListPage.clickAddNewPatient();
- commonHelper.waitUntilElementVisible(patientPage.btnSavePatient);
- });
- it('should fill new patient required fields',function () {
- patientPage.fillMrn(mrn);
- patientPage.fillFirstName(firstName);
- patientPage.fillLastName(lastName);
- patientPage.selectOr(or);
- patientPage.clickSavePatient();
- patientPage.setAnesStart();
- }, 20000);
- it('should open preops', function () {
- patientPage.clickPreop();
- preopSummaryPage.clickAddSignature();
- });
- it('should fill Allergy tab', function () {
- preopSummaryPage.openPreopSubtabTakeCase('Allergy');
- commonHelper.waitUntilElementVisible(preopAllergyPage.parentSection);
- preopAllergyPage.fillAllergen('A-25');
- preopAllergyPage.fillReaction('Anxiety');
- preopAllergyPage.fillSeverity('Mild');
- });
- it('should fill meds tab', function () {
- preopSummaryPage.openPreopSubtabTakeCase('Meds');
- commonHelper.waitUntilElementVisible(preopMedsPage.eleInpatientMedicament());
- preopMedsPage.fillMedication('A-25');
- preopMedsPage.fillRoute('Anxiety');
- preopMedsPage.fillDosage('Mild');
- preopMedsPage.fillFrequency('1 to 2 times a day');
- preopMedsPage.setTimeGiven();
- });
- it('should fill Med sh', function () {
- preopSummaryPage.openPreopSubtabTakeCase('Med Hx');
- commonHelper.waitUntilElementVisible(preopMedHxPage.txtNotes());
- preopMedHxPage.clickCheckbox('Essential Hypertension');
- });
- it('should fill Day of Sx', function () {
- preopSummaryPage.openPreopSubtabTakeCase('Day of Sx');
- preopDayOfSxPage.clickCheckbox('NPO solids greater than 8 hours');
- });
- it('should fill Labs', function () {
- preopSummaryPage.openPreopSubtabTakeCase('Labs');
- preopLabsPage.clickCheckbox('Reviewed')
- });
- it('should open right screen menu', function () {
- patientPage.clickRightScreenMenu();
- });
- it('should open templates page', function () {
- patientPage.clickTemplate();
- commonHelper.waitUntilElementVisible(templatesPage.btnSearchPublicTemplates)
- });
- it('should add public templates', function () {
- templatesPage.clickPublicTemplates();
- templatesPage.clickTableTemplates('Total Knee demo');
- commonHelper.waitUntilElementVisible(templatesPage.btnApply);
- templatesPage.clickApply();
- templatesPage.clickYes();
- });
- it('should see patient page', function () {
- commonHelper.waitUntilElementVisible(patientPage.btnAnesEnd)
- });
- it('should click finalize and see number of errors', function () {
- patientPage.clickFinalize();
- expect(patientPage.getNumberOfWarning()).toContain('15');
- expect(patientPage.eleFinalizeWarning.count()).toEqual(15);
- expect(patientPage.getNumberOfWarningPatient()).toContain('3');
- expect(patientPage.getNumberOfWarningProviders()).toContain('1');
- expect(patientPage.getNumberOfWarningPreop()).toContain('1');
- patientPage.clickFinalize();
- });
- it('should fill new patient required fields',function () {
- patientPage.clickPatient();
- patientPage.fillDOB(dob);
- patientPage.fillDiagnosis(diagnosis);
- patientPage.fillProcedure(procedure);
- patientPage.setAnesEnd();
- patientPage.setPhysicalStatus(physicalStatus);
- patientPage.clickProviders();
- providersPage.fillSurgeon(surgeon);
- patientPage.clickRegional();
- regionalPage.clickAddSignatureRegoinal();
- regionalPage.clickCheckbox('Sterile Techniques Followed');
- regionalPage.clickCheckbox('RN/Licensed');
- patientPage.clickPreop();
- preopSummaryPage.clickAddPreopSignature();
- patientPage.clickChecklist();
- commonHelper.waitUntilElementVisible(checklistPage.getCheckbox('Pre-Procedure', 'Patient Re-Evaluated Prior to Induction'));
- checklistPage.clickCheckbox('Anesthesia Techniques', 'General');
- checklistPage.clickCheckbox('Anesthesia Techniques', 'GA-TIVA');
- checklistPage.clickCheckbox('Anesthesia Techniques', 'Inhalation');
- patientPage.clickEmergence();
- emergencePage.clickAddIntraopSignature();
- patientPage.clickPqrs();
- emergencePage.selectTemperature('Not Applicable');
- emergencePage.selectPacu('PACU handover checklist used');
- emergencePage.selectIcu('ICU Handover Checklist Used');
- emergencePage.selectEvent('Not Applicable');
- }, 60000);
- it('should click finalize', function () {
- patientPage.clickFinalize();
- });
- it('should see green checkbox', function () {
- commonHelper.waitUntilElementVisible(patientPage.chkGreen);
- });
- it('should click link to finalize', function () {
- patientPage.clickLinkToFinalize();
- commonHelper.waitUntilElementVisible(patientPage.elePdfViewer);
- });
- it('should click back button', function () {
- patientPage.clickBack();
- });
- it('should show patient list page', function () {
- commonHelper.waitUntilElementVisible(patientListPage.btnAddNewPatient);
- });
- it('should open completed case in accordion', function () {
- commonHelper.waitUntilElementVisible(patientListPage.completedPatientCase(fullName));
- });
- it('should see patient card', function () {
- expect(patientListPage.patientInfo(fullName)).toContain('MRN: ' + mrn);
- expect(patientListPage.patientInfo(fullName)).toContain('DOB: 11/25/1980');
- expect(patientListPage.patientInfo(fullName)).toContain(or);
- expect(patientListPage.patientInfo(fullName)).toContain('Surgeon: ' + surgeon);
- expect(patientListPage.patientInfo(fullName)).toContain('Anesthesiologist: ' + userName);
- });
- });
- describe('checking for take case functional - existing case', function () {
- beforeAll(function () {
- browser.get(signInData.link);
- });
- afterAll(function () {
- commonHelper.clearAllData();
- });
- it('should login as existing user',function () {
- signInPage.login(username, password);
- });
- it('should open new patient page',function () {
- patientListPage.clickAddNewPatient();
- commonHelper.waitUntilElementVisible(patientPage.btnSavePatient);
- });
- it('should fill new patient required fields',function () {
- patientPage.fillMrn(mrn);
- patientPage.fillFirstName(firstName);
- patientPage.fillLastName(lastName);
- patientPage.selectOr(or);
- patientPage.clickSavePatient();
- patientPage.setAnesStart();
- }, 20000);
- it('should click back button', function () {
- patientPage.clickBack();
- });
- it('should show patient list page', function () {
- commonHelper.waitUntilElementVisible(patientListPage.btnAddNewPatient);
- });
- it('should open existing case', function () {
- patientListPage.clickTakeCase();
- });
- it('should open preops', function () {
- patientPage.clickPreop();
- preopSummaryPage.clickAddSignature();
- });
- it('should fill Allergy tab', function () {
- preopSummaryPage.openPreopSubtabTakeCase('Allergy');
- commonHelper.waitUntilElementVisible(preopAllergyPage.parentSection);
- preopAllergyPage.fillAllergen('A-25');
- preopAllergyPage.fillReaction('Anxiety');
- preopAllergyPage.fillSeverity('Mild');
- });
- it('should fill meds tab', function () {
- preopSummaryPage.openPreopSubtabTakeCase('Meds');
- commonHelper.waitUntilElementVisible(preopMedsPage.eleInpatientMedicament());
- preopMedsPage.fillMedication('A-25');
- preopMedsPage.fillRoute('Anxiety');
- preopMedsPage.fillDosage('Mild');
- preopMedsPage.fillFrequency('1 to 2 times a day');
- preopMedsPage.setTimeGiven();
- });
- it('should fill Med sh', function () {
- preopSummaryPage.openPreopSubtabTakeCase('Med Hx');
- commonHelper.waitUntilElementVisible(preopMedHxPage.txtNotes());
- preopMedHxPage.clickCheckbox('Essential Hypertension');
- });
- it('should fill Day of Sx', function () {
- preopSummaryPage.openPreopSubtabTakeCase('Day of Sx');
- preopDayOfSxPage.clickCheckbox('NPO solids greater than 8 hours');
- });
- it('should fill Labs', function () {
- preopSummaryPage.openPreopSubtabTakeCase('Labs');
- preopLabsPage.clickCheckbox('Reviewed')
- });
- it('should open right screen menu', function () {
- patientPage.clickRightScreenMenu();
- });
- it('should open templates page', function () {
- patientPage.clickTemplate();
- commonHelper.waitUntilElementVisible(templatesPage.btnSearchPublicTemplates)
- });
- it('should add public templates', function () {
- templatesPage.clickPublicTemplates();
- templatesPage.clickTableTemplates('Total Knee demo');
- commonHelper.waitUntilElementVisible(templatesPage.btnApply);
- templatesPage.clickApply();
- templatesPage.clickYes();
- });
- it('should see patient page', function () {
- commonHelper.waitUntilElementVisible(patientPage.btnAnesEnd)
- });
- it('should click finalize and see number of errors', function () {
- patientPage.clickFinalize();
- expect(patientPage.getNumberOfWarning()).toContain('15');
- expect(patientPage.eleFinalizeWarning.count()).toEqual(15);
- expect(patientPage.getNumberOfWarningPatient()).toContain('3');
- expect(patientPage.getNumberOfWarningProviders()).toContain('1');
- expect(patientPage.getNumberOfWarningPreop()).toContain('1');
- patientPage.clickFinalize();
- });
- it('should fill new patient required fields',function () {
- patientPage.clickPatient();
- patientPage.fillDOB(dob);
- patientPage.fillDiagnosis(diagnosis);
- patientPage.fillProcedure(procedure);
- patientPage.setAnesEnd();
- patientPage.setPhysicalStatus(physicalStatus);
- patientPage.clickProviders();
- providersPage.fillSurgeon(surgeon);
- patientPage.clickRegional();
- regionalPage.clickAddSignatureRegoinal();
- regionalPage.clickCheckbox('Sterile Techniques Followed');
- regionalPage.clickCheckbox('RN/Licensed');
- patientPage.clickPreop();
- preopSummaryPage.clickAddPreopSignature();
- patientPage.clickChecklist();
- commonHelper.waitUntilElementVisible(checklistPage.getCheckbox('Pre-Procedure', 'Patient Re-Evaluated Prior to Induction'));
- checklistPage.clickCheckbox('Anesthesia Techniques', 'General');
- checklistPage.clickCheckbox('Anesthesia Techniques', 'GA-TIVA');
- checklistPage.clickCheckbox('Anesthesia Techniques', 'Inhalation');
- patientPage.clickEmergence();
- emergencePage.clickAddIntraopSignature();
- patientPage.clickPqrs();
- emergencePage.selectTemperature('Not Applicable');
- emergencePage.selectPacu('PACU handover checklist used');
- emergencePage.selectIcu('ICU Handover Checklist Used');
- emergencePage.selectEvent('Not Applicable');
- }, 60000);
- it('should click finalize', function () {
- patientPage.clickFinalize();
- });
- it('should see green checkbox', function () {
- commonHelper.waitUntilElementVisible(patientPage.chkGreen);
- });
- it('should click link to finalize', function () {
- patientPage.clickLinkToFinalize();
- commonHelper.waitUntilElementVisible(patientPage.elePdfViewer);
- });
- it('should click back button', function () {
- patientPage.clickBack();
- });
- it('should show patient list page', function () {
- commonHelper.waitUntilElementVisible(patientListPage.btnAddNewPatient);
- });
- it('should open completed case in accordion', function () {
- commonHelper.waitUntilElementVisible(patientListPage.completedPatientCase(fullName));
- });
- it('should see patient card', function () {
- expect(patientListPage.patientInfo(fullName)).toContain('MRN: ' + mrn);
- expect(patientListPage.patientInfo(fullName)).toContain('DOB: 11/25/1980');
- expect(patientListPage.patientInfo(fullName)).toContain(or);
- expect(patientListPage.patientInfo(fullName)).toContain('Surgeon: ' + surgeon);
- expect(patientListPage.patientInfo(fullName)).toContain('Anesthesiologist: ' + userName);
- });
- });
- });
- -------------------------------------------------------------------
- meds.po
- var commonHelper = require('./../../../helpers/common.helper.js');
- var PreopMedsPage = function () {
- //--------------------------------------------------------------------------
- // Elements
- //-------------------------------------------------------------------------
- this.btnSet = $('.dwb0');
- this.eleDatePopup = $('[role="dialog"]');
- //--------------------------------------------------------------------------
- // Functions
- //--------------------------------------------------------------------------
- this.eleInpatientMedicament = function () {
- return $('[class="panel panel-primary"]:nth-of-type(1)')
- };
- this.eleFirstResult = function (value) {
- element(by.cssContainingText('[ng-bind-html="item.text | highlight: $select.search"]', value)).click();
- };
- this.fillMedication = function (value) {
- this.eleInpatientMedicament().$('[placeholder="Medication"][ng-value="selectedItem.selected.text"]').click();
- this.eleInpatientMedicament().$('[ng-model="$select.search"][placeholder="Medication"]').sendKeys(value);
- this.eleFirstResult(value);
- };
- this.fillRoute = function (value) {
- this.eleInpatientMedicament().$('[placeholder="Route"][ng-value="selectedItem.selected.text"]').click();
- this.eleInpatientMedicament().$('[ng-model="$select.search"][placeholder="Route"]').sendKeys(value);
- this.eleFirstResult(value);
- };
- this.fillDosage = function (value) {
- this.eleInpatientMedicament().$('[placeholder="Dosage"][ng-value="selectedItem.selected.text"]').click();
- this.eleInpatientMedicament().$('[ng-model="$select.search"][placeholder="Dosage"]').sendKeys(value);
- this.eleFirstResult(value);
- };
- this.fillFrequency = function (value) {
- this.eleInpatientMedicament().$('input[placeholder="Frequency"]').click();
- this.eleFirstResult(value);
- };
- this.setTimeGiven = function () {
- browser.executeScript('document.getElementsByClassName("dwo")[0].style.display = "none"');
- browser.executeScript('document.getElementsByClassName("dw-persp")[0].style.display = "none"');
- browser.executeScript('document.getElementsByClassName("col-xs-2 col-md-2")[0].style.display = "none"');
- element(by.id('newInpatientMedTimeGiven')).click();
- this.clickSet();
- commonHelper.waitUntilElementInvisible(this.eleDatePopup);
- };
- this.clickSet = function() {
- commonHelper.waitUntilElementVisible(this.btnSet);
- this.btnSet.click();
- browser.sleep(500);
- };
- };
- module.exports = PreopMedsPage;
- ----------------------------------------------------------------------
- templates.po
- var commonHelper = require('./../../helpers/common.helper.js');
- var TemplatesPage = function () {
- //--------------------------------------------------------------------------
- // Elements
- //--------------------------------------------------------------------------
- this.btnSearchPublicTemplates = $('[ng-click="searchPublicClick()"]');
- this.btnApply = $('[ng-click="callConfirm(\'Apply\', modalSelectTemplate)"]');
- this.btnYes = $('[ng-click="confirmYesCallback()"]')
- //--------------------------------------------------------------------------
- // Functions
- //--------------------------------------------------------------------------
- this.clickPublicTemplates = function () {
- this.btnSearchPublicTemplates.click();
- };
- this.eleTableTemplates = function () {
- return element(by.repeater('t in publicTemplateList | filter: { UserID: \'!\' + p.Data.MyUser.UserID, Name: searchPublic } | orderBy: \'Name\''))
- };
- this.clickTableTemplates = function (name) {
- element(by.cssContainingText('label', name)).click();
- };
- this.clickApply = function () {
- this.btnApply.click();
- };
- this.clickYes = function () {
- this.btnYes.click();
- };
- };
- module.exports = TemplatesPage;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement