Skip to content

Commit

Permalink
Merge c564b31 into 3553cb4
Browse files Browse the repository at this point in the history
  • Loading branch information
sacuribraimo committed Jul 30, 2018
2 parents 3553cb4 + c564b31 commit a53e5f1
Show file tree
Hide file tree
Showing 12 changed files with 238 additions and 82 deletions.
6 changes: 3 additions & 3 deletions app/common/ui-helper/components/poc-wizard/pocWizard.html
Expand Up @@ -25,16 +25,16 @@ <h3 class="panel-title">{{ vm.getCurrentStep().title }}</h3>
</button>

<!-- Save button for when all is OK -->
<button type="button" class="btn btn-primary btn-lg" ng-show="vm.isLastStep() && vm.allStepsAreValid()" ng-click="vm.save();">
<button id="confirm" type="button" class="btn btn-primary btn-lg" ng-show="vm.isLastStep() && vm.allStepsAreValid()" ng-click="vm.save();">
<span class="glyphicon glyphicon-floppy-disk"></span>
<span class="button-label">{{'SAVE' | translate}}</span>
</button>

<!-- Save button for when there is a validation problem on one of the steps -->
<button type="button" class="btn btn-primary btn-lg" ng-show="vm.isLastStep() && !vm.allStepsAreValid()" poc-confirm-dialog="'{{ 'SOME_STEPS_HAVE_VALIDATION_PROBLEMS_CLICK_OK_TO_GO_TO_FIRST_INVALID_STEP' | translate}}'"
<button id="confirm" type="button" class="btn btn-primary btn-lg" ng-show="vm.isLastStep() && !vm.allStepsAreValid()" poc-confirm-dialog="'{{ 'SOME_STEPS_HAVE_VALIDATION_PROBLEMS_CLICK_OK_TO_GO_TO_FIRST_INVALID_STEP' | translate}}'"
on-confirm="vm.goToFirstInvalidStep()">
<span class="glyphicon glyphicon-floppy-disk"></span>
<span class="button-label">{{'SAVE' | translate}}</span>
</button>
</div>
</div>
</div>
6 changes: 3 additions & 3 deletions test/e2eTests/data.js
Expand Up @@ -153,9 +153,9 @@ module.exports = {
},
contacts: {
country: "Mocambique",
province: "Gaza",
district: "Chibuto",
administrativePost: "Chibuto Sede",
province: "Nampula",
district: "Erati",
administrativePost: "Alua",
locality: "Sede",
neighborhood: "Longuene",
cell: "A",
Expand Down
5 changes: 5 additions & 0 deletions test/e2eTests/pages/clinicDashboardPage.js
Expand Up @@ -15,7 +15,12 @@ class ClinicDashboardPage extends Page {
});

this.tabs = {
summary: 'a[ui-sref="dashboard.summary"]',
chart: 'a[ui-sref="dashboard.chart"]',
consultation: 'a[ui-sref="dashboard.consultation"]',
prescriptions: 'a[ui-sref="dashboard.prescriptions"]',
laboratory: 'a[ui-sref="dashboard.laboratory"]',
current: 'a[ui-sref="dashboard.current"]',
};
}

Expand Down
4 changes: 0 additions & 4 deletions test/e2eTests/pages/components/actionsComponent.js
Expand Up @@ -58,10 +58,6 @@ class ActionsComponent extends Component {

clickDeletePatientButton() {
this._clickButton('delete', this.actionButtons.deletePatient);
// const deletePatientModal = require('./../windows/deletePatientModal.js');
// deletePatientModal._init();
// deletePatientModal.hasPoppedUp();
// return deletePatientModal;
}

// Transfer Patient to the registration module
Expand Down
Expand Up @@ -65,7 +65,7 @@ class DeletePatientModalComponent extends Component {
const disabledEditButton = locate('button').withAttr({ id: 'edit_patient', disabled: 'disabled' });
const disabledDeleteButton = locate('button').withAttr({ id: 'delete_patient', disabled: 'disabled' });
this.I.waitForElement('#delete_patient', 10);
// this.I.seeElement(disabledEditButton); // There is a bug on the system... this should be disabled
// this.I.seeElement(disabledEditButton); // There is a bug on the system... this should be disabled. Issue #563 (github)
this.I.seeElement(disabledDeleteButton);
}

Expand Down
28 changes: 21 additions & 7 deletions test/e2eTests/pages/labDashboardPage.js
@@ -1,9 +1,23 @@
const Page = require('./page');

module.exports = new Page({
isLoaded: {
element: '[ng-app="lab"]',
urlPart: '/lab/#/dashboard',
},
components: ['actions'],
});
const LOG_TAG = '[LabDashboardPage]';

class LabDashboardPage extends Page {

constructor() {
super({
isLoaded: {
element: '[ng-app="lab"]',
urlPart: '/lab/#/dashboard',
},
components: ['tabs', 'actions'],
});

this.tabs = {
testorders: 'a[ui-sref="dashboard.testorders"]',
testrequest: 'a[ui-sref="dashboard.testrequest"]',
};
}
}

module.exports = new LabDashboardPage();
30 changes: 23 additions & 7 deletions test/e2eTests/pages/pharmacyDashboardPage.js
@@ -1,9 +1,25 @@
const Page = require('./page');

module.exports = new Page({
isLoaded: {
element: '[ng-app="pharmacy"]',
urlPart: '/pharmacy/#/dashboard',
},
components: ['patientSearch', 'checkIn', 'actions'],
});
const LOG_TAG = '[PharmacyDashboardPage]';

class PharmacyDashboardPage extends Page {

constructor() {
super({
isLoaded: {
element: '[ng-app="pharmacy"]',
urlPart: '/pharmacy/#/dashboard',
},
components: ['patientSearch', 'checkIn', 'tabs', 'actions'],
});

this.tabs = {
prescriptions: 'a[ui-sref="dashboard.prescriptions"]',
filaHistory: 'a[ui-sref="dashboard.filaHistory"]',
dispensationHistory: 'a[ui-sref="dashboard.dispensationHistory"]',
dispensation: 'a[ui-sref="dashboard.dispensation"]',
};
}
}

module.exports = new PharmacyDashboardPage();
25 changes: 18 additions & 7 deletions test/e2eTests/pages/registerPatientPage.js
Expand Up @@ -8,7 +8,7 @@ class RegisterPatientPage extends Page {
super({
isLoaded: {
element: '[id="status-buttons"]',
urlPart: 'registration/#/patient/new/identifier',
urlPart: 'registration/#/patient/new',
},
});

Expand Down Expand Up @@ -46,9 +46,9 @@ class RegisterPatientPage extends Page {
cell: { css: '#address3' },
street: { css: '#address1' },
provenience: 'select[id="d10628a7-ba75-4495-840b-bf6f1c44fd2d"]',
reference: { css: '#Ponto de Referência' },
phone1: { css: '#Numero de Telefone 1' },
phone2: { css: '#Numero de Telefone 2' },
reference: 'input[id="e944813c-11b1-49f3-b9a5-9fbbd10beec2"',
phone1: 'input[id="e2e3fd64-1d5f-11e0-b929-000c29ad1d07"',
phone2: 'input[id="e6c97a9d-a77b-401f-b06e-81900e21ed1d"',
hivTestDate: 'input[id="46e79fce-ba89-4ec9-8f31-2dfd9318d415"',
hivTestType: 'select[id="ce778a93-66f9-4607-9d80-8794ed127674"]',
hivTestResult: 'select[id="31cb61f4-3d81-403d-94e9-64cce17a2a00"',
Expand Down Expand Up @@ -99,9 +99,10 @@ class RegisterPatientPage extends Page {
this.I.fillField(this.fields.neighborhood, patient.contacts.neighborhood);
this.I.fillField(this.fields.locality, patient.contacts.locality);
this.I.fillField(this.fields.administrativePost, patient.contacts.administrativePost);
this.I.fillField(this.fields.district, patient.contacts.district);
this.I.fillField(this.fields.province, patient.contacts.province);
this.I.fillField(this.fields.country, patient.contacts.country);

this.I.say(`${LOG_TAG} Populate district, province and country based on the typed administrative Post`);
const typeaheadMatch = `a[title="${patient.contacts.administrativePost}"]`;
this.I.click(typeaheadMatch);
}

selectProvenience(patient) {
Expand All @@ -121,6 +122,16 @@ class RegisterPatientPage extends Page {
this.I.waitForInvisible('#overlay', seconds);
}

confirmPatientData(patient) {
this.I.see(patient.identifiers[0].identifier3);
this.I.see(patient.person.names[0].givenName);
this.I.see(patient.person.names[0].familyName);
this.I.see(patient.person.birthdate);
this.I.see(patient.contacts.district);
this.I.see(patient.contacts.province);
this.I.see(patient.contacts.country);
}

}

module.exports = new RegisterPatientPage();
3 changes: 3 additions & 0 deletions test/e2eTests/pages/registrationDashboardPage.js
Expand Up @@ -12,8 +12,11 @@ class RegistrationDashboardPage extends Page {
},
components: ['checkIn', 'tabs', 'actions', 'deletePatientModal'],
});

this.tabs = {
programs: 'a[ui-sref="dashboard.program"]',
visits: 'a[ui-sref="dashboard.visits"]',
services: 'a[ui-sref="dashboard.services"]',
};

this.programs = {
Expand Down
28 changes: 21 additions & 7 deletions test/e2eTests/pages/socialDashboardPage.js
@@ -1,9 +1,23 @@
const Page = require('./page');

module.exports = new Page({
isLoaded: {
element: '[ng-app="social"]',
urlPart: '/social/#/dashboard',
},
components: ['actions'],
});
const LOG_TAG = '[SocialDashboardPage]';

class SocialDashboardPage extends Page {

constructor() {
super({
isLoaded: {
element: '[ng-app="social"]',
urlPart: '/social/#/dashboard',
},
components: ['tabs', 'actions'],
});

this.tabs = {
services: 'a[ui-sref="dashboard.services"]',
partners: 'a[ui-sref="dashboard.partners"]',
};
}
}

module.exports = new SocialDashboardPage();

0 comments on commit a53e5f1

Please sign in to comment.