Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- viev_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 preopPage = pageObject.getPreopPage();
- var checklistPage = pageObject.getChecklistPage();
- 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('View 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 or = patientData.patient.or;
- var dob = patientData.patient.dob;
- var facility = patientData.patient.facility;
- var accountNumber = patientData.patient.accountNumber;
- 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 view 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 see correct facility',function () {
- expect(patientListPage.facilityName(facility).isPresent()).toBeTruthy();
- });
- 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.fillAccountNumber(accountNumber);
- patientPage.fillFirstName(firstName);
- patientPage.fillLastName(lastName);
- patientPage.selectOr(or);
- patientPage.selectScheduledStart();
- patientPage.selectEncounterType('Office Based');
- });
- it('should see correct facility',function () {
- expect(patientPage.selectedFacility()).toEqual(facility);
- });
- it('should save patient',function () {
- patientPage.clickSavePatient();
- commonHelper.waitUntilElementVisible(patientPage.btnFinalize);
- });
- it('should show correct quick info',function () {
- expect(patientPage.fullNameQuickInfo()).toEqual(firstName + ' ' + lastName);
- expect(patientPage.mrnQuickInfo()).toContain(mrn);
- });
- 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 preop page', function () {
- patientPage.clickPreop();
- expect(preopPage.btnAddSignature.isDisplayed()).toBeTruthy();
- });
- it('should add md signature', function () {
- preopPage.clickAddSignature();
- expect(preopPage.getMDSignature()).toContain(mdSignature)
- });
- it('should redirect on checklist page', function () {
- var checkboxLabel = 'Patient Re-Evaluated Prior to Induction';
- patientPage.clickChecklist();
- commonHelper.waitUntilElementVisible(checklistPage.getCheckboxPreProcedure(checkboxLabel));
- expect(checklistPage.getCheckboxPreProcedure(checkboxLabel).isDisplayed()).toBeTruthy();
- });
- it('should check checkboxes', function () {
- checklistPage.clickCheckboxPreProcedure('Patient Re-Evaluated Prior to Induction');
- checklistPage.clickCheckboxAnesthesia('General');
- checklistPage.clickCheckboxAnesthesia('GA-TIVA');
- checklistPage.clickCheckboxAnesthesia('Inhalation');
- });
- it('should open emergence page', function () {
- patientPage.clickEmergence();
- expect(emergencePage.btnAddIntraopSignature.isDisplayed()).toBeTruthy();
- });
- it('should add intraop signature', function () {
- emergencePage.clickAddIntraopSignature();
- });
- it('should open pqrs', function () {
- patientPage.clickPqrs();
- commonHelper.waitUntilElementVisible(emergencePage.selPqrsDescription(1));
- });
- it('should add pqrs', function () {
- emergencePage.selectTemperature('Not Applicable');
- emergencePage.selectPacu('PACU handover checklist used');
- emergencePage.selectIcu('ICU Handover Checklist Used');
- emergencePage.selectEvent('Not Applicable');
- });
- it('should click finalize', function () {
- commonHelper.waitUntilElementVisible(patientPage.btnFinalize)
- 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 complited case', function () {
- patientListPage.clickComplitedCases();
- expect(patientListPage.getComplitedCasesCard(firstName + ' ' + lastName).isDisplayed()).toBeTruthy()
- });
- it('should see patient card', function () {
- expect(patientListPage.getPatientInfo(firstName).isDisplayed()).toBeTruthy();
- expect(patientListPage.getPatientInfo(lastName).isDisplayed()).toBeTruthy();
- expect(patientListPage.getPatientInfo(mrn).isDisplayed()).toBeTruthy();
- expect(patientListPage.getPatientInfo(or).isDisplayed()).toBeTruthy();
- });
- it('should click on view case', function () {
- patientListPage.clickViewCase();
- commonHelper.waitUntilElementVisible(patientPage.btnUnlock)
- });
- });
- });
- ------------------------------------------------------------
- patient.po
- this.btnUnlock = $('[ng-show="canUnlock()"]')
- ---------------------------------------------------------------------
- patient_list.po
- var commonHelper = require('./../../helpers/common.helper.js');
- var PatientListPage = function () {
- //--------------------------------------------------------------------------
- // Elements
- //--------------------------------------------------------------------------
- this.btnAddNewPatient = element(by.id('add_new_patient'));
- this.btnComplitedCases = element(by.id('statusGroup3'));
- this.btnViewCase = element(by.id('enter_case'))
- //--------------------------------------------------------------------------
- // Functions
- //--------------------------------------------------------------------------
- this.clickViewCase = function () {
- this.btnViewCase.click();
- };
- this.clickComplitedCases = function () {
- this.btnComplitedCases.click();
- };
- this.clickAddNewPatient = function() {
- commonHelper.waitUntilElementVisible(this.btnAddNewPatient);
- this.btnAddNewPatient.click();
- };
- this.facilityName = function(value) {
- return element(by.cssContainingText('[ng-repeat="f in p.Data.Lookups.Facilities"]', value));
- };
- this.getComplitedCasesCard = function (name) {
- return element(by.cssContainingText('#CompletedCases', name))
- };
- this.getPatientInfo = function (value) {
- return element(by.cssContainingText('[class^="col-sm-6 ng-binding"]', value))
- }
- };
- module.exports = PatientListPage;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement