forked from ohcnetwork/care_fe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into issues/9053/prevent-negative-quantity-and…
…-empty-description
- Loading branch information
Showing
34 changed files
with
810 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { PatientPage } from "pageobject/Patient/PatientCreation"; | ||
import PatientInvestigation from "pageobject/Patient/PatientInvestigation"; | ||
|
||
import LoginPage from "../../pageobject/Login/LoginPage"; | ||
|
||
describe("Patient Investigation Creation from Patient consultation page", () => { | ||
const loginPage = new LoginPage(); | ||
const patientPage = new PatientPage(); | ||
const patientInvestigation = new PatientInvestigation(); | ||
const patientName = "Dummy Patient 12"; | ||
|
||
before(() => { | ||
loginPage.loginAsDistrictAdmin(); | ||
cy.saveLocalStorage(); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.restoreLocalStorage(); | ||
cy.clearLocalStorage(/filters--.+/); | ||
cy.awaitUrl("/patients"); | ||
}); | ||
|
||
it("Create a investigation for a patient and verify its reflection", () => { | ||
patientPage.visitPatient(patientName); | ||
patientInvestigation.clickInvestigationTab(); | ||
patientInvestigation.clickLogLabResults(); | ||
patientInvestigation.selectInvestigationOption([ | ||
"Haematology", | ||
"Urine Test", | ||
]); | ||
cy.submitButton("Save Investigation"); | ||
cy.verifyNotification("Please Enter at least one value"); | ||
cy.closeNotification(); | ||
// Temporary workflow for investigation since we dont have dummy data and moving away from existing module | ||
}); | ||
|
||
afterEach(() => { | ||
cy.saveLocalStorage(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
export default class FacilityNotify { | ||
verifyFacilityName(facilityName: string) { | ||
cy.verifyContentPresence("#notify-facility-name", [facilityName]); | ||
} | ||
|
||
verifyErrorMessage(errorMessage: string) { | ||
cy.verifyContentPresence(".error-text", [errorMessage]); | ||
} | ||
|
||
fillNotifyText(message: string) { | ||
cy.get("#NotifyModalMessageInput").scrollIntoView(); | ||
cy.get("#NotifyModalMessageInput").click().type(message); | ||
} | ||
|
||
verifyFacilityNoticeBoardMessage(message: string) { | ||
cy.get("#notification-message", { timeout: 10000 }).should("be.visible"); | ||
cy.verifyContentPresence("#notification-message", [message]); | ||
} | ||
|
||
openNotificationSlide() { | ||
cy.get("#notification-slide-btn").should("be.visible").click(); | ||
} | ||
|
||
closeNotificationSlide() { | ||
cy.get("#close-slide-over").should("be.visible").click(); | ||
} | ||
|
||
visitNoticeBoard() { | ||
cy.get("a[href='/notice_board']").should("be.visible").click(); | ||
} | ||
|
||
visitNotificationSideBar() { | ||
cy.get("#notification-slide-btn").should("be.visible").click(); | ||
} | ||
|
||
verifyUrlContains(substring: string) { | ||
cy.url().should("include", substring); | ||
} | ||
|
||
interceptPostNotificationReq() { | ||
cy.intercept("POST", "**/api/v1/notification/notify").as("notifyFacility"); | ||
} | ||
|
||
verifyPostNotificationReq() { | ||
cy.wait("@notifyFacility").its("response.statusCode").should("eq", 204); | ||
} | ||
|
||
interceptGetNotificationReq(event: string = "") { | ||
cy.intercept( | ||
"GET", | ||
`**/api/v1/notification/?offset=0&event=${event}&*=SYSTEM`, | ||
).as("getNotifications"); | ||
} | ||
|
||
verifyGetNotificationReq() { | ||
cy.wait("@getNotifications").its("response.statusCode").should("eq", 200); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.