-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/origin/master' into eh/fea…
…t/DHIS2-18250-breadcrumb-navigation-bar # Conflicts: # i18n/en.pot
- Loading branch information
Showing
82 changed files
with
3,181 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
cypress/e2e/WorkingLists/EventWorkingLists/EventBulkActions/EventBulkAction.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
Feature: User facing tests for bulk actions on event working lists | ||
|
||
Scenario: the user should be able to select rows | ||
Given you open the main page with Ngelehun and malaria case context | ||
When you select the first 5 rows | ||
Then the bulk action bar should say 5 selected | ||
And the first 5 rows should be selected | ||
|
||
Scenario: the user should be able to deselect rows | ||
Given you open the main page with Ngelehun and malaria case context | ||
When you select the first 5 rows | ||
And you deselect the first 3 rows | ||
Then the bulk action bar should say 2 selected | ||
|
||
Scenario: the user should be able to select all rows | ||
Given you open the main page with Ngelehun and malaria case context | ||
When you select all rows | ||
Then the bulk action bar should say 15 selected | ||
And all rows should be selected | ||
|
||
Scenario: the user should be able to deselect all rows | ||
Given you open the main page with Ngelehun and malaria case context | ||
When you select all rows | ||
And all rows should be selected | ||
And you select all rows | ||
Then the bulk action bar should not be present | ||
And no rows should be selected | ||
|
||
Scenario: the filters should be disabled when rows are selected | ||
Given you open the main page with Ngelehun and malaria case context | ||
When you select the first 5 rows | ||
Then the filters should be disabled | ||
|
||
@v<42 | ||
Scenario: the user should be able to bulk complete events | ||
Given you open the main page with Ngelehun and malaria case context | ||
And you select the first 3 rows | ||
And you click the bulk complete button | ||
And the bulk complete modal should open | ||
When you click the confirm complete events button | ||
Then the bulk complete modal should close | ||
|
||
Scenario: the user should be able to bulk delete events | ||
Given you open the main page with Ngelehun and malaria case context | ||
And you select the first 3 rows | ||
And you click the bulk Delete button | ||
And the bulk delete modal should open | ||
When you click the confirm delete events button | ||
Then the bulk delete modal should close |
73 changes: 73 additions & 0 deletions
73
cypress/e2e/WorkingLists/EventWorkingLists/EventBulkActions/EventBulkAction.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { Given, Then, When } from '@badeball/cypress-cucumber-preprocessor'; | ||
import '../../sharedSteps'; | ||
|
||
Given('you open the main page with Ngelehun and malaria case context', () => { | ||
cy.visit('#/?programId=VBqh0ynB2wv&orgUnitId=DiszpKrYNg8'); | ||
}); | ||
|
||
Then('the bulk complete modal should open', () => { | ||
cy.get('[data-test="bulk-complete-events-dialog"]') | ||
.should('exist'); | ||
}); | ||
|
||
When('you click the confirm complete events button', () => { | ||
cy.intercept({ | ||
method: 'POST', | ||
url: '**/tracker?async=false**', | ||
}, { | ||
statusCode: 200, | ||
body: {}, | ||
}).as('completeEvents'); | ||
|
||
cy.get('[data-test="bulk-complete-events-dialog"]') | ||
.find('[data-test="dhis2-uicore-button"]') | ||
.contains('Complete').click(); | ||
|
||
cy.wait('@completeEvents') | ||
.its('request.body') | ||
.should(({ events }) => { | ||
expect(events).to.have.length(3); | ||
expect(events[0]).to.include({ status: 'COMPLETED' }); | ||
expect(events[1]).to.include({ status: 'COMPLETED' }); | ||
expect(events[2]).to.include({ status: 'COMPLETED' }); | ||
}); | ||
}); | ||
|
||
Then('the bulk complete modal should close', () => { | ||
cy.get('[data-test="bulk-complete-events-dialog"]') | ||
.should('not.exist'); | ||
}); | ||
|
||
Then('the bulk delete modal should open', () => { | ||
cy.get('[data-test="bulk-delete-events-dialog"]') | ||
.should('exist'); | ||
}); | ||
|
||
// you click the confirm delete events button | ||
When('you click the confirm delete events button', () => { | ||
cy.intercept({ | ||
method: 'POST', | ||
url: '**/tracker?async=false**', | ||
}, { | ||
statusCode: 200, | ||
body: {}, | ||
}).as('deleteEvents'); | ||
|
||
cy.get('[data-test="bulk-delete-events-dialog"]') | ||
.find('[data-test="dhis2-uicore-button"]') | ||
.contains('Delete').click(); | ||
|
||
cy.wait('@deleteEvents') | ||
.its('request.body') | ||
.should(({ events }) => { | ||
expect(events).to.have.length(3); | ||
expect(events).to.deep.include({ event: 'a969f7a3bf1' }); | ||
expect(events).to.deep.include({ event: 'a6f092d0d44' }); | ||
expect(events).to.deep.include({ event: 'a5e67163090' }); | ||
}); | ||
}); | ||
|
||
Then('the bulk delete modal should close', () => { | ||
cy.get('[data-test="bulk-delete-events-dialog"]') | ||
.should('not.exist'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
cypress/e2e/WorkingLists/TeiWorkingLists/TeiBulkActions/TeiBulkActions.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
Feature: User facing tests for bulk actions on Tracked Entity working lists | ||
|
||
Scenario: the user should be able to select rows | ||
Given you open the main page with Ngelehun and child programe context | ||
When you select the first 5 rows | ||
Then the bulk action bar should say 5 selected | ||
And the first 5 rows should be selected | ||
|
||
Scenario: the user should be able to deselect rows | ||
Given you open the main page with Ngelehun and child programe context | ||
When you select the first 5 rows | ||
And you deselect the first 3 rows | ||
Then the bulk action bar should say 2 selected | ||
|
||
Scenario: the user should be able to select all rows | ||
Given you open the main page with Ngelehun and child programe context | ||
When you select all rows | ||
Then the bulk action bar should say 15 selected | ||
And all rows should be selected | ||
|
||
Scenario: the user should be able to deselect all rows | ||
Given you open the main page with Ngelehun and child programe context | ||
When you select all rows | ||
And all rows should be selected | ||
And you select all rows | ||
Then the bulk action bar should not be present | ||
And no rows should be selected | ||
|
||
Scenario: the filters should be disabled when rows are selected | ||
Given you open the main page with Ngelehun and child programe context | ||
When you select the first 5 rows | ||
Then the filters should be disabled | ||
|
||
Scenario: The user should see an error message when trying to bulk complete enrollments with errors | ||
Given you open the main page with Ngelehun and Malaria focus investigation context | ||
And you select the first 3 rows | ||
And you click the bulk complete enrollments button | ||
And the bulk complete enrollments modal should open | ||
And the modal content should say: This action will complete 2 active enrollments in your selection. 1 enrollment already marked as completed will not be changed. | ||
When you confirm 2 active enrollments with errors | ||
Then an error dialog will be displayed to the user | ||
And you close the error dialog | ||
And the unsuccessful enrollments should still be selected | ||
|
||
Scenario: the user should be able to bulk complete enrollments and events | ||
Given you open the main page with Ngelehun and Malaria focus investigation context | ||
And you select the first 4 rows | ||
And you click the bulk complete enrollments button | ||
And the bulk complete enrollments modal should open | ||
And the modal content should say: This action will complete 3 active enrollments in your selection. 1 enrollment already marked as completed will not be changed. | ||
When you confirm 3 active enrollments successfully | ||
Then the bulk complete enrollments modal should close | ||
|
||
Scenario: the user should be able to bulk complete enrollments without completing events | ||
Given you open the main page with Ngelehun and Malaria Case diagnosis context | ||
And you select row number 1 | ||
And you click the bulk complete enrollments button | ||
And the bulk complete enrollments modal should open | ||
And you deselect the complete events checkbox | ||
And the modal content should say: This action will complete 1 active enrollment in your selection. | ||
When you confirm 1 active enrollment without completing events successfully | ||
Then the bulk complete enrollments modal should close | ||
|
||
Scenario: the user should be able to bulk delete enrollments | ||
Given you open the main page with Ngelehun and Malaria Case diagnosis context | ||
And you select the first 3 rows | ||
And you click the bulk delete enrollments button | ||
And the bulk delete enrollments modal should open | ||
When you confirm deleting 3 enrollments | ||
Then the bulk delete enrollments modal should close | ||
|
||
Scenario: the user should be able to bulk delete only active enrollments | ||
Given you open the main page with Ngelehun and Malaria Case diagnosis context | ||
And you select the first 3 rows | ||
And you click the bulk delete enrollments button | ||
And the bulk delete enrollments modal should open | ||
When you deselect completed enrollments | ||
And you confirm deleting 2 active enrollments | ||
Then the bulk delete enrollments modal should close | ||
|
||
@user:trackerAutoTestRestricted | ||
Scenario: a restricted user should not be able to bulk delete enrollments | ||
Given you open the main page with Ngelehun and WHO RMNCH Tracker context | ||
And you open the working lists | ||
When you select the first 3 rows | ||
Then the bulk delete enrollments button should not be visible |
Oops, something went wrong.