<commit_before>"use strict";

describe('Patient profile pages',function() {

  var addNewPatientButton, createProfileButton;

  var patientName,
      patientDOB,
      HospitalNumber,
      NHSNumber,
      patientHeight,
      PreOpWeight,
      BetaBlockers,
      Antibiotic,
      BloodTransfusion,
      Antihypertensive;


  describe('showing patient profile pages',function() {

    beforeEach(function() {
      browser.get('/#/side-menu21/patientProfiles');
      addNewPatientButton = element(by.linkText('Add New Patient'));
    });

    it('should show patient profiles on page',function() {
      expect(element.all(by.repeater('patient in patients')).count()).toEqual(2);
    });

    it('it should show the add patient, new patient page when add patient button pressed',function() {
      addNewPatientButton.click().then(function() {
        expect(browser.getLocationAbsUrl()).toMatch('/side-menu21/addPatient');
      });
    });
  });

  // describe('add Patient page',function() {

  //   beforeEach(function() {
  //     browser.get('/#/side-menu21/addPatient');

  //     patientName = element(by.model('patient.patientName'));
  //     patientDOB = element(by.model('patient.patientDOB'));
  //     HospitalNumber = element(by.model('patient.HospitalNumber'));
  //     NHSNumber = element(by.model('patient.NHSNumber'));
  //     patientHeight = element(by.model('patient.patientHeight'));
  //     PreOpWeight = element(by.model('patient.PreOpWeight'));
  //     BetaBlockers = element(by.model('patient.BetaBlockers'));
  //     Antibiotic = element(by.model('patient.Antibiotic'));
  //     BloodTransfusion = element(by.model('patient.BloodTransfusion'));
  //     Antihypertensive = element(by.model('patient.Antihypertensive'));

  //     createProfileButton = element(by.css('.button.button-assertive.button-block.icon.ion-ios-person'));
  //   });

  //   it('should add a patient profile',function() {

  //     patientName.sendKeys('<NAME>');
  //     patientDOB.sendKeys('19950319');
  //     HospitalNumber.sendKeys('H0923477');
  //     NHSNumber.sendKeys('<KEY>');
  //     patientHeight.sendKeys('180');
  //     PreOpWeight.sendKeys('85');

  //     // Example of checked
  //     // <label>Check me to check both: <input type="checkbox" ng-model="master"></label><br/>
  //     // <input id="checkSlave" type="checkbox" ng-checked="master" aria-label="Slave input">

  //     // it('should check both checkBoxes', function() {
  //     //   expect(element(by.id('checkSlave')).getAttribute('checked')).toBeFalsy();
  //     //   element(by.model('master')).click();
  //     //   expect(element(by.id('checkSlave')).getAttribute('checked')).toBeTruthy();
  //     // });

  //     //From Patient Form rendered
  //     //<input type="checkbox" ng-checked="true" checked="checked">

  //     element(by.model('BetaBlockers')).click();
  //     element(by.model('Antibiotic')).click();
  //     element(by.model('BloodTransfusion')).click();
  //     element(by.model('Antihypertensive')).click();

  //     createProfileButton.click().then(function() {
  //       expect(browser.getLocationAbsUrl()).toMatch('/side-menu21/patientProfiles');
  //       expect(element.all(by.repeater('patient in patients')).count()).toEqual(3);
  //     });
  //   });

  //   it('should show pop up if all fields not filled in',function() {
  //     patientName.sendKeys('');
  //     patientDOB.sendKeys('');
  //     HospitalNumber.sendKeys('');
  //     NHSNumber.sendKeys('');
  //     patientHeight.sendKeys('');
  //     PreOpWeight.sendKeys('');
  //     createProfileButton.click().then(function() {
  //       expect(browser.getLocationAbsUrl()).toMatch('/side-menu21/addPatient');
  //       var popup = element(by.css('.popup-container.popup-showing.active'));
  //       expect(popup.isDisplayed()).toBeTruthy();
  //     });
  //   });
  // });
});<commit_msg>close #36<commit_after>"use strict";

describe('Patient profile pages',function() {

  var addNewPatientButton, createProfileButton;

  var patientName,
      patientDOB,
      HospitalNumber,
      NHSNumber,
      patientHeight,
      PreOpWeight,
      BetaBlockers,
      Antibiotic,
      BloodTransfusion,
      Antihypertensive;


  describe('showing patient profile pages',function() {

    beforeEach(function() {
      browser.get('/#/side-menu21/patientProfiles');
      addNewPatientButton = element(by.linkText('Add New Patient'));
    });

    it('should show patient profiles on page',function() {
      expect(element.all(by.repeater('patient in patients')).count()).toEqual(2);
    });

    it('it should show the add patient, new patient page when add patient button pressed',function() {
      addNewPatientButton.click().then(function() {
        expect(browser.getLocationAbsUrl()).toMatch('/side-menu21/addPatient');
      });
    });
  });

  describe('add Patient page',function() {

  //   beforeEach(function() {
  //     browser.get('/#/side-menu21/addPatient');

  //     patientName = element(by.model('patient.patientName'));
  //     patientDOB = element(by.model('patient.patientDOB'));
  //     HospitalNumber = element(by.model('patient.HospitalNumber'));
  //     NHSNumber = element(by.model('patient.NHSNumber'));
  //     patientHeight = element(by.model('patient.patientHeight'));
  //     PreOpWeight = element(by.model('patient.PreOpWeight'));
  //     BetaBlockers = element(by.model('patient.BetaBlockers'));
  //     Antibiotic = element(by.model('patient.Antibiotic'));
  //     BloodTransfusion = element(by.model('patient.BloodTransfusion'));
  //     Antihypertensive = element(by.model('patient.Antihypertensive'));

  //     createProfileButton = element(by.css('.button.button-assertive.button-block.icon.ion-ios-person'));
  //   });

  //   it('should add a patient profile',function() {

  //     patientName.sendKeys('<NAME>');
  //     patientDOB.sendKeys('19950319');
  //     HospitalNumber.sendKeys('H0923477');
  //     NHSNumber.sendKeys('<KEY>');
  //     patientHeight.sendKeys('180');
  //     PreOpWeight.sendKeys('85');

  //     // Example of checked
  //     // <label>Check me to check both: <input type="checkbox" ng-model="master"></label><br/>
  //     // <input id="checkSlave" type="checkbox" ng-checked="master" aria-label="Slave input">

  //     // it('should check both checkBoxes', function() {
  //     //   expect(element(by.id('checkSlave')).getAttribute('checked')).toBeFalsy();
  //     //   element(by.model('master')).click();
  //     //   expect(element(by.id('checkSlave')).getAttribute('checked')).toBeTruthy();
  //     // });

  //     //From Patient Form rendered
  //     //<input type="checkbox" ng-checked="true" checked="checked">

  //     element(by.model('BetaBlockers')).click();
  //     element(by.model('Antibiotic')).click();
  //     element(by.model('BloodTransfusion')).click();
  //     element(by.model('Antihypertensive')).click();

  //     createProfileButton.click().then(function() {
  //       expect(browser.getLocationAbsUrl()).toMatch('/side-menu21/patientProfiles');
  //       expect(element.all(by.repeater('patient in patients')).count()).toEqual(3);
  //     });
  //   });

  //   it('should show pop up if all fields not filled in',function() {
  //     patientName.sendKeys('');
  //     patientDOB.sendKeys('');
  //     HospitalNumber.sendKeys('');
  //     NHSNumber.sendKeys('');
  //     patientHeight.sendKeys('');
  //     PreOpWeight.sendKeys('');
  //     createProfileButton.click().then(function() {
  //       expect(browser.getLocationAbsUrl()).toMatch('/side-menu21/addPatient');
  //       var popup = element(by.css('.popup-container.popup-showing.active'));
  //       expect(popup.isDisplayed()).toBeTruthy();
  //     });
  //   });
  });
});
{'fraction_non_alphanumeric': 0.18892884664782944, 'fraction_numerical': 0.008476753146673517, 'mean_word_length': 3.026370217166494, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6704936', 'n_tokens_mistral': 2436, 'n_tokens_neox': 2340, 'n_words': 313}