Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- checklist.po
- var commonHelper = require('./../../helpers/common.helper.js');
- var ChecklistPage = function () {
- //--------------------------------------------------------------------------
- // Elements
- //--------------------------------------------------------------------------
- //--------------------------------------------------------------------------
- // Functions
- //--------------------------------------------------------------------------
- this.clickCheckbox = function (value) {
- element(by.cssContainingText('span', value)).click()
- };
- this.getCheckbox = function (value) {
- return element(by.cssContainingText('span', value))
- }
- };
- module.exports = ChecklistPage;
- -----------------------------------------------------------------------
- data/patient/index
- module.exports = {
- link: browser.baseUrl + '/app/#/patient/',
- patient: {
- firstName: 'John',
- lastName: 'Woods',
- mrn: '000739493',
- or: 'OR2',
- dob: 'November 25, 1980',
- physicalStatus: 'ASA 1',
- diagnosis: 'Eumycetoma',
- icd: 'B470',
- procedure: 'Glossectomy',
- cpt: '41120',
- surgeon: 'Alex Cobb',
- mdSignature: 'Pranvera E2E',
- }
- };
- -------------------------------------------------------------
- pages.js
- 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();
- },
- getPreopPage: function () {
- var preopPage = require('./patient/preop.po.js');
- return new preopPage();
- },
- getChecklistPage: function () {
- var checklistPage = require('./patient/checklist.po.js');
- return new checklistPage();
- }
- }
- });
- module.exports = bottlejs;
- ---------------------------------------------------
- patient.po
- 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'));
- //--------------------------------------------------------------------------
- // Functions
- //--------------------------------------------------------------------------
- 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.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();
- };
- --------------------------------------------------
- preop.po
- var commonHelper = require('./../../helpers/common.helper.js');
- var PreopPage = function () {
- //--------------------------------------------------------------------------
- // Elements
- //-------------------------------------------------------------------------
- this.eleMDSignature = $('[class^="mbsc-label"]');
- 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 () {
- this.btnAddPreopSignature.click();
- };
- this.getMDSignature = function () {
- return this.eleMDSignature.getText();
- };
- };
- module.exports = PreopPage;
- -----------------------------------------------------------
- providerss.po
- var commonHelper = require('./../../helpers/common.helper.js');
- var ProvidersPage = function () {
- //--------------------------------------------------------------------------
- // Elements
- //--------------------------------------------------------------------------
- this.btnAddSurgeon = $('[ng-click="btnAddNewSurgeonClick()"]');
- this.txtSurgeon = $('[value="Choose a surgeon"]');
- this.selectSurgeon = $('#newSurgeon input[aria-label="Select box"]');
- this.selectResult = $$('[ng-bind="item.text"]').first();
- this.btnDeleteSurgeon = $('[ng-click="btnDeletePersonnel_click(\'Surgeon\', s)"]');
- //--------------------------------------------------------------------------
- // Functions
- //--------------------------------------------------------------------------
- this.clickAddSurgeon = function () {
- this.btnAddSurgeon.click();
- };
- this.fillSurgeon = function (value) {
- this.txtSurgeon.click();
- this.selectSurgeon.sendKeys(value);
- this.selectResult.click();
- commonHelper.waitUntilElementPresent(this.btnDeleteSurgeon)
- };
- };
- module.exports = ProvidersPage;
- -------------------------------------------------------
- smoke_tests.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 preopPage = pageObject.getPreopPage();
- var checklistPage = pageObject.getChecklistPage();
- var signInData = require('./../../data/sign_in/index');
- var patientData = require('./../../data/patient/index');
- var commonHelper = require('./../../helpers/common.helper.js');
- describe('Smoke Tests', 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 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 mdSignature = patientData.patient.mdSignature;
- describe('checking for basic workflow', 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 not show additional patient menu elements',function () {
- expect(patientPage.eleProvidersMenuItem.isPresent()).toBeFalsy();
- expect(patientPage.eleConsentFormMenuItem.isPresent()).toBeFalsy();
- expect(patientPage.eleChecklistMenuItem.isPresent()).toBeFalsy();
- expect(patientPage.eleRegionalMenuItem.isPresent()).toBeFalsy();
- expect(patientPage.eleChartMenuItem.isPresent()).toBeFalsy();
- expect(patientPage.eleEmergenceMenuItem.isPresent()).toBeFalsy();
- expect(patientPage.eleNotesMenuItem.isPresent()).toBeFalsy();
- expect(patientPage.eleLabsMenuItem.isPresent()).toBeFalsy();
- expect(patientPage.eleSignaturesMenuItem.isPresent()).toBeFalsy();
- expect(patientPage.elePqrsMenuItem.isPresent()).toBeFalsy();
- expect(patientPage.elePostopMenuItem.isPresent()).toBeFalsy();
- expect(patientPage.elePostopOrdersMenuItem.isPresent()).toBeFalsy();
- });
- it('should fill new patient required fields',function () {
- patientPage.fillMrn(mrn);
- patientPage.fillFirstName(firstName);
- patientPage.fillLastName(lastName);
- patientPage.selectOr(or);
- });
- it('should save patient',function () {
- patientPage.clickSavePatient();
- commonHelper.waitUntilElementVisible(patientPage.btnFinalize);
- });
- it('should show additional patient menu elements',function () {
- expect(patientPage.btnFinalize.isPresent()).toBeTruthy();
- expect(patientPage.eleProvidersMenuItem.isPresent()).toBeTruthy();
- expect(patientPage.eleConsentFormMenuItem.isPresent()).toBeTruthy();
- expect(patientPage.eleChecklistMenuItem.isPresent()).toBeTruthy();
- expect(patientPage.eleRegionalMenuItem.isPresent()).toBeTruthy();
- expect(patientPage.eleChartMenuItem.isPresent()).toBeTruthy();
- expect(patientPage.eleEmergenceMenuItem.isPresent()).toBeTruthy();
- expect(patientPage.eleNotesMenuItem.isPresent()).toBeTruthy();
- expect(patientPage.eleLabsMenuItem.isPresent()).toBeTruthy();
- expect(patientPage.eleSignaturesMenuItem.isPresent()).toBeTruthy();
- expect(patientPage.elePqrsMenuItem.isPresent()).toBeTruthy();
- expect(patientPage.elePostopMenuItem.isPresent()).toBeTruthy();
- expect(patientPage.elePostopOrdersMenuItem.isPresent()).toBeTruthy();
- });
- it('should show correct quick info',function () {
- expect(patientPage.fullNameQuickInfo()).toEqual(firstName + ' ' + lastName);
- expect(patientPage.mrnQuickInfo()).toContain(mrn);
- });
- it('should click finalize and see number of errors', function () {
- patientPage.clickFinalize();
- expect(patientPage.getNumberOfWarning()).toContain('16');
- expect(patientPage.eleFinalizeWarning.count()).toEqual(16);
- expect(patientPage.getNumberOfWarningPatient()).toContain('3');
- expect(patientPage.getNumberOfWarningProviders()).toContain('2');
- expect(patientPage.getNumberOfWarningPreop()).toContain('2');
- expect(patientPage.getNumberOfWarningChecklist()).toContain('2');
- expect(patientPage.getNumberOfWarningEmergence()).toContain('1');
- expect(patientPage.getNumberOfWarningPqrs()).toContain('4');
- patientPage.clickFinalize();
- });
- it('should fill DOB', function () {
- patientPage.fillDOB(dob);
- });
- it('should fill diagnosis', function () {
- patientPage.fillDiagnosis(diagnosis);
- expect(patientPage.btnDeleteDiagnosis.isDisplayed()).toBeTruthy();
- });
- it('should fill procedure', function () {
- patientPage.fillProcedure(procedure);
- expect(patientPage.btnDeleteProcedure.isDisplayed()).toBeTruthy();
- });
- it('should set dates', function () {
- // patientPage.setAnesStart();
- patientPage.setTimeOut();
- patientPage.setIncision();
- patientPage.setSurgeryEnd();
- //patientPage.setAnesEnd();
- patientPage.setPhysicalStatus(physicalStatus);
- });
- it('should redirect on providers page', function () {
- patientPage.clickProviders();
- expect(providersPage.btnAddSurgeon.isDisplayed()).toBeTruthy();
- });
- it('should add surgeon', function () {
- providersPage.fillSurgeon(surgeon);
- expect(providersPage.btnDeleteSurgeon.isDisplayed()).toBeTruthy();
- });
- it('should redirect on providers page', function () {
- patientPage.clickPreop();
- expect(preopPage.btnAddSignature.isDisplayed()).toBeTruthy();
- });
- it('should add signature', function () {
- preopPage.clickAddSignature();
- commonHelper.waitUntilElementVisible(preopPage.btnSendPropPdf);
- expect(preopPage.getMDSignature()).toContain(mdSignature)
- });
- it('should add preop signature', function () {
- preopPage.clickAddPreopSignature();
- });
- it('should refirect on checklist page', function () {
- patientPage.clickChecklist();
- commonHelper.waitUntilElementVisible(checklistPage.getCheckbox('Patient Re-Evaluated Prior to Induction'));
- expect(checklistPage.getCheckbox('Patient Re-Evaluated Prior to Induction').isDisplayed()).toBeTruthy();
- });
- //
- // it('should fill checkboxes', function () {
- // checklistPage.clickCheckbox('Patient Re-Evaluated Prior to Induction');
- // checklistPage.clickCheckbox('Genera');
- // checklistPage.clickCheckbox('GA-TIVA');
- // checklistPage.clickCheckbox('Inhalation');
- // checklistPage.clickCheckbox('MAC');
- // checklistPage.clickCheckbox('Local');
- // checklistPage.clickCheckbox('Regional');
- // checklistPage.clickCheckbox('Spinal');
- // checklistPage.clickCheckbox('Epidural');
- // });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement