Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved Button Responsiveness and Layout Adjustments #9161

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions cypress/e2e/assets_spec/AssetHomepage.cy.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import { advanceFilters } from "pageobject/utils/advanceFilterHelpers";
import { pageNavigation } from "pageobject/utils/paginationHelpers";
import { v4 as uuidv4 } from "uuid";

import { AssetPage } from "../../pageobject/Asset/AssetCreation";
import { AssetFilters } from "../../pageobject/Asset/AssetFilters";
import { AssetPagination } from "../../pageobject/Asset/AssetPagination";
import { AssetQRScanPage } from "../../pageobject/Asset/AssetQRScan";
import { AssetSearchPage } from "../../pageobject/Asset/AssetSearch";
import LoginPage from "../../pageobject/Login/LoginPage";

describe("Asset Tab", () => {
const assetSearchPage = new AssetSearchPage();
const assetQRScanPage = new AssetQRScanPage();
const assetPagination = new AssetPagination();
const assetFilters = new AssetFilters();
const assetPage = new AssetPage();
const loginPage = new LoginPage();
Expand Down Expand Up @@ -79,10 +78,10 @@ describe("Asset Tab", () => {
// Verify the pagination in the page

it("Next/Previous Page", () => {
assetPagination.navigateToNextPage();
assetPagination.verifyNextUrl();
assetPagination.navigateToPreviousPage();
assetPagination.verifyPreviousUrl();
pageNavigation.navigateToNextPage();
pageNavigation.verifyCurrentPageNumber(2);
pageNavigation.navigateToPreviousPage();
pageNavigation.verifyCurrentPageNumber(1);
});

it("Import new asset", () => {
Expand Down
33 changes: 33 additions & 0 deletions cypress/e2e/facility_spec/FacilityCreation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,39 @@ describe("Facility Creation", () => {
);
});

it("Should display error when district admin tries to create facility in a different district", () => {
facilityPage.visitCreateFacilityPage();
facilityPage.fillFacilityName(facilityName);
facilityPage.selectFacilityType(facilityType);
facilityPage.fillPincode("682001");
facilityPage.selectStateOnPincode("Kerala");
facilityPage.selectDistrictOnPincode("Kottayam");
facilityPage.selectLocalBody("Arpookara");
facilityPage.selectWard("5");
facilityPage.fillAddress(facilityAddress);
facilityPage.fillPhoneNumber(facilityNumber);
facilityPage.submitForm();
facilityPage.verifyErrorNotification(
"You do not have permission to perform this action.",
);
});

it("Access Restriction for Non-Admin Users to facility creation page", () => {
const nonAdminLoginMethods = [
loginPage.loginAsDevDoctor.bind(loginPage),
loginPage.loginAsStaff.bind(loginPage),
];

nonAdminLoginMethods.forEach((loginMethod) => {
loginMethod();
cy.visit("/facility/create");
facilityPage.verifyErrorNotification(
"You don't have permission to perform this action. Contact the admin",
);
cy.clearCookies();
});
});

afterEach(() => {
cy.saveLocalStorage();
});
Expand Down
16 changes: 8 additions & 8 deletions cypress/e2e/facility_spec/FacilityHomepage.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// FacilityCreation
import { AssetPagination } from "../../pageobject/Asset/AssetPagination";
import { pageNavigation } from "pageobject/utils/paginationHelpers";

import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import FacilityHome from "../../pageobject/Facility/FacilityHome";
import FacilityNotify from "../../pageobject/Facility/FacilityNotify";
Expand All @@ -15,7 +16,6 @@ describe("Facility Homepage Function", () => {
const facilityPage = new FacilityPage();
const manageUserPage = new ManageUserPage();
const userPage = new UserPage();
const assetPagination = new AssetPagination();
const facilitiesAlias = "downloadFacilitiesCSV";
const doctorsAlias = "downloadDoctorsCSV";
const triagesAlias = "downloadTriagesCSV";
Expand Down Expand Up @@ -83,10 +83,10 @@ describe("Facility Homepage Function", () => {

it("Search a facility in homepage and pagination", () => {
// pagination of the facility page
assetPagination.navigateToNextPage();
assetPagination.verifyNextUrl();
assetPagination.navigateToPreviousPage();
assetPagination.verifyPreviousUrl();
pageNavigation.navigateToNextPage();
pageNavigation.verifyCurrentPageNumber(2);
pageNavigation.navigateToPreviousPage();
pageNavigation.verifyCurrentPageNumber(1);
// search for a facility
manageUserPage.typeFacilitySearch(facilityName);
facilityPage.verifyFacilityBadgeContent(facilityName);
Expand Down Expand Up @@ -152,15 +152,15 @@ describe("Facility Homepage Function", () => {
facilityNotify.verifyFacilityName(facilityName);
facilityNotify.fillNotifyText(notificationMessage);
facilityNotify.interceptPostNotificationReq();
cy.submitButton("Notify");
cy.clickSubmitButton("Notify");
facilityNotify.verifyPostNotificationReq();
cy.verifyNotification("Facility Notified");
cy.closeNotification();
cy.wait(2000);
// Verify the frontend error on empty message
facilityHome.clickFacilityNotifyButton();
facilityNotify.verifyFacilityName(facilityName);
cy.submitButton("Notify");
cy.clickSubmitButton("Notify");
facilityNotify.verifyErrorMessage(notificationErrorMsg);
// close pop-up and verify
facilityHome.verifyAndCloseNotifyModal();
Expand Down
11 changes: 5 additions & 6 deletions cypress/e2e/facility_spec/FacilityLocation.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { pageNavigation } from "pageobject/utils/paginationHelpers";
import { v4 as uuidv4 } from "uuid";

import { AssetPage } from "../../pageobject/Asset/AssetCreation";
import { AssetPagination } from "../../pageobject/Asset/AssetPagination";
import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import FacilityHome from "../../pageobject/Facility/FacilityHome";
import FacilityLocation from "../../pageobject/Facility/FacilityLocation";
Expand All @@ -12,7 +12,6 @@ describe("Location Management Section", () => {
const userCreationPage = new UserCreationPage();
const facilityPage = new FacilityPage();
const facilityLocation = new FacilityLocation();
const assetPagination = new AssetPagination();
const facilityHome = new FacilityHome();

const EXPECTED_LOCATION_ERROR_MESSAGES = [
Expand Down Expand Up @@ -172,8 +171,8 @@ describe("Location Management Section", () => {
facilityLocation.setMultipleBeds(numberOfModifiedBeds);
assetPage.clickassetupdatebutton();
// pagination
assetPagination.navigateToNextPage();
assetPagination.navigateToPreviousPage();
pageNavigation.navigateToNextPage();
pageNavigation.navigateToPreviousPage();
facilityLocation.closeNotification();
});

Expand All @@ -194,14 +193,14 @@ describe("Location Management Section", () => {
facilityLocation.clickAddNewLocationButton();
facilityLocation.enterLocationName("Test Location with Beds");
facilityLocation.selectLocationType("OTHER");
cy.submitButton("Add Location");
cy.clickSubmitButton("Add Location");
cy.verifyNotification("Location created successfully");
cy.closeNotification();
facilityLocation.clickManageBedButton();
facilityLocation.clickAddBedButton();
facilityLocation.enterBedName("Bed 1");
facilityLocation.selectBedType("Regular");
cy.submitButton("Add Bed(s)");
cy.clickSubmitButton("Add Bed(s)");
cy.verifyNotification("1 Bed created successfully");
cy.closeNotification();
facilityLocation.loadLocationManagementPage("Dummy Shifting Center");
Expand Down
6 changes: 4 additions & 2 deletions cypress/e2e/hcx_spec/HcxClaims.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe("HCX Claims configuration and approval workflow", () => {
const patientConsultationPage = new PatientConsultationPage();
const patientInsurance = new PatientInsurance();
const hcxClaims = new HcxClaims();
const hcxPatientName = "Dummy Patient 14";
const hcxPatientName = "Dummy Patient Thirteen";
const firstInsuranceIdentifier = "insurance-details-0";
const patientMemberId = "001";
const patientPolicyId = "100";
Expand Down Expand Up @@ -48,7 +48,7 @@ describe("HCX Claims configuration and approval workflow", () => {
firstInsuranceIdentifier,
patientInsurerName,
);
cy.submitButton("Save Details");
cy.clickSubmitButton("Save Details");
cy.verifyNotification("Patient updated successfully");
cy.closeNotification();
// Navigate to Consultation View and capture dynamic consultation ID
Expand Down Expand Up @@ -80,6 +80,8 @@ describe("HCX Claims configuration and approval workflow", () => {
// Raise a HCX Pre-auth
patientConsultationPage.clickManagePatientButton();
patientConsultationPage.clickClaimsButton();
cy.verifyAndClickElement("#edit-insurance-policy", "Edit Insurance Policy");
cy.clickCancelButton();
hcxClaims.selectEligiblePolicy(patientInsurerName);
hcxClaims.verifyPolicyEligibility();
cy.verifyNotification("Checking Policy Eligibility");
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/patient_spec/PatientBedManagement.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ describe("Patient swtich bed functionality", () => {
const switchBedOne = "Dummy Bed 4";
const switchBedTwo = "Dummy Bed 1";
const switchBedThree = "Dummy Bed 7";
const switchPatientOne = "Dummy Patient 6";
const switchPatientTwo = "Dummy Patient 7";
const switchPatientOne = "Dummy Patient Six";
const switchPatientTwo = "Dummy Patient Seven";

before(() => {
loginPage.loginAsDistrictAdmin();
Expand Down
24 changes: 12 additions & 12 deletions cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ describe("Patient Consultation in multiple combination", () => {
patientTreatmentPlan.typePatientGeneralInstruction(generalInstruction);
patientTreatmentPlan.typeSpecialInstruction(specialInstruction);
patientTreatmentPlan.fillTreatingPhysican(doctorName);
cy.submitButton("Create Consultation");
cy.clickSubmitButton("Create Consultation");
// the above submit should fail as IP number is missing
patientConsultationPage.typePatientNumber(patientIpNumber);
patientConsultationPage.selectBed("Dummy Bed 6");
cy.submitButton("Create Consultation");
cy.clickSubmitButton("Create Consultation");
cy.verifyNotification("Consultation created successfully");
// Below code for the prescription module only present while creating a new consultation
patientPrescription.clickAddPrescription();
Expand All @@ -104,7 +104,7 @@ describe("Patient Consultation in multiple combination", () => {
patientPrescription.selectMedicine(medicineOne);
patientPrescription.enterDosage("3");
patientPrescription.selectDosageFrequency("Twice daily");
cy.submitButton("Submit");
cy.clickSubmitButton("Submit");
cy.wait(2000);
cy.verifyNotification("Medicine prescribed");
patientPrescription.clickReturnToDashboard();
Expand Down Expand Up @@ -189,7 +189,7 @@ describe("Patient Consultation in multiple combination", () => {
"#encounter_date",
"220220241230",
);
cy.submitButton("Create Consultation");
cy.clickSubmitButton("Create Consultation");
cy.verifyNotification(
"Create Diagnoses - Atleast one diagnosis is required",
);
Expand All @@ -198,7 +198,7 @@ describe("Patient Consultation in multiple combination", () => {
diagnosis4,
"add-icd11-diagnosis-as-confirmed",
);
cy.submitButton("Create Consultation");
cy.clickSubmitButton("Create Consultation");
cy.verifyNotification("Consultation created successfully");
// verify the data and death report
patientConsultationPage.verifyTextInConsultation(
Expand All @@ -215,7 +215,7 @@ describe("Patient Consultation in multiple combination", () => {
"#cause_of_death",
"Cause of Death",
);
cy.submitButton("Preview");
cy.clickSubmitButton("Preview");
cy.preventPrint();
patientDeathReport.clickPrintDeathReport();
cy.get("@verifyPrevent").should("be.called");
Expand Down Expand Up @@ -261,7 +261,7 @@ describe("Patient Consultation in multiple combination", () => {
// add telemedicine
patientTreatmentPlan.clickTelemedicineCheckbox();
patientTreatmentPlan.assignTelemedicineDoctor(doctorName);
cy.submitButton("Create Consultation");
cy.clickSubmitButton("Create Consultation");
cy.verifyNotification("Consultation created successfully");
// verify the data reflection -
patientConsultationPage.verifyTextInConsultation(
Expand Down Expand Up @@ -312,7 +312,7 @@ describe("Patient Consultation in multiple combination", () => {
patientTreatmentPlan.typePatientGeneralInstruction(generalInstruction);
// no review after and no action
patientTreatmentPlan.fillTreatingPhysican(doctorName);
cy.submitButton("Create Consultation");
cy.clickSubmitButton("Create Consultation");
cy.verifyNotification("Patient discharged successfully");
// verify the Discharge Reason, Diagnosis, treatment physican
patientConsultationPage.verifyTextInConsultation(
Expand Down Expand Up @@ -364,18 +364,18 @@ describe("Patient Consultation in multiple combination", () => {
patientTreatmentPlan.typePatientGeneralInstruction(generalInstruction);
patientTreatmentPlan.fillTreatingPhysican(doctorName);
// no review after and no action
cy.submitButton("Create Consultation");
cy.clickSubmitButton("Create Consultation");
// Create a shifting request
cy.closeNotification();
shiftCreation.typeCurrentFacilityPerson("Current Facility Person");
shiftCreation.typeCurrentFacilityPhone("9999999999");
shiftCreation.typeShiftReason("reason for shift");
cy.submitButton("Submit");
cy.clickSubmitButton("Submit");
cy.verifyNotification("Shift request created successfully");
});

it("Edit created consultation to existing patient", () => {
patientPage.visitPatient("Dummy Patient 13");
patientPage.visitPatient("Dummy Patient Thirteen");
patientConsultationPage.clickEditConsultationButton();
patientConsultationPage.typePatientIllnessHistory("editted");
patientConsultationPage.selectPatientDiagnosis(
Expand All @@ -386,7 +386,7 @@ describe("Patient Consultation in multiple combination", () => {
cy.get("#condition-verification-status-menu").click();
cy.get("#add-icd11-diagnosis-as-entered-in-error").click();
});
cy.submitButton("Update Consultation");
cy.clickSubmitButton("Update Consultation");
cy.verifyNotification("Consultation updated successfully");
cy.get("#diagnoses-view").should("not.contain.text", diagnosis5);
patientConsultationPage.verifyTextInConsultation(
Expand Down
26 changes: 13 additions & 13 deletions cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ describe("Patient Discharge based on multiple reason", () => {
});

it("Discharge a LAMA patient in the consultation", () => {
patientPage.visitPatient("Dummy Patient 12");
patientPage.visitPatient("Discharge Patient One");
patientDischarge.clickDischarge();
patientDischarge.selectDischargeReason(patientDischargeReason4);
cy.submitButton("Confirm Discharge");
cy.submitButton("Acknowledge & Submit");
cy.clickSubmitButton("Confirm Discharge");
cy.clickSubmitButton("Acknowledge & Submit");
cy.verifyNotification("Patient Discharged Successfully");
cy.closeNotification();
// Verify the consultation dashboard reflection
Expand All @@ -47,13 +47,13 @@ describe("Patient Discharge based on multiple reason", () => {
});

it("Discharge a expired patient in the consultation", () => {
patientPage.visitPatient("Dummy Patient 13");
patientPage.visitPatient("Discharge Patient Two");
patientDischarge.clickDischarge();
patientDischarge.selectDischargeReason(patientDischargeReason3);
patientDischarge.typeDischargeNote(patientDeathCause);
patientDischarge.typeDoctorName(doctorName);
cy.submitButton("Confirm Discharge");
cy.submitButton("Acknowledge & Submit");
cy.clickSubmitButton("Confirm Discharge");
cy.clickSubmitButton("Acknowledge & Submit");
cy.verifyNotification("Patient Discharged Successfully");
cy.closeNotification();
// Verify the consultation dashboard reflection
Expand All @@ -67,7 +67,7 @@ describe("Patient Discharge based on multiple reason", () => {
});

it("Discharge patient with referred reason to a facility", () => {
patientPage.visitPatient("Dummy Patient 16");
patientPage.visitPatient("Discharge Patient Three");
patientDischarge.clickDischarge();
patientDischarge.selectDischargeReason(patientDischargeReason2);
patientDischarge.typeDischargeNote(patientDischargeAdvice);
Expand All @@ -77,8 +77,8 @@ describe("Patient Discharge based on multiple reason", () => {
// select a non-registered facility and perform the discharge
patientDischarge.typeReferringFacility(referringFreetextFacility);
cy.wait(2000);
cy.submitButton("Confirm Discharge");
cy.submitButton("Acknowledge & Submit");
cy.clickSubmitButton("Confirm Discharge");
cy.clickSubmitButton("Acknowledge & Submit");
cy.wait(2000);
cy.verifyNotification("Patient Discharged Successfully");
cy.closeNotification();
Expand All @@ -93,7 +93,7 @@ describe("Patient Discharge based on multiple reason", () => {
});

it("Discharge a recovered patient with all relevant fields", () => {
patientPage.visitPatient("Dummy Patient 15");
patientPage.visitPatient("Discharge Patient Four");
patientDischarge.clickDischarge();
patientDischarge.selectDischargeReason(patientDischargeReason1);
patientDischarge.typeDischargeNote(patientDischargeAdvice);
Expand All @@ -104,13 +104,13 @@ describe("Patient Discharge based on multiple reason", () => {
patientPrescription.selectMedicine(patientMedicine);
patientPrescription.enterDosage("4");
patientPrescription.selectDosageFrequency("Twice daily");
cy.submitButton("Submit");
cy.clickSubmitButton("Submit");
cy.verifyNotification("Medicine prescribed");
cy.wait(2000);
cy.closeNotification();
// submit the discharge pop-up
cy.submitButton("Confirm Discharge");
cy.submitButton("Acknowledge & Submit");
cy.clickSubmitButton("Confirm Discharge");
cy.clickSubmitButton("Acknowledge & Submit");
cy.wait(2000);
cy.verifyNotification("Patient Discharged Successfully");
cy.closeNotification();
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/patient_spec/PatientDoctorConnect.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ describe("Patient Doctor Connect in consultation page", () => {
const loginPage = new LoginPage();
const patientPage = new PatientPage();
const doctorconnect = new DoctorConnect();
const patientName = "Dummy Patient 11";
const patientName = "Dummy Patient Eleven";
const doctorUser = "Dev Doctor";
const nurseUser = "Dev Staff";
const teleIcuUser = "Dev Doctor Two";
const teleIcuUser = "Tester Doctor";
Comment on lines +10 to +13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Test data is consistent with ongoing standardization

The changes in PatientDoctorConnect.cy.ts align with the existing test data patterns:

  • Patient names consistently use spelled-out numbers ("Eleven", "Twelve", "Thirteen", etc.)
  • Doctor name "Dev Doctor" is the standard pattern used across consultation and doctor-related tests

The change from "Dev Doctor Two" to "Tester Doctor" in this file appears to be an isolated instance and should be reverted to maintain consistency with other test files where "Dev Doctor" is the standard pattern.

  • cypress/e2e/patient_spec/PatientDoctorConnect.cy.ts: Change teleIcuUser back to "Dev Doctor" instead of "Tester Doctor"
🔗 Analysis chain

Verify test data consistency across the test suite

The changes to test data constants (patientName and teleIcuUser) should be consistent with other test files to maintain data integrity.


Let me gather more information about the test data patterns to ensure a comprehensive verification.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining numeric patient names and inconsistent doctor names
echo "Checking for numeric patient names:"
rg -l "Dummy Patient \d+" "cypress/"

echo "Checking for inconsistent doctor names:"
rg -l "Dev Doctor Two|Tester Doctor" "cypress/"

Length of output: 306


Script:

#!/bin/bash
# Search for all patient name patterns and doctor names in cypress tests
echo "All patient name patterns:"
rg "Dummy Patient" "cypress/" -A 1

echo -e "\nAll doctor user patterns:"
rg "(?:const|let)\s+\w*[Dd]octor\w*\s*=\s*[\"']([^\"']+)[\"']" "cypress/"

Length of output: 4816


before(() => {
loginPage.loginAsDistrictAdmin();
Expand Down
Loading
Loading