From e226fdcbd26ff98e6f6f245fa71595074f004756 Mon Sep 17 00:00:00 2001 From: fazilqa <127263470+fazilqa@users.noreply.github.com> Date: Wed, 27 Nov 2024 11:38:03 -0800 Subject: [PATCH] add verify grouping on draft test --- ...ts-grouping-by facilities.cypress.spec.js} | 27 ++++++++++++++++++- .../tests/e2e/utils/constants.js | 1 + 2 files changed, 27 insertions(+), 1 deletion(-) rename src/applications/mhv-secure-messaging/tests/e2e/{secure-messaging-recipients-grouping-on-compose.cypress.spec.js => secure-messaging-recipients-grouping-by facilities.cypress.spec.js} (62%) diff --git a/src/applications/mhv-secure-messaging/tests/e2e/secure-messaging-recipients-grouping-on-compose.cypress.spec.js b/src/applications/mhv-secure-messaging/tests/e2e/secure-messaging-recipients-grouping-by facilities.cypress.spec.js similarity index 62% rename from src/applications/mhv-secure-messaging/tests/e2e/secure-messaging-recipients-grouping-on-compose.cypress.spec.js rename to src/applications/mhv-secure-messaging/tests/e2e/secure-messaging-recipients-grouping-by facilities.cypress.spec.js index 8b48d37d5224..fe0ca60b74d4 100644 --- a/src/applications/mhv-secure-messaging/tests/e2e/secure-messaging-recipients-grouping-on-compose.cypress.spec.js +++ b/src/applications/mhv-secure-messaging/tests/e2e/secure-messaging-recipients-grouping-by facilities.cypress.spec.js @@ -3,15 +3,18 @@ import PatientInboxPage from './pages/PatientInboxPage'; import GeneralFunctionsPage from './pages/GeneralFunctionsPage'; import PatientComposePage from './pages/PatientComposePage'; import { AXE_CONTEXT, Locators, Data } from './utils/constants'; +import PatientMessageDraftsPage from './pages/PatientMessageDraftsPage'; describe('SM RECIPIENTS GROUPING', () => { const updatedFeatureToggles = GeneralFunctionsPage.updateFeatureToggles( `mhv_secure_messaging_recipient_opt_groups`, true, ); - it('verify grouping on compose', () => { + beforeEach(() => { SecureMessagingSite.login(updatedFeatureToggles); PatientInboxPage.loadInboxMessages(); + }); + it('verify grouping on compose', () => { PatientInboxPage.navigateToComposePage(); PatientComposePage.verifyHeader(Data.START_NEW_MSG); @@ -31,4 +34,26 @@ describe('SM RECIPIENTS GROUPING', () => { cy.injectAxe(); cy.axeCheck(AXE_CONTEXT); }); + + it('verify grouping on draft', () => { + PatientMessageDraftsPage.loadDrafts(); + PatientMessageDraftsPage.loadSingleDraft(); + PatientComposePage.verifyHeader(Data.EDIT_DRAFT); + + cy.get(Locators.DROPDOWN.RECIPIENTS) + .find(`optgroup`) + .should(`have.length`, 4); + + cy.get(Locators.DROPDOWN.RECIPIENTS) + .find(`optgroup`) + .each(el => { + cy.wrap(el) + .find(`option`) + .its(`length`) + .should(`be.greaterThan`, 0); + }); + + cy.injectAxe(); + cy.axeCheck(AXE_CONTEXT); + }); }); diff --git a/src/applications/mhv-secure-messaging/tests/e2e/utils/constants.js b/src/applications/mhv-secure-messaging/tests/e2e/utils/constants.js index eb5f7bdaf08e..6e3d38857be9 100644 --- a/src/applications/mhv-secure-messaging/tests/e2e/utils/constants.js +++ b/src/applications/mhv-secure-messaging/tests/e2e/utils/constants.js @@ -324,6 +324,7 @@ export const Data = { SAMPLE_XLS: 'sample_XLS.xls', SAMPLE_IMG: 'test_image.gif', START_NEW_MSG: 'Start a new message', + EDIT_DRAFT: 'Edit draft', GO_YOUR_INBOX: 'Go to your inbox', BACK_TO_MSG: 'Back to messages', FOLDER_NAME_CANNOT_BLANK: 'Folder name cannot be blank',