Skip to content

Commit

Permalink
Merge branch 'develop' into issue/9398/search_bar_loses_focus
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaJ2305 authored Dec 23, 2024
2 parents 95fc767 + 79e098e commit ab82beb
Show file tree
Hide file tree
Showing 30 changed files with 1,227 additions and 2,162 deletions.
8 changes: 1 addition & 7 deletions cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,8 @@ describe("Patient Discharge based on multiple reason", () => {
patientDischarge.interceptDischargePatient();
cy.clickSubmitButton("Acknowledge & Submit");
patientDischarge.verifyDischargePatient();
cy.verifyNotification("Patient Discharged Successfully");
// Verify the consultation dashboard reflection
cy.verifyContentPresence("#consultation-buttons", ["Recovered"]);
// Verify the dashboard and discharge information
cy.verifyContentPresence("#discharge-information", [
patientDischargeReason1,
patientDischargeAdvice,
patientMedicine,
]);
});

afterEach(() => {
Expand Down
83 changes: 9 additions & 74 deletions cypress/e2e/users_spec/UsersCreation.cy.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
import FacilityHome from "pageobject/Facility/FacilityHome";
import ManageUserPage from "pageobject/Users/ManageUserPage";
import UserProfilePage from "pageobject/Users/UserProfilePage";
import { advanceFilters } from "pageobject/utils/advanceFilterHelpers";

import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import LoginPage from "../../pageobject/Login/LoginPage";
import { ManageUserPage } from "../../pageobject/Users/ManageUserPage";
import { UserCreationPage } from "../../pageobject/Users/UserCreation";
import { UserPage } from "../../pageobject/Users/UserSearch";
import {
generateEmergencyPhoneNumber,
generatePhoneNumber,
} from "../../pageobject/utils/constants";
import { generatePhoneNumber } from "../../pageobject/utils/constants";

describe("User Creation", () => {
const userPage = new UserPage();
const loginPage = new LoginPage();
const userProfilePage = new UserProfilePage();
const manageUserPage = new ManageUserPage();
const userCreationPage = new UserCreationPage();
const manageUserPage = new ManageUserPage();
const facilityPage = new FacilityPage();
const facilityHome = new FacilityHome();
const phoneNumber = generatePhoneNumber();
const emergencyPhoneNumber = generateEmergencyPhoneNumber();
const fillFacilityName = "Dummy Facility 40";
const makeId = (length: number) => {
let result = "";
Expand Down Expand Up @@ -54,14 +48,6 @@ describe("User Creation", () => {
"Please select the local body",
];

const EXPECTED_PROFILE_ERROR_MESSAGES = [
"This field is required",
"This field is required",
"Please enter valid phone number",
];
const userName = "devdistrictadmin";
const firstName = "District Editted";
const lastName = "Cypress";
const gender = "Male";
const email = "[email protected]";
const password = "Test@123";
Expand All @@ -74,9 +60,6 @@ describe("User Creation", () => {
const district = "Ernakulam";
const role = "Doctor";
const homeFacility = "Dummy Shifting Center";
const weeklyWorkingHrs = "14";
const dob = "01011998";
const formattedDob = "01/01/1998";
const newUserDob = "25081999";

before(() => {
Expand All @@ -90,55 +73,6 @@ describe("User Creation", () => {
cy.awaitUrl("/users");
});

it("Update the existing user profile and verify its reflection", () => {
manageUserPage.navigateToProfile();
cy.verifyContentPresence("#username-profile-details", [userName]);
userProfilePage.clickEditProfileButton();
userCreationPage.clearFirstName();
userCreationPage.typeFirstName(firstName);
userCreationPage.clearLastName();
userCreationPage.typeLastName(lastName);
userProfilePage.selectGender(gender);
userProfilePage.clearPhoneNumber();
userProfilePage.typePhoneNumber(phoneNumber);
userProfilePage.clearAltPhoneNumber();
userProfilePage.typeWhatsappNumber(emergencyPhoneNumber);
userProfilePage.clearEmail();
userProfilePage.typeEmail(email);
userProfilePage.clearWorkingHours();
userProfilePage.typeWorkingHours(weeklyWorkingHrs);
userProfilePage.typeDateOfBirth(dob);
userProfilePage.interceptUpdateUsers();
userProfilePage.clickUpdateButton();
userProfilePage.verifyUpdateUsersResponse();
cy.verifyContentPresence("#contactno-profile-details", [
"+91" + phoneNumber,
]);
cy.verifyContentPresence("#whatsapp-profile-details", [
"+91" + emergencyPhoneNumber,
]);
cy.verifyContentPresence("#firstname-profile-details", [firstName]);
cy.verifyContentPresence("#lastname-profile-details", [lastName]);
cy.verifyContentPresence("#date_of_birth-profile-details", [formattedDob]);
cy.verifyContentPresence("#emailid-profile-details", [email]);
cy.verifyContentPresence("#gender-profile-details", [gender]);
cy.verifyContentPresence("#averageworkinghour-profile-details", [
weeklyWorkingHrs,
]);
});

it("Update the existing user profile Form Mandatory File Error", () => {
manageUserPage.navigateToProfile();
userProfilePage.clickEditProfileButton();
userCreationPage.clearFirstName();
userCreationPage.clearLastName();
userProfilePage.clearPhoneNumber();
userProfilePage.clearAltPhoneNumber();
userProfilePage.clearWorkingHours();
userProfilePage.clickUpdateButton();
cy.verifyErrorMessages(EXPECTED_PROFILE_ERROR_MESSAGES);
});

it("create new user and verify reflection", () => {
userCreationPage.clickAddUserButton();
userCreationPage.selectFacility(homeFacility);
Expand All @@ -147,14 +81,14 @@ describe("User Creation", () => {
userCreationPage.typeConfirmPassword(password);
userCreationPage.selectHomeFacility(homeFacility);
userPage.typeInPhoneNumber(phoneNumber);
userProfilePage.typeDateOfBirth(newUserDob);
manageUserPage.editDateOfBirth(newUserDob);
userCreationPage.selectUserType(role);
userProfilePage.typeQualification(qualification);
userProfilePage.typeDoctorYoE(experience);
userProfilePage.typeMedicalCouncilRegistration(regNo);
manageUserPage.editQualification(qualification, false);
manageUserPage.editDoctorYoE(experience, false);
manageUserPage.editMedicalCouncilRegistration(regNo, false);
userPage.typeInFirstName(newUserFirstName);
userPage.typeInLastName(newUserLastName);
userProfilePage.typeEmail(email);
manageUserPage.editEmail(email, false);
userCreationPage.selectGender(gender);
userCreationPage.selectState(state);
userCreationPage.selectDistrict(district);
Expand All @@ -178,6 +112,7 @@ describe("User Creation", () => {
});

it("view user redirection from facility page", () => {
loginPage.ensureLoggedIn();
facilityHome.navigateToFacilityHomepage();
facilityHome.typeFacilitySearch(fillFacilityName);
advanceFilters.verifyFilterBadgePresence(
Expand Down
Loading

0 comments on commit ab82beb

Please sign in to comment.