From 6ecbb8293ed516d7723d3e0762bf17a907c58214 Mon Sep 17 00:00:00 2001 From: Simona Domnisoru Date: Tue, 7 Jan 2025 11:05:49 +0100 Subject: [PATCH 1/3] chore: fix User can complete the enrollment and the active events scenario --- .../e2e/WidgetsForEnrollmentPages/WidgetEnrollment/index.js | 4 ++-- .../WidgetsForEnrollmentAddEventPage.feature | 2 +- .../WidgetsForEnrollmentDashboard.feature | 2 +- .../WidgetsForEnrollmentEditEvent.feature | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cypress/e2e/WidgetsForEnrollmentPages/WidgetEnrollment/index.js b/cypress/e2e/WidgetsForEnrollmentPages/WidgetEnrollment/index.js index 9f4148abf9..fe8fdfee12 100644 --- a/cypress/e2e/WidgetsForEnrollmentPages/WidgetEnrollment/index.js +++ b/cypress/e2e/WidgetsForEnrollmentPages/WidgetEnrollment/index.js @@ -9,10 +9,10 @@ After({ tags: '@with-transfer-ownership-data-cleanup' }, () => { }); const changeEnrollmentAndEventsStatus = () => ( - cy.buildApiUrl('tracker', 'trackedEntities/osF4RF4EiqP?program=IpHINAT79UW&fields=enrollments') + cy.buildApiUrl('tracker', 'trackedEntities/mPLqCVS27AD?program=IpHINAT79UW&fields=enrollments') .then(url => cy.request(url)) .then(({ body }) => { - const enrollment = body.enrollments && body.enrollments.find(e => e.enrollment === 'qyx7tscVpVB'); + const enrollment = body.enrollments && body.enrollments.find(e => e.enrollment === 'YqNTNLKmX4z'); const eventsToUpdate = enrollment.events.map(e => ({ ...e, status: 'ACTIVE', diff --git a/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentAddEventPage/WidgetsForEnrollmentAddEventPage.feature b/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentAddEventPage/WidgetsForEnrollmentAddEventPage.feature index 0ab586b19f..cd6062c7fe 100644 --- a/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentAddEventPage/WidgetsForEnrollmentAddEventPage.feature +++ b/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentAddEventPage/WidgetsForEnrollmentAddEventPage.feature @@ -68,7 +68,7 @@ Feature: The user interacts with the widgets on the enrollment add event page Then you can assign a user when scheduling the event Scenario: User can complete the enrollment and the active events - Given you land on the enrollment edit event page by having typed #/enrollmentEventNew?enrollmentId=qyx7tscVpVB&orgUnitId=DiszpKrYNg8&programId=IpHINAT79UW&teiId=osF4RF4EiqP + Given you land on the enrollment edit event page by having typed #/enrollmentEventNew?enrollmentId=YqNTNLKmX4z&orgUnitId=RzgSFJ9E46G&programId=IpHINAT79UW&teiId=mPLqCVS27AD And the enrollment widget should be opened And the user sees the enrollment status and the Baby Postnatal event status is active And the user opens the enrollment actions menu diff --git a/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentDashboard/WidgetsForEnrollmentDashboard.feature b/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentDashboard/WidgetsForEnrollmentDashboard.feature index ffd0a56c1c..76b3465297 100644 --- a/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentDashboard/WidgetsForEnrollmentDashboard.feature +++ b/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentDashboard/WidgetsForEnrollmentDashboard.feature @@ -127,7 +127,7 @@ Feature: The user interacts with the widgets on the enrollment dashboard Then the user can see the program rules effect in the indicator widget Scenario: User can complete the enrollment and the active events - Given you land on the enrollment dashboard page by having typed #/enrollment?enrollmentId=qyx7tscVpVB + Given you land on the enrollment dashboard page by having typed #/enrollment?enrollmentId=YqNTNLKmX4z And the enrollment widget should be opened And the user sees the enrollment status and the Baby Postnatal event status is active And the user opens the enrollment actions menu diff --git a/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentEditEvent/WidgetsForEnrollmentEditEvent.feature b/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentEditEvent/WidgetsForEnrollmentEditEvent.feature index 39bd30c304..defa075922 100644 --- a/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentEditEvent/WidgetsForEnrollmentEditEvent.feature +++ b/cypress/e2e/WidgetsForEnrollmentPages/WidgetsForEnrollmentEditEvent/WidgetsForEnrollmentEditEvent.feature @@ -105,7 +105,7 @@ Feature: The user interacts with the widgets on the enrollment edit event Then the table footer should display page 2 Scenario: User can complete the enrollment and the active events - Given you land on the enrollment edit event page by having typed #/enrollmentEventEdit?eventId=OWpIzQ4xabC&orgUnitId=DiszpKrYNg8 + Given you land on the enrollment edit event page by having typed #/enrollmentEventEdit?eventId=PyXThVzWJzL&orgUnitId=RzgSFJ9E46G And the enrollment widget should be opened And the user sees the enrollment status and the Baby Postnatal event status is active And the user opens the enrollment actions menu From a67864f450546ec4722d29b743cfd54956141a7b Mon Sep 17 00:00:00 2001 From: Simona Domnisoru Date: Tue, 7 Jan 2025 12:00:53 +0100 Subject: [PATCH 2/3] chore: fix user can delete an event --- .../StagesAndEventsWidget/StagesAndEventsWidget.feature | 2 +- .../StagesAndEventsWidget/StagesAndEventsWidget.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/EnrollmentPage/StagesAndEventsWidget/StagesAndEventsWidget.feature b/cypress/e2e/EnrollmentPage/StagesAndEventsWidget/StagesAndEventsWidget.feature index e944741b2f..a18e595f6b 100644 --- a/cypress/e2e/EnrollmentPage/StagesAndEventsWidget/StagesAndEventsWidget.feature +++ b/cypress/e2e/EnrollmentPage/StagesAndEventsWidget/StagesAndEventsWidget.feature @@ -71,7 +71,7 @@ Feature: User interacts with Stages and Events Widget @with-restore-deleted-event Scenario: User can delete an event - Given you open the enrollment page by typing #/enrollment?enrollmentId=ikYMpSKXik1&orgUnitId=DiszpKrYNg8&programId=ur1Edk5Oe2n&teiId=Trc1H9T5C6f + Given you open the enrollment page by typing #/enrollment?enrollmentId=ITyaPVATEwc&orgUnitId=DiszpKrYNg8&programId=ur1Edk5Oe2n&teiId=wsk89u7zquT And there is an Active event in the TB visit stage When you click the Delete event overflow button on the Active event And you confirm you want to delete the event diff --git a/cypress/e2e/EnrollmentPage/StagesAndEventsWidget/StagesAndEventsWidget.js b/cypress/e2e/EnrollmentPage/StagesAndEventsWidget/StagesAndEventsWidget.js index 35d8996ee7..bf5334da58 100644 --- a/cypress/e2e/EnrollmentPage/StagesAndEventsWidget/StagesAndEventsWidget.js +++ b/cypress/e2e/EnrollmentPage/StagesAndEventsWidget/StagesAndEventsWidget.js @@ -3,7 +3,7 @@ import { getCurrentYear } from '../../../support/date'; import '../sharedSteps'; After({ tags: '@with-restore-deleted-event' }, () => { - cy.visit('#/enrollment?enrollmentId=ikYMpSKXik1&orgUnitId=DiszpKrYNg8&programId=ur1Edk5Oe2n&teiId=Trc1H9T5C6f'); + cy.visit('#/enrollment?enrollmentId=ITyaPVATEwc&orgUnitId=DiszpKrYNg8&programId=ur1Edk5Oe2n&teiId=wsk89u7zquT'); cy.get('[data-test="stages-and-events-widget"]') .find('[data-test="widget-contents"]') @@ -215,7 +215,7 @@ When(/you click the (.*) event overflow button on the (.*) event$/, (buttonName, cy.get('[data-test="overflow-menu"]') .contains(buttonName) - .click(); + .click({ force: true }); }); Then('the event should be skipped', () => { From 892bce4e39fc2907cd035d62823f28ab73de114a Mon Sep 17 00:00:00 2001 From: Simona Domnisoru Date: Tue, 7 Jan 2025 12:04:28 +0100 Subject: [PATCH 3/3] chore: skip bulk test --- .../TeiWorkingLists/TeiBulkActions/TeiBulkActions.feature | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cypress/e2e/WorkingLists/TeiWorkingLists/TeiBulkActions/TeiBulkActions.feature b/cypress/e2e/WorkingLists/TeiWorkingLists/TeiBulkActions/TeiBulkActions.feature index f79f4faf87..40b383e7b3 100644 --- a/cypress/e2e/WorkingLists/TeiWorkingLists/TeiBulkActions/TeiBulkActions.feature +++ b/cypress/e2e/WorkingLists/TeiWorkingLists/TeiBulkActions/TeiBulkActions.feature @@ -31,6 +31,8 @@ Feature: User facing tests for bulk actions on Tracked Entity working lists When you select the first 5 rows Then the filters should be disabled +#DHIS2-18447 +@skip 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