-
Notifications
You must be signed in to change notification settings - Fork 433
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
64 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import LoginPage from "../../pageobject/Login/LoginPage"; | ||
import { PatientPage } from "../../pageobject/Patient/PatientCreation"; | ||
import PatientLogupdate from "../../pageobject/Patient/PatientLogupdate"; | ||
import { PatientConsultationPage } from "../../pageobject/Patient/PatientConsultation"; | ||
|
||
describe("Patient swtich bed functionality", () => { | ||
const loginPage = new LoginPage(); | ||
const patientPage = new PatientPage(); | ||
const patientLogupdate = new PatientLogupdate(); | ||
const patientConsultationPage = new PatientConsultationPage(); | ||
const switchBedOne = "Dummy Bed 4"; | ||
const switchBedTwo = "Dummy Bed 1"; | ||
const switchBedThree = "Dummy Bed 3"; | ||
const switchPatientOne = "Dummy Patient 6"; | ||
const switchPatientTwo = "Dummy Patient 7"; | ||
|
||
before(() => { | ||
loginPage.loginAsDisctrictAdmin(); | ||
cy.saveLocalStorage(); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.restoreLocalStorage(); | ||
cy.clearLocalStorage(/filters--.+/); | ||
cy.awaitUrl("/patients"); | ||
}); | ||
|
||
it("Assign a bed for a admitted patient from update consultation page", () => { | ||
// Open the update consultation page and assign a bed | ||
patientPage.visitPatient(switchPatientTwo); | ||
patientConsultationPage.clickEditConsultationButton(); | ||
patientLogupdate.selectBed(switchBedThree); | ||
// verify the notification | ||
cy.verifyNotification("Bed allocated successfully"); | ||
}); | ||
|
||
it("Assign a bed for a admitted patient from patient dashboard", () => { | ||
// Assign a bed to a patient | ||
patientPage.visitPatient(switchPatientOne); | ||
patientLogupdate.clickSwitchBed(); | ||
patientLogupdate.selectBed(switchBedOne); | ||
cy.verifyNotification("Bed allocated successfully"); | ||
// Clear the bed and reassign | ||
patientLogupdate.clickSwitchBed(); | ||
cy.get("#clear-button").click(); | ||
patientLogupdate.selectBed(switchBedTwo); | ||
cy.verifyNotification("Bed allocated successfully"); | ||
// verify the card is reflected | ||
patientLogupdate.clickSwitchBed(); | ||
cy.verifyContentPresence("#previousbed-list", [switchBedOne, switchBedTwo]); | ||
}); | ||
|
||
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
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