diff --git a/cypress/e2e/patient_spec/patient_logupdate.cy.ts b/cypress/e2e/patient_spec/patient_logupdate.cy.ts index 8512f0754b9..199931edce9 100644 --- a/cypress/e2e/patient_spec/patient_logupdate.cy.ts +++ b/cypress/e2e/patient_spec/patient_logupdate.cy.ts @@ -87,7 +87,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { cy.verifyNotification("Brief Update log created successfully"); cy.closeNotification(); // edit the card and verify the data. - cy.contains("Daily Rounds").eq(1).click(); + cy.contains("button", "Daily Rounds").click(); patientLogupdate.clickLogupdateCard("#dailyround-entry", patientCategory); cy.verifyContentPresence("#consultation-preview", [ patientCategory, @@ -108,7 +108,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { patientLogupdate.typeDiastolic(patientModifiedDiastolic); cy.submitButton("Continue"); cy.verifyNotification("Brief Update log updated successfully"); - cy.contains("Daily Rounds").eq(1).click(); + cy.contains("button", "Daily Rounds").click(); patientLogupdate.clickLogupdateCard("#dailyround-entry", patientCategory); cy.verifyContentPresence("#consultation-preview", [ patientModifiedDiastolic, diff --git a/cypress/e2e/shifting_spec/shifting.cy.ts b/cypress/e2e/shifting_spec/shifting.cy.ts index 6ab479557c4..f33278cbec4 100644 --- a/cypress/e2e/shifting_spec/shifting.cy.ts +++ b/cypress/e2e/shifting_spec/shifting.cy.ts @@ -32,13 +32,13 @@ describe("Shifting Page", () => { it("switch between active/archived", () => { cy.intercept(/\/api\/v1\/shift/).as("shifting"); - cy.contains("Archived").eq(1).click().wait("@shifting"); - cy.contains("Active").eq(1).should("have.class", "text-primary-500"); - cy.contains("Archived").eq(1).should("have.class", "text-white"); + cy.contains("button", "Archived").click().wait("@shifting"); + cy.contains("button", "Active").should("have.class", "text-primary-500"); + cy.contains("button", "Archived").should("have.class", "text-white"); cy.intercept(/\/api\/v1\/shift/).as("shifting"); - cy.contains("Active").eq(1).click().wait("@shifting"); - cy.contains("Active").eq(1).should("have.class", "text-white"); - cy.contains("Archived").eq(1).should("have.class", "text-primary-500"); + cy.contains("button", "Active").click().wait("@shifting"); + cy.contains("button", "Active").should("have.class", "text-white"); + cy.contains("button", "Archived").should("have.class", "text-primary-500"); }); afterEach(() => { diff --git a/cypress/pageobject/Resource/ResourcePage.ts b/cypress/pageobject/Resource/ResourcePage.ts index 3f5fec4e8af..58a77790e3d 100644 --- a/cypress/pageobject/Resource/ResourcePage.ts +++ b/cypress/pageobject/Resource/ResourcePage.ts @@ -15,15 +15,15 @@ class ResourcePage { } clickCompletedResources() { - cy.contains("Completed").eq(1).click(); + cy.contains("button", "Completed").click(); } verifyCompletedResources() { cy.wait("@resource").then((interception) => { expect(interception.response.statusCode).to.equal(200); }); - cy.contains("Active").eq(1).should("have.class", "text-primary-500"); - cy.contains("Completed").eq(1).should("have.class", "text-white"); + cy.contains("button", "Active").should("have.class", "text-primary-500"); + cy.contains("button", "Completed").should("have.class", "text-white"); } clickActiveResources() { @@ -34,8 +34,8 @@ class ResourcePage { cy.wait("@resource").then((interception) => { expect(interception.response.statusCode).to.equal(200); }); - cy.contains("Active").eq(1).should("have.class", "text-white"); - cy.contains("Completed").eq(1).should("have.class", "text-primary-500"); + cy.contains("button", "Active").should("have.class", "text-white"); + cy.contains("button", "Completed").should("have.class", "text-primary-500"); } clickListViewButton() {