From b8ed928c49d295995f1fcda3077c4872659034e7 Mon Sep 17 00:00:00 2001 From: Khavin Shankar Date: Mon, 23 Sep 2024 14:45:24 +0530 Subject: [PATCH] fixed cypress tests --- cypress/e2e/assets_spec/AssetHomepage.cy.ts | 1 + cypress/e2e/patient_spec/PatientPrescription.cy.ts | 1 + cypress/e2e/users_spec/UsersCreation.cy.ts | 1 + cypress/e2e/users_spec/UsersManage.cy.ts | 1 - cypress/pageobject/Users/ManageUserPage.ts | 10 ++++++++-- 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/assets_spec/AssetHomepage.cy.ts b/cypress/e2e/assets_spec/AssetHomepage.cy.ts index 0f6bfe4da2c..f462bda4327 100644 --- a/cypress/e2e/assets_spec/AssetHomepage.cy.ts +++ b/cypress/e2e/assets_spec/AssetHomepage.cy.ts @@ -98,6 +98,7 @@ describe("Asset Tab", () => { it("Export asset", () => { assetPage.selectassetimportbutton(); + cy.wait(2000); assetPage.selectjsonexportbutton(); assetPage.selectassetimportbutton(); assetPage.selectcsvexportbutton(); diff --git a/cypress/e2e/patient_spec/PatientPrescription.cy.ts b/cypress/e2e/patient_spec/PatientPrescription.cy.ts index a150bfa6e31..de4e121a9db 100644 --- a/cypress/e2e/patient_spec/PatientPrescription.cy.ts +++ b/cypress/e2e/patient_spec/PatientPrescription.cy.ts @@ -113,6 +113,7 @@ describe("Patient Medicine Administration", () => { cy.closeNotification(); // Administer the medicine in edit form patientPrescription.clickAdministerButton(); + cy.wait(2000); patientPrescription.enterAdministerDosage(medicineBaseDosage); patientPrescription.enterAdministerNotes(medicineAdministerNote); cy.submitButton("Administer Medicine"); diff --git a/cypress/e2e/users_spec/UsersCreation.cy.ts b/cypress/e2e/users_spec/UsersCreation.cy.ts index cc3a8250971..e24fdeca9e2 100644 --- a/cypress/e2e/users_spec/UsersCreation.cy.ts +++ b/cypress/e2e/users_spec/UsersCreation.cy.ts @@ -183,6 +183,7 @@ describe("User Creation", () => { it("create new user form throwing mandatory field error", () => { userCreationPage.clickElementById("addUserButton"); userCreationPage.clickElementById("submit"); + cy.wait(2000); userCreationPage.verifyErrorMessages(EXPECTED_ERROR_MESSAGES); }); diff --git a/cypress/e2e/users_spec/UsersManage.cy.ts b/cypress/e2e/users_spec/UsersManage.cy.ts index 9c339f4b8e3..0d3a757df0f 100644 --- a/cypress/e2e/users_spec/UsersManage.cy.ts +++ b/cypress/e2e/users_spec/UsersManage.cy.ts @@ -132,7 +132,6 @@ describe("Manage User", () => { manageUserPage.clickLinkFacility(); manageUserPage.clickUnlinkFacilityButton(); manageUserPage.clickSubmit(); - manageUserPage.assertnotLinkedFacility; manageUserPage.linkedfacilitylistnotvisible(); manageUserPage.clickCloseSlideOver(); // Go to particular facility doctor connect and all user-id are reflected based on there access diff --git a/cypress/pageobject/Users/ManageUserPage.ts b/cypress/pageobject/Users/ManageUserPage.ts index c57ecbf172f..41d41d218d4 100644 --- a/cypress/pageobject/Users/ManageUserPage.ts +++ b/cypress/pageobject/Users/ManageUserPage.ts @@ -142,8 +142,14 @@ export class ManageUserPage { } assertDoctorConnectVisibility(realName) { - cy.get("#doctor-connect-home-doctor").should("contain.text", realName); - cy.get("#doctor-connect-remote-doctor").should("contain.text", realName); + cy.get('*[id="doctor-connect-home-doctor"]').should( + "contain.text", + realName, + ); + cy.get('*[id="doctor-connect-remote-doctor"]').should( + "contain.text", + realName, + ); } assertVideoConnectLink(docName: string, link: string) {