Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shivankacker committed Aug 16, 2024
1 parent c7020d8 commit 95cef4b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions cypress/e2e/patient_spec/patient_logupdate.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions cypress/e2e/shifting_spec/shifting.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down
10 changes: 5 additions & 5 deletions cypress/pageobject/Resource/ResourcePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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() {
Expand Down

0 comments on commit 95cef4b

Please sign in to comment.