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

Cypress tests replace cy.wait with cy.intercept or dynamic waits #8963

Open
wants to merge 83 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 65 commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
bb972f2
Cypress Tests cy.wait() replace with cy.intercept() or dynamic wait
Rishith25 Oct 28, 2024
f5d5cc8
Refactor Cypress tests: replaced static cy.wait() with dynamic waits …
Rishith25 Oct 29, 2024
a6f10ee
Merge branch 'develop' into cypress-tests-replace-cy.wait-with-cy.int…
Rishith25 Nov 8, 2024
f8cd9c8
Merge branch 'develop' into cypress-tests-replace-cy.wait-with-cy.int…
nihal467 Nov 8, 2024
814aebc
Resolved merge conflicts
Rishith25 Nov 23, 2024
568c7e2
Cypress test cases
Rishith25 Nov 24, 2024
f5734f6
Added intercept in Facility Inventory
Rishith25 Nov 26, 2024
ac1072c
Merge branch 'cypress-tests-replace-cy.wait-with-cy.intercept' of htt…
Rishith25 Nov 26, 2024
277fb42
reverting .env file
Rishith25 Nov 26, 2024
ef2c4a8
Merge branch 'develop' into cypress-tests-replace-cy.wait-with-cy.int…
Rishith25 Nov 30, 2024
88d7c77
cy.wait is replaced with cy.intercept in ManageUser
Rishith25 Nov 30, 2024
800d764
Testing for Wait in FacilityHomepage
Rishith25 Nov 30, 2024
58cd29e
Merge branch 'develop' into cypress-tests-replace-cy.wait-with-cy.int…
Rishith25 Dec 2, 2024
c6e95c2
AssetHomepage tests
Rishith25 Dec 2, 2024
8d4e83d
Add Precription intercept added
Rishith25 Dec 2, 2024
5ff8428
Wait added before medicine prescribed
Rishith25 Dec 2, 2024
f81f85f
Get request in consultationcreation
Rishith25 Dec 2, 2024
e47d2b0
Logupdate
Rishith25 Dec 2, 2024
c2fdb54
Merge branch 'develop' into cypress-tests-replace-cy.wait-with-cy.int…
Rishith25 Dec 4, 2024
443d438
AssetHomePage Wait removal
Rishith25 Dec 4, 2024
54eee2a
FacilityHomepage.cy.ts test case wait
Rishith25 Dec 4, 2024
1e55ab4
Patient Registration Waits
Rishith25 Dec 4, 2024
1d80441
revert PatientInsurance.ts
Rishith25 Dec 4, 2024
e461b91
Patient Consultation wait corrected
Rishith25 Dec 4, 2024
b4dfc9f
Paatient Discharge
Rishith25 Dec 4, 2024
c2bb8ba
Patient Consultation creation updated cypress
Rishith25 Dec 4, 2024
acdd07c
Patient discharge updated cypress
Rishith25 Dec 4, 2024
47d521b
Edit Consultation cypress test intercept added
Rishith25 Dec 4, 2024
a2a8cdf
FacilityHomepage wait
Rishith25 Dec 4, 2024
4a22cd4
Merge branch 'develop' into cypress-tests-replace-cy.wait-with-cy.int…
Rishith25 Dec 5, 2024
c2b454c
Merge branch 'develop' into cypress-tests-replace-cy.wait-with-cy.int…
Rishith25 Dec 5, 2024
2b282e4
PatientLogUpdate waits
Rishith25 Dec 5, 2024
f7a0281
PatientLogUpdate waits
Rishith25 Dec 5, 2024
3fa7459
PatientLogUpdate waits
Rishith25 Dec 5, 2024
60512d6
PatientLogUpdate waits
Rishith25 Dec 5, 2024
09d5f55
Merge branch 'develop' into cypress-tests-replace-cy.wait-with-cy.int…
Rishith25 Dec 6, 2024
c31f369
PatientLogUpdate new Progress log update
Rishith25 Dec 6, 2024
cf04eb7
PatientLogUpdate new Progress log update
Rishith25 Dec 6, 2024
5a4d28b
PatientLogUpdate new Progress log update
Rishith25 Dec 6, 2024
0c51eca
PatientLogUpdate new Normal log update
Rishith25 Dec 6, 2024
d4dd88b
PatientLogUpdate new Normal log update
Rishith25 Dec 6, 2024
36c6606
PatientLogUpdate new Normal log update
Rishith25 Dec 6, 2024
545ddd0
Merge branch 'develop' into cypress-tests-replace-cy.wait-with-cy.int…
Rishith25 Dec 6, 2024
228bbef
PatientLogUpdate new Normal log update
Rishith25 Dec 6, 2024
227ee29
PatientLogUpdate new Progress
Rishith25 Dec 6, 2024
c6d36b3
Patient Registration cy.wait with intercepts
Rishith25 Dec 6, 2024
e417e0d
Patient Registration cy.wait with intercepts
Rishith25 Dec 7, 2024
e8140a3
Patient Discharge cy.wait
Rishith25 Dec 7, 2024
307a1b1
Patient LogUpdate reflection cards
Rishith25 Dec 7, 2024
02fc708
Facility Homepage cy.wait
Rishith25 Dec 7, 2024
d9b8539
Facility Homepage cy.wait
Rishith25 Dec 7, 2024
5e844f9
Patient Doctor Notes, File Upload cy.wait
Rishith25 Dec 7, 2024
943bb79
Patient Registration cy.waits
Rishith25 Dec 7, 2024
582e982
Patient File Upload cy.wait
Rishith25 Dec 7, 2024
a6f2bf1
Patient File Upload cy.wait
Rishith25 Dec 7, 2024
c88bce8
Patient File Upload cy.wait
Rishith25 Dec 8, 2024
18f1ccd
Patient Registration wait
Rishith25 Dec 8, 2024
48eb1a1
Patient Registration Edit Button
Rishith25 Dec 8, 2024
2c00829
Patient Edit details
Rishith25 Dec 8, 2024
29906d2
Patient File Upload with waits
Rishith25 Dec 8, 2024
1099d9a
Patient File Upload with waits
Rishith25 Dec 8, 2024
da4f978
Merge branch 'develop' into cypress-tests-replace-cy.wait-with-cy.int…
Rishith25 Dec 11, 2024
1ccab9c
Reusable functions for intercepts in cypress testcases
Rishith25 Dec 11, 2024
eee4f1a
Reusable functions for intercepts in cypress testcases
Rishith25 Dec 11, 2024
c16381c
User Manage Test Cases updated
Rishith25 Dec 11, 2024
4dda5aa
User Manage Test Cases updated
Rishith25 Dec 11, 2024
d016b30
Merge branch 'develop' into cypress-tests-replace-cy.wait-with-cy.int…
Rishith25 Dec 11, 2024
c7c035b
UserManage test cases
Rishith25 Dec 11, 2024
d835081
UserManage
Rishith25 Dec 11, 2024
612aaae
Merge branch 'develop' into cypress-tests-replace-cy.wait-with-cy.int…
Rishith25 Dec 12, 2024
145edec
AddSkillButton with username
Rishith25 Dec 12, 2024
f6fa2d9
Merge branch 'develop' into cypress-tests-replace-cy.wait-with-cy.int…
Rishith25 Dec 12, 2024
fede9a6
AssetsManage and AssetHomepage cypress tests
Rishith25 Dec 13, 2024
94ab84e
Merge branch 'develop' into cypress-tests-replace-cy.wait-with-cy.int…
Rishith25 Dec 13, 2024
962d6ca
FacilityCreation cypress tests
Rishith25 Dec 13, 2024
559f5a7
Merge branch 'develop' into cypress-tests-replace-cy.wait-with-cy.int…
Rishith25 Dec 14, 2024
8f0b0f2
Facility deletion test case resolve
Rishith25 Dec 14, 2024
c951801
Facility creation error resolved
Rishith25 Dec 14, 2024
edafae3
fixed the cypress test
Rishith25 Dec 15, 2024
32ea381
Merge branch 'develop' into cypress-tests-replace-cy.wait-with-cy.int…
Rishith25 Dec 15, 2024
dd9bc77
fixed the cypress test
Rishith25 Dec 15, 2024
46607cd
fcility creation test
Rishith25 Dec 15, 2024
31258b8
fcility creation test
Rishith25 Dec 15, 2024
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
1 change: 0 additions & 1 deletion cypress/e2e/assets_spec/AssetHomepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ rolesToTest.forEach((role) => {
it("Export the list of assets in CSV & Json", () => {
if (role === "districtAdmin") {
assetHome.selectAssetImportButton("click");
cy.wait(2000);
assetHome.selectJsonExportButton();
assetHome.selectAssetImportButton("click");
assetHome.selectCsvExportButton();
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/facility_spec/FacilityCreation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ describe("Facility Creation", () => {
facilityPage.clickManageFacilityDropdown();
facilityPage.clickDeleteFacilityOption();
facilityPage.confirmDeleteFacility();
cy.verifyNotification("Facility deleted successfully");
cy.verifyNotification(`${facilityName} deleted successfully`);
});

it("Create a new facility with single bed and doctor capacity", () => {
Expand Down
13 changes: 9 additions & 4 deletions cypress/e2e/facility_spec/FacilityInventory.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,20 @@ describe("Inventory Management Section", () => {

it("Add New Inventory | Modify data and delete last entry ", () => {
// add a new item
facilityPage.interceptManageInventoryItem();
facilityPage.clickManageInventory();
facilityPage.verifyManageInventoryItem();
facilityPage.fillInventoryDetails("PPE", "Add Stock", "10");
facilityPage.clickAddInventory();
facilityPage.verifySuccessNotification("Inventory created successfully");
cy.closeNotification();
facilityPage.clickManageInventory();
// modify the new item
facilityPage.fillInventoryDetails("PPE", "Use Stock", "5");
facilityPage.clickAddInventory();
facilityPage.verifySuccessNotification("Inventory created successfully");
facilityPage.verifySuccessNotification(
"Inventory use stock updated successfully",
);
// verify the new modification
facilityPage.verifyPpeQuantity("PPE");
facilityPage.verifyPpeQuantity("5");
Expand All @@ -43,7 +48,6 @@ describe("Inventory Management Section", () => {
// verify the last entry deletion
facilityPage.verifyStockInRow("#row-0", "Added Stock");
facilityPage.verifyStockInRow("#row-1", "Used Stock");
cy.wait(3000);
Rishith25 marked this conversation as resolved.
Show resolved Hide resolved
facilityHome.navigateBack();
facilityPage.verifyPpeQuantity("PPE");
});
Expand All @@ -57,9 +61,10 @@ describe("Inventory Management Section", () => {
cy.closeNotification();
// Verify Backend minimum badge
facilityPage.verifyBadgeWithText(".badge-danger", "Low Stock");
facilityPage.interceptMinimumQuantity();
// modify with manual minimum badge
facilityPage.clickAddMinimumQuanitity();
cy.wait(3000);
Rishith25 marked this conversation as resolved.
Show resolved Hide resolved
facilityPage.clickAddMinimumQuantity();
facilityPage.verifyMinimumQuantity();
cy.get("body").then(($body) => {
if ($body.find("#update-minimum-quantity").is(":visible")) {
// If the 'update-minimum-quantity' element is visible, click it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ describe("Patient Consultation in multiple combination", () => {
patientPrescription.selectMedicine(medicineOne);
patientPrescription.enterDosage("3");
patientPrescription.selectDosageFrequency("Twice daily");
patientPrescription.interceptPrescriptions();
cy.clickSubmitButton("Submit");
cy.wait(2000);
patientPrescription.verifyPrescription();
cy.verifyNotification("Medicine prescribed");
patientPrescription.clickReturnToDashboard();
// Verify the data's across the dashboard
Expand Down Expand Up @@ -376,7 +377,9 @@ describe("Patient Consultation in multiple combination", () => {

it("Edit created consultation to existing patient", () => {
patientPage.visitPatient("Dummy Patient Thirteen");
patientConsultationPage.interceptConsultation();
patientConsultationPage.clickEditConsultationButton();
patientConsultationPage.verifyConsultation();
patientConsultationPage.typePatientIllnessHistory("editted");
patientConsultationPage.selectPatientDiagnosis(
diagnosis5,
Expand Down
12 changes: 8 additions & 4 deletions cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ describe("Patient Discharge based on multiple reason", () => {
patientDischarge.clickDischarge();
patientDischarge.selectDischargeReason(patientDischargeReason4);
cy.clickSubmitButton("Confirm Discharge");
patientDischarge.interceptDischargePatient();
cy.clickSubmitButton("Acknowledge & Submit");
patientDischarge.verifyDischargePatient();
cy.verifyNotification("Patient Discharged Successfully");
cy.closeNotification();
// Verify the consultation dashboard reflection
Expand All @@ -53,7 +55,9 @@ describe("Patient Discharge based on multiple reason", () => {
patientDischarge.typeDischargeNote(patientDeathCause);
patientDischarge.typeDoctorName(doctorName);
cy.clickSubmitButton("Confirm Discharge");
patientDischarge.interceptDischargePatient();
cy.clickSubmitButton("Acknowledge & Submit");
patientDischarge.verifyDischargePatient();
cy.verifyNotification("Patient Discharged Successfully");
cy.closeNotification();
// Verify the consultation dashboard reflection
Expand All @@ -76,10 +80,10 @@ describe("Patient Discharge based on multiple reason", () => {
patientDischarge.clickClearButton();
// select a non-registered facility and perform the discharge
patientDischarge.typeReferringFacility(referringFreetextFacility);
cy.wait(2000);
cy.clickSubmitButton("Confirm Discharge");
patientDischarge.interceptDischargePatient();
cy.clickSubmitButton("Acknowledge & Submit");
cy.wait(2000);
Rishith25 marked this conversation as resolved.
Show resolved Hide resolved
patientDischarge.verifyDischargePatient();
cy.verifyNotification("Patient Discharged Successfully");
cy.closeNotification();
// Verify the consultation dashboard reflection
Expand All @@ -106,13 +110,13 @@ describe("Patient Discharge based on multiple reason", () => {
patientPrescription.selectDosageFrequency("Twice daily");
cy.clickSubmitButton("Submit");
cy.verifyNotification("Medicine prescribed");
cy.wait(2000);
cy.closeNotification();
// submit the discharge pop-up
cy.clickSubmitButton("Confirm Discharge");
patientDischarge.interceptDischargePatient();
cy.clickSubmitButton("Acknowledge & Submit");
cy.wait(2000);
cy.verifyNotification("Patient Discharged Successfully");
patientDischarge.verifyDischargePatient();
Rishith25 marked this conversation as resolved.
Show resolved Hide resolved
cy.closeNotification();
// Verify the consultation dashboard reflection
cy.verifyContentPresence("#consultation-buttons", ["Recovered"]);
Expand Down
3 changes: 2 additions & 1 deletion cypress/e2e/patient_spec/PatientHomepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,9 @@ describe("Patient Homepage present functionalities", () => {
.invoke("text")
.then((patientOne: string) => {
firstPatientPageOne = patientOne.trim();
pageNavigation.interceptPatientNavigation();
pageNavigation.navigateToNextPage();
cy.wait(2000);
pageNavigation.verifyPatientNavigation();
pageNavigation.verifyCurrentPageNumber(2);
cy.get('[data-cy="patient"]')
.first()
Expand Down
19 changes: 17 additions & 2 deletions cypress/e2e/patient_spec/PatientLogUpdate.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.clickSubmitButton("Update Consultation");
cy.verifyNotification("Consultation updated successfully");
cy.closeNotification();
patientPage.interceptGetPatient();
patientLogupdate.clickLogupdate();
patientPage.verifyGetPatientResponse();
patientLogupdate.typePhysicalExamination(physicalExamination);
patientLogupdate.selectRoundType("Tele-medicine Log");
patientLogupdate.selectPatientCategory(patientCategory);
Expand All @@ -80,11 +82,15 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {

it("Create a new Progress log update for a admitted patient and edit it", () => {
patientPage.visitPatient(patientOne);
patientLogupdate.interceptConsultationBed();
patientLogupdate.clickLogupdate();
patientLogupdate.verifyConsultationBed();
cy.verifyNotification("Please assign a bed to the patient");
patientLogupdate.selectBed(bedOne);
cy.closeNotification();
patientPage.interceptGetPatient();
patientLogupdate.clickLogupdate();
patientPage.verifyGetPatientResponse();
// Only will be using random non-unique progress note fields
patientLogupdate.selectRoundType("Progress Note");
patientLogupdate.selectPatientCategory(patientCategory);
Expand Down Expand Up @@ -112,15 +118,18 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.verifyNotification("Medicine prescribed");
cy.closeNotification();
// Submit the doctors log update
patientLogupdate.interceptDailyRounds();
cy.clickSubmitButton("Save and Continue");
cy.wait(2000);
patientLogupdate.verifyDailyRounds();
cy.verifyNotification("Progress Note created successfully");
cy.closeNotification();
// modify the relevant critical care log update
patientLogupdate.selectCriticalCareSection("Neurological Monitoring");
cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click();
cy.get("#left_pupil_light_reaction-option-FIXED").click();
patientLogupdate.interceptpatchDailyRounds();
cy.clickSubmitButton("Update Details");
patientLogupdate.verifypatchDailyRounds();
cy.verifyNotification(
"Neurological Monitoring details succesfully updated.",
);
Expand Down Expand Up @@ -156,7 +165,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.clickLogupdate();
patientLogupdate.selectRoundType("Detailed Update");
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.interceptDailyRounds();
cy.clickSubmitButton("Save and Continue");
patientLogupdate.verifyDailyRounds();
cy.verifyNotification("Detailed Update created successfully");
cy.closeNotification();
// Select two Section - First One is Respiratory Support
Expand Down Expand Up @@ -235,7 +246,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.verifyNotification("Please assign a bed to the patient");
patientLogupdate.selectBed(bedThree);
cy.closeNotification();
patientPage.interceptGetPatient();
patientLogupdate.clickLogupdate();
patientPage.verifyGetPatientResponse();
patientLogupdate.typePhysicalExamination(physicalExamination);
patientLogupdate.selectPatientCategory(patientCategory);
patientLogupdate.typeOtherDetails(otherExamination);
Expand All @@ -251,9 +264,11 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.selectRhythm(patientRhythmType);
patientLogupdate.typeRhythm(patientRhythm);
cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click();
patientConsultationPage.interceptConsultation();
cy.clickSubmitButton("Save");
cy.wait(2000);
patientConsultationPage.verifyConsultation();
cy.verifyNotification("Brief Update created successfully");
cy.closeNotification();
// Verify the card content
cy.get("#basic-information").scrollIntoView();
cy.verifyContentPresence("#encounter-symptoms", [additionalSymptoms]);
Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/patient_spec/PatientPrescription.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ describe("Patient Medicine Administration", () => {
cy.closeNotification();
// Administer the medicine in edit form
patientPrescription.clickAdministerButton();
cy.wait(2000);
patientPrescription.enterAdministerDosage(medicineBaseDosage);
patientPrescription.enterAdministerNotes(medicineAdministerNote);
cy.clickSubmitButton("Administer Medicine");
Expand Down
8 changes: 3 additions & 5 deletions cypress/e2e/patient_spec/PatientRegistration.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ describe("Patient Creation with consultation", () => {
patientPage.verifyPatientIsCreated();
// Verify the patient details
patientPage.clickCancelButton();
cy.wait(3000);
patientPage.savePatientUrl();
patientPage.verifyPatientDashboardDetails(
patientOneGender,
Expand Down Expand Up @@ -156,8 +155,8 @@ describe("Patient Creation with consultation", () => {
patientPage.visitUpdatePatientUrl();
patientPage.verifyStatusCode();
patientPage.patientformvisibility();
// change the gender to female and input data to related changed field
cy.wait(3000);
// change the gender to female and input data to related changed field
patientPage.selectPatientGender(patientOneUpdatedGender);
patientPage.typePatientDateOfBirth(patientDateOfBirth);
patientPage.clickPatientAntenatalStatusYes();
Expand Down Expand Up @@ -198,11 +197,11 @@ describe("Patient Creation with consultation", () => {
patientOneSecondInsurerName,
);
patientPage.clickUpdatePatient();
cy.wait(3000);
patientPage.verifyPatientUpdated();
patientPage.interceptGetPatient();
patientPage.visitPatientUrl();
patientPage.verifyGetPatientResponse();
// Verify Female Gender change reflection, No Medical History and Insurance Details
cy.wait(5000);
patientPage.verifyPatientDashboardDetails(
patientOneUpdatedGender,
age,
Expand All @@ -219,7 +218,6 @@ describe("Patient Creation with consultation", () => {
cy.get("[data-testid=patient-details]")
.contains("Member ID")
.scrollIntoView();
cy.wait(2000);
patientInsurance.verifyPatientPolicyDetails(
patientOneFirstSubscriberId,
patientOneFirstPolicyId,
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/users_spec/UsersCreation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ describe("User Creation", () => {
userProfilePage.clearWorkingHours();
userProfilePage.typeWorkingHours(weeklyWorkingHrs);
userProfilePage.typeDateOfBirth(dob);
cy.intercept("PATCH", "/api/v1/users/*").as("updateUser");
userProfilePage.interceptUpdateUsers();
userProfilePage.clickUpdateButton();
cy.wait("@updateUser").its("response.statusCode").should("eq", 200);
userProfilePage.verifyUpdateUsersResponse();
cy.verifyContentPresence("#contactno-profile-details", [
"+91" + phoneNumber,
]);
Expand Down Expand Up @@ -158,9 +158,9 @@ describe("User Creation", () => {
userCreationPage.selectGender(gender);
userCreationPage.selectState(state);
userCreationPage.selectDistrict(district);
cy.intercept("POST", "/api/v1/users/add_user/").as("createUser");
userCreationPage.interceptCreateUser();
userCreationPage.clickSaveUserButton();
cy.wait("@createUser").its("response.statusCode").should("eq", 201);
userCreationPage.verifyCreateUser();
cy.verifyNotification("User added successfully");
userPage.typeInSearchInput(username);
userPage.checkUsernameText(username);
Expand Down
7 changes: 4 additions & 3 deletions cypress/e2e/users_spec/UsersManage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,15 @@ describe("Manage User", () => {
userPage.checkUsernameText(usernameforworkinghour);
manageUserPage.clickMoreDetailsButton(usernameforworkinghour);
manageUserPage.verifyMoreDetailsPage();
manageUserPage.interceptLinkedSkillTab();
manageUserPage.clickLinkedSkillTab();
cy.wait(500);
manageUserPage.verifyLinkedSkillResponse();
manageUserPage.verifyLinkedSkillsTabPage();
manageUserPage.selectSkillFromDropdown(linkedskill);
manageUserPage.interceptAddSkill();
manageUserPage.clickAddSkillButton();
cy.wait(500);
manageUserPage.verifyAddSkillResponse();
manageUserPage.assertSkillInAddedUserSkills(linkedskill);
cy.wait(500);
manageUserPage.navigateToProfile();
cy.verifyContentPresence("#username-profile-details", [
usernameforworkinghour,
Expand Down
6 changes: 3 additions & 3 deletions cypress/pageobject/Asset/AssetHome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,21 @@ export class AssetHome {
selectAssetImportButton(action: "click" | "verifyNotExist"): void {
const selector = "[data-testid=import-asset-button]";
if (action === "click") {
cy.get(selector).click();
cy.get(selector).scrollIntoView().should("be.visible").click();
} else if (action === "verifyNotExist") {
cy.get(selector).should("not.exist");
}
}

selectJsonExportButton() {
cy.intercept("GET", "**/api/v1/asset/?**json=true**").as("getJsonexport");
cy.get("#export-json-option").click();
cy.get("#export-json-option").should("be.visible").click();
cy.wait("@getJsonexport").its("response.statusCode").should("eq", 200);
}

selectCsvExportButton() {
cy.intercept("GET", "**/api/v1/asset/?**csv=true**").as("getCsvexport");
cy.get("#export-csv-option").click();
cy.get("#export-csv-option").should("be.visible").click();
cy.wait("@getCsvexport").its("response.statusCode").should("eq", 200);
}

Expand Down
29 changes: 22 additions & 7 deletions cypress/pageobject/Facility/FacilityCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,7 @@ class FacilityPage {
cy.get("#facility-location-button").click();
cy.wait("@mapApi").its("response.statusCode").should("eq", 200);
cy.get("input#pac-input").type(location).type("{enter}");
cy.wait(2000);
cy.get("div#map-close").click();
cy.get("div#map-close").should("be.visible").click();
}

fillMiddleWareAddress(url: string) {
Expand Down Expand Up @@ -322,21 +321,27 @@ class FacilityPage {
cy.url().should("include", "/assets?facility=");
}

interceptManageInventoryItem() {
cy.intercept("GET", "/api/v1/items/**").as("getItems");
}

clickManageInventory() {
cy.contains("Manage Inventory").click();
}

verifyManageInventoryItem() {
cy.wait("@getItems").its("response.statusCode").should("eq", 200);
}

fillInventoryDetails(name: string, status: string, quantity: string) {
cy.wait(2000);
cy.get("div#id").click();
cy.get("div#id ul li").contains(name).click();
cy.get("div#isIncoming").click();
cy.get("div#isIncoming ul li").contains(status).click();
cy.get("div#id").click();
cy.get("div#id ul li").contains(name).click();
Rishith25 marked this conversation as resolved.
Show resolved Hide resolved
cy.get("[name='quantity']").type(quantity);
}

fillInventoryMinimumDetails(name: string, quantity: string) {
cy.wait(2000);
cy.get("div#id").click();
cy.get("div#id ul li").contains(name).click();
cy.get("[name='quantity']").type(quantity);
Expand Down Expand Up @@ -438,10 +443,20 @@ class FacilityPage {
cy.get(badgeClass).contains(text).should("exist");
}

clickAddMinimumQuanitity() {
interceptMinimumQuantity() {
cy.intercept("GET", "**/api/v1/facility/*/min_quantity/**").as(
"getMinQuantity",
);
}

clickAddMinimumQuantity() {
cy.get("#add-minimum-quantity").click();
}

verifyMinimumQuantity() {
cy.wait("@getMinQuantity").its("response.statusCode").should("eq", 200);
}

clickUpdateMinimumQuantity() {
cy.get("#update-minimum-quantity").first().click();
}
Expand Down
Loading
Loading