Skip to content

Commit

Permalink
Merge branch 'master' into eh/feat/DHIS2-14799_WorkingListForFollowUp
Browse files Browse the repository at this point in the history
  • Loading branch information
JoakimSM authored Mar 5, 2024
2 parents 46bc2e5 + 02ae706 commit 1eb8001
Show file tree
Hide file tree
Showing 206 changed files with 5,965 additions and 2,500 deletions.
56 changes: 56 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,59 @@
# [100.63.0](https://github.com/dhis2/capture-app/compare/v100.62.0...v100.63.0) (2024-03-05)


### Features

* [DHIS2-16922] Delete Tracked entity from profile Widget ([#3545](https://github.com/dhis2/capture-app/issues/3545)) ([fb8171e](https://github.com/dhis2/capture-app/commit/fb8171e515eee7fb081e6e8954d5b14959fbe4f2))

# [100.62.0](https://github.com/dhis2/capture-app/compare/v100.61.0...v100.62.0) (2024-03-05)


### Features

* [DHIS2-15170] Adjust context selector for "new" button ([#3523](https://github.com/dhis2/capture-app/issues/3523)) ([3779c9d](https://github.com/dhis2/capture-app/commit/3779c9dd4e79a28db375fddfed99eb34c84d4465))

# [100.61.0](https://github.com/dhis2/capture-app/compare/v100.60.0...v100.61.0) (2024-03-05)


### Features

* [DHIS2-15391] preview images in working lists and on enrollment dashboard ([#3546](https://github.com/dhis2/capture-app/issues/3546)) ([191c22f](https://github.com/dhis2/capture-app/commit/191c22fd5f393fa682640e6c081ce34ff36eccfa))

# [100.60.0](https://github.com/dhis2/capture-app/compare/v100.59.0...v100.60.0) (2024-03-05)


### Features

* [DHIS2-13800] ask user to complete enrollment and events ([#3535](https://github.com/dhis2/capture-app/issues/3535)) ([fd1863d](https://github.com/dhis2/capture-app/commit/fd1863d0e0dddd8ab590c2e7c5620cbc074df51e))

# [100.59.0](https://github.com/dhis2/capture-app/compare/v100.58.0...v100.59.0) (2024-03-05)


### Features

* [DHIS2-16322] One Click Transfer ([#3519](https://github.com/dhis2/capture-app/issues/3519)) ([b115ee8](https://github.com/dhis2/capture-app/commit/b115ee87eec638f9a8a16d7cd22ebd0ec2516841))

# [100.58.0](https://github.com/dhis2/capture-app/compare/v100.57.6...v100.58.0) (2024-03-03)


### Features

* [DHIS2-16372] Delete Relationships ([#3520](https://github.com/dhis2/capture-app/issues/3520)) ([9fed562](https://github.com/dhis2/capture-app/commit/9fed562c0f06186d95255e40d73479b4428f206d))

## [100.57.6](https://github.com/dhis2/capture-app/compare/v100.57.5...v100.57.6) (2024-03-03)


### Bug Fixes

* **translations:** sync translations from transifex (master) ([c6451bc](https://github.com/dhis2/capture-app/commit/c6451bc7dfe43f9c819ca49efa9f3715dfc8bb07))

## [100.57.5](https://github.com/dhis2/capture-app/compare/v100.57.4...v100.57.5) (2024-02-28)


### Bug Fixes

* **translations:** sync translations from transifex (master) ([f3cb465](https://github.com/dhis2/capture-app/commit/f3cb465aa8d3d99275e995eda05075070ed6c393))

## [100.57.4](https://github.com/dhis2/capture-app/compare/v100.57.3...v100.57.4) (2024-02-27)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,12 @@ Feature: User interacts with the Enrollment New Event Workspace
And you select the schedule tab
When you add a comment to the event
And the events saves successfully

Scenario: User can add a new event and complete the enrollment
Given you land on the enrollment new event page by having typed #/enrollmentEventNew?enrollmentId=FZAa7j0muDj&orgUnitId=DiszpKrYNg8&programId=qDkgAbB5Jlk&stageId=eHvTba5ijAh&teiId=bj4UmUpqaSp
And the enrollment status is active
And you type 2021-10-15 in the input number 0
And you select Died in the select number 0
And the user completes the event
And the user completes the enrollment
Then the user sees the enrollment status and recently added event in Case outcome event status is completed
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,42 @@ import { Given, When, Then, defineStep as And } from '@badeball/cypress-cucumber
import '../sharedSteps';
import '../../sharedSteps';

const changeEnrollmentAndEventsStatus = () => (
cy.buildApiUrl(
'tracker',
'trackedEntities/bj4UmUpqaSp?program=qDkgAbB5Jlk&fields=enrollments[enrollment,events,orgUnit,program,enrolledAt,trackedEntity]',
)
.then(url => cy.request(url))
.then(({ body }) => {
const enrollment = body.enrollments && body.enrollments.find(e => e.enrollment === 'FZAa7j0muDj');
const eventToDelete = enrollment.events.find(e => e.programStage === 'eHvTba5ijAh');
const { events, ...rest } = enrollment;
const enrollmentToUpdate = { ...rest, status: 'ACTIVE' };

return cy
.buildApiUrl('tracker?async=false&importStrategy=UPDATE')
.then(enrollmentUrl => cy.request('POST', enrollmentUrl, { enrollments: [enrollmentToUpdate] }))
.then(() => {
if (eventToDelete) {
cy.buildApiUrl('events', eventToDelete.event)
.then((eventUrl) => {
cy.request('DELETE', eventUrl);
}).then(() => {
cy.reload();
cy.get('[data-test="widget-enrollment"]').within(() => {
cy.get('[data-test="widget-enrollment-status"]').contains('Active').should('exist');
});
});
} else {
cy.reload();
cy.get('[data-test="widget-enrollment"]').within(() => {
cy.get('[data-test="widget-enrollment-status"]').contains('Active').should('exist');
});
}
});
})
);

const showAllEventsInProgramStage = () => {
cy.get('[data-test="dhis2-uicore-tablefoot"]')
.then(($footer) => {
Expand Down Expand Up @@ -157,3 +193,41 @@ Then('the user clicks the first second antenatal care visit event', () => {
cy.contains('[data-test="stage-content"]', 'Last updated a few seconds ago')
.should('exist');
});

And('the enrollment status is active', () => {
changeEnrollmentAndEventsStatus();
});

And('the user completes the event', () => {
cy.get('[data-test="dhis2-uicore-button"]')
.contains('Complete')
.click();
});

When('the user completes the enrollment', () => {
cy.get('[data-test="enrollment-complete-modal"]').within(() => {
cy.contains('Case outcome completed').should('exist');
cy.contains('Would you like to complete the enrollment and all active events as well?').should('exist');
cy.contains('The following events will be completed:').should('exist');
cy.contains('1 event in Case investigation & classification').should('exist');
cy.contains('1 event in Diagnosis & treatment').should('exist');
cy.contains('No, cancel').should('exist');
cy.contains('Complete enrollment only').should('exist');
cy.contains('Yes, complete enrollment and events').should('exist');
});
cy.get('[data-test="enrollment-actions-complete-button"]').click();
});

Then('the user sees the enrollment status and recently added event in Case outcome event status is completed', () => {
cy.url().should('include', `${Cypress.config().baseUrl}/#/enrollment?`);
cy.get('[data-test="widget-enrollment"]').within(() => {
cy.get('[data-test="widget-enrollment-status"]').contains('Completed').should('exist');
});

cy.get('[data-test="stage-content"]')
.eq(2)
.within(() => {
cy.get('[data-test="dhis2-uicore-tag-text"]').contains('Completed').should('exist');
});
changeEnrollmentAndEventsStatus();
});
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,11 @@ Scenario: User can see disabled scheduled date for active event
When the user clicks on the edit button
Then the user see the following text: Enrollment: Edit Event
Then the user see the schedule date field with tooltip: Scheduled date cannot be changed for Active events


Scenario: User can edit the event and complete the enrollment
Given you land on the enrollment event page with selected Malaria Entity by having typed #/enrollmentEventEdit?eventId=MHR4Zj6KLz0&orgUnitId=DiszpKrYNg8
And the enrollment status is active
And the user clicks on the edit button
And the user completes the event
And the user completes the enrollment
Then the user sees the enrollment status and recently edited event in Case outcome event status is completed
Original file line number Diff line number Diff line change
@@ -1,7 +1,34 @@
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
import { Given, When, Then, defineStep as And } from '@badeball/cypress-cucumber-preprocessor';
import { getCurrentYear } from '../../../support/date';
import '../../sharedSteps';

const changeEnrollmentAndEventsStatus = () => (
cy.buildApiUrl(
'tracker',
'trackedEntities/JM29jwvw8Ub?program=qDkgAbB5Jlk&fields=enrollments[enrollment,events,orgUnit,program,enrolledAt,trackedEntity]',
)
.then(url => cy.request(url))
.then(({ body }) => {
const enrollment = body.enrollments && body.enrollments.find(e => e.enrollment === 'C4iB0VTbfrK');
const eventToUpdate = enrollment.events.find((e => e.programStage === 'eHvTba5ijAh'));
const enrollmentToUpdate = {
...enrollment,
status: 'ACTIVE',
events: [{ ...eventToUpdate, status: 'ACTIVE' }],
};

return cy
.buildApiUrl('tracker?async=false&importStrategy=UPDATE')
.then(enrollmentUrl => cy.request('POST', enrollmentUrl, { enrollments: [enrollmentToUpdate] }))
.then(() => {
cy.reload();
cy.get('[data-test="widget-enrollment"]').within(() => {
cy.get('[data-test="widget-enrollment-status"]').contains('Active').should('exist');
});
});
})
);

Given(/^you land on the enrollment event page with selected (.*) by having typed (.*)$/, (tet, url) => {
cy.visit(url);
cy.get('[data-test="scope-selector"]').contains(`${tet}`);
Expand Down Expand Up @@ -95,3 +122,49 @@ Then(/^the user see the schedule date field with tooltip: (.*)$/, (tooltipConten
cy.get('[data-test="dhis2-uicore-tooltip-reference"]').eq(0).trigger('mouseover');
cy.get('[data-test="dhis2-uicore-tooltip-content"]').contains(tooltipContent).should('exist');
});

And('the enrollment status is active', () => {
changeEnrollmentAndEventsStatus();
});

And('the user completes the event', () => {
cy.get('[data-test="dataentry-field-complete"]')
.find('input')
.click()
.blur();

cy
.get('[data-test="widget-enrollment-event"]')
.find('[data-test="dhis2-uicore-button"]')
.contains('Save')
.click();
});

When('the user completes the enrollment', () => {
cy.get('[data-test="enrollment-complete-modal"]').within(() => {
cy.contains('Case outcome completed').should('exist');
cy.contains('Would you like to complete the enrollment and all active events as well?').should('exist');
cy.contains('The following events will be completed:').should('exist');
cy.contains('1 event in Case outcome').should('exist');
cy.contains('1 event in Diagnosis & treatment').should('exist');
cy.contains('No, cancel').should('exist');
cy.contains('Complete enrollment only').should('exist');
cy.contains('Yes, complete enrollment and events').should('exist');
});
cy.get('[data-test="enrollment-actions-complete-button"]').click();
});

Then('the user sees the enrollment status and recently edited event in Case outcome event status is completed', () => {
cy.url().should('include', `${Cypress.config().baseUrl}/#/enrollment?`);
cy.get('[data-test="widget-enrollment"]').within(() => {
cy.get('[data-test="widget-enrollment-status"]').contains('Completed').should('exist');
});

cy.get('[data-test="stage-content"]')
.eq(2)
.within(() => {
cy.get('[data-test="dhis2-uicore-tag-text"]').contains('Completed').should('exist');
});
changeEnrollmentAndEventsStatus();
});

2 changes: 2 additions & 0 deletions cypress/e2e/EnrollmentPage/BreakingTheGlass.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Feature: Breaking the glass page

# TODO - Flaky tests should be fixed by TECH-1662
@skip
Scenario: User with search scope access tries to access an enrollment in a protected program
Given the tei created by this test is cleared from the database
And the data store is clean
Expand Down
15 changes: 5 additions & 10 deletions cypress/e2e/NewPage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ Feature: User creates a new entries from the registration page
Given you are in the main page with no selections made
And you select org unit
And you select the Contraceptives Voucher Program
Then you see a dropdown button
When you click the the first option option
When you click the Create new button
Then you are navigated to the Contraceptives Voucher Program registration page with program selected
And there should be informative message explaining you need to complete your selections

Expand Down Expand Up @@ -57,8 +56,7 @@ Feature: User creates a new entries from the registration page
Given you are in the main page with no selections made
And you select org unit
And you select Child Programme
Then you see a dropdown button
When you click the "New..." option
When you click the first option in split button dropdown
Then you are navigated to the registration page without program selected
And you see the dropdown menu for selecting tracked entity type
And you have no program selection
Expand All @@ -67,8 +65,7 @@ Feature: User creates a new entries from the registration page
Given you are in the main page with no selections made
And you select org unit
And you select Child Programme
Then you see a dropdown button
When you click the the first option option
When you click the Create new button
Then you are navigated to the Child Programme registration page with program selected
And you see a registration form for the Child Programme
And you have Child Programme selected
Expand All @@ -77,8 +74,7 @@ Feature: User creates a new entries from the registration page
Given you are in the main page with no selections made
And you select org unit
And you select the Contraceptives Voucher Program
Then you see a dropdown button
When you click the the first option option
When you click the Create new button
Then you are navigated to the Contraceptives Voucher Program registration page with program selected
And there should be informative message explaining you need to complete your selections
When you select the first category
Expand All @@ -90,8 +86,7 @@ Feature: User creates a new entries from the registration page
And you select the Antenatal care visit program
Then you see a list of events
When you select one of the events
Then you see a dropdown button
When you click the the first option option
When you click the Create new button
Then you are navigated to the Antenatal care visit registration page
Then program and organisation unit is still selected in top bar

Expand Down
14 changes: 3 additions & 11 deletions cypress/e2e/NewPage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,21 +203,13 @@ When('you select the Inpatient morbidity and mortality program', () => {
.click();
});

When('you see a dropdown button', () => {
When('you click the Create new button', () => {
cy.get('[data-test="new-button"]')
.contains('New')
.should('exist');
});

When('you click the "New..." option', () => {
cy.get('[data-test="new-button"]')
.click();
cy.get('[data-test="new-menuitem-two"]')
.click();
});

When('you click the the first option option', () => {
cy.get('[data-test="new-button"]')
When('you click the first option in split button dropdown', () => {
cy.get('[data-test="new-button-toggle"]')
.click();
cy.get('[data-test="new-menuitem-one"]')
.click();
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/ScopeSelector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ When('you click the "New" button to add a new event', () => {
});

When('you click the first option from the "New" button to add a new event', () => {
cy.get('[data-test="new-button"]')
cy.get('[data-test="new-button-toggle"]')
.click();
cy.get('[data-test="new-menuitem-one"]')
.click();
Expand Down
Loading

0 comments on commit 1eb8001

Please sign in to comment.