Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- patinent.po
- this.btnSet = $('.dwb0');
- this.txtDiagnosis = $('#diagnosis-new [class^="ui-input"]')
- this.selectDiagnosis = $('#diagnosis-new input[aria-owns="ui-select-choices-3"]');
- 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 = element(by.cssContainingText('span', 'Time-Out'));
- this.btnIncision = element(by.cssContainingText('span', 'Incision'));
- this.btnSurgeryEnd = element(by.cssContainingText('span', 'Surgery End'));
- this.btnAnesEnd = element(by.cssContainingText('span', 'Anes End'));
- this.btnAnesStart = element(by.cssContainingText('span', 'Anes Start'));
- this.eleDatePopup = $('[role="dialog"]')
- this.setTimeOut = function () {
- this.btnTimeOut.click();
- this.btnSet.click();
- commonHelper.waitUntilElementInvisible(this.eleDatePopup);
- };
- this.setIncision = function () {
- this.btnIncision.click();
- this.btnSet.click();
- commonHelper.waitUntilElementInvisible(this.eleDatePopup);
- };
- this.setSurgeryEnd = function () {
- this.btnSurgeryEnd.click();
- this.btnSet.click();
- commonHelper.waitUntilElementInvisible(this.eleDatePopup);
- };
- this.setAnesEnd = function () {
- this.btnAnesEnd.click();
- this.btnSet.click();
- commonHelper.waitUntilElementInvisible(this.eleDatePopup);
- };
- this.setAnesStart = function () {
- this.btnAnesStart.click();
- browser.sleep(2000)
- this.btnSet.click();
- commonHelper.waitUntilElementInvisible(this.eleDatePopup);
- };
- this.setPhysicalStatus = function (value) {
- this.btnPhysicalStatus.click();
- element(by.css('[data-val="' + value + '"]')).click();
- this.btnSet.click();
- commonHelper.waitUntilElementInvisible(this.eleDatePopup);
- };
- this.fillDOB = function (date) {
- browser.executeScript('$("#DOB").prop("value", "'+ date +'")');
- browser.executeScript('$("#DOB").trigger("change")');
- element(by.id('DOB')).click();
- commonHelper.waitUntilElementVisible(this.btnSet);
- this.btnSet.click();
- };
- this.fillDiagnosis = function (value) {
- this.txtDiagnosis.click();
- this.selectDiagnosis.sendKeys(value);
- $('[class^="ui-select-highlight"]').click();
- commonHelper.waitUntilElementPresent(this.btnDeleteDiagnosis)
- };
- this.fillProcedure = function (value) {
- this.txtProcedure.click();
- this.selectProcedure.sendKeys(value);
- $('[class^="ui-select-highlight"]').click();
- commonHelper.waitUntilElementPresent(this.btnDeleteProcedure)
- };
- -----------------------------------------------------------------------
- smoce_tests.spec
- var pageObject = require('./../../po/pages').container.PageObject;
- var signInPage = pageObject.getSignInPage();
- var patientListPage = pageObject.getPatientListPage();
- var patientPage = pageObject.getPatientPage();
- 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;
- 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()).toEqual('16');
- expect(patientPage.eleFinalizeWarning.count()).toEqual(16);
- expect(patientPage.getNumberOfWarningPatient()).toEqual('3');
- expect(patientPage.getNumberOfWarningProviders()).toEqual('2');
- expect(patientPage.getNumberOfWarningPreop()).toEqual('2');
- expect(patientPage.getNumberOfWarningChecklist()).toEqual('2');
- expect(patientPage.getNumberOfWarningEmergence()).toEqual('1');
- expect(patientPage.getNumberOfWarningPqrs()).toEqual('4');
- patientPage.clickFinalize();
- });
- it('should fill DOB', function () {
- patientPage.fillDOB('November 25, 1980');
- //expect(patientPage.getNumberOfWarningPatient()).toEqual('2');
- });
- it('should fill diagnosis', function () {
- patientPage.fillDiagnosis('Eumycetoma');
- expect(patientPage.btnDeleteDiagnosis.isDisplayed()).toBeTruthy();
- //expect(patientPage.getNumberOfWarningPatient()).toEqual('1');
- });
- it('should fill procedure', function () {
- patientPage.fillProcedure('Gold');
- expect(patientPage.btnDeleteProcedure.isDisplayed()).toBeTruthy();
- });
- it('should set date', function () {
- patientPage.setPhysicalStatus('ASA 1');
- patientPage.setAnesStart();
- patientPage.setTimeOut();
- patientPage.setIncision();
- patientPage.setSurgeryEnd();
- patientPage.setAnesEnd();
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement