-
Notifications
You must be signed in to change notification settings - Fork 501
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 fixes#8299
Showing
50 changed files
with
1,148 additions
and
394 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import LoginPage from "../../pageobject/Login/LoginPage"; | ||
import PatientHome from "../../pageobject/Patient/PatientHome"; | ||
|
||
describe("Patient Homepage present functionalities", () => { | ||
const loginPage = new LoginPage(); | ||
const patientHome = new PatientHome(); | ||
|
||
before(() => { | ||
loginPage.loginAsDisctrictAdmin(); | ||
cy.saveLocalStorage(); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.restoreLocalStorage(); | ||
cy.clearLocalStorage(/filters--.+/); | ||
cy.awaitUrl("/patients"); | ||
}); | ||
|
||
it("Verify the functionality of the patient tab pagination", () => { | ||
let firstPatientPageOne: string; | ||
cy.get('[data-cy="patient"]') | ||
.first() | ||
.invoke("text") | ||
.then((patientOne: string) => { | ||
firstPatientPageOne = patientOne.trim(); | ||
patientHome.clickNextPage(); | ||
patientHome.verifySecondPageUrl(); | ||
cy.get('[data-cy="patient"]') | ||
.first() | ||
.invoke("text") | ||
.then((patientTwo: string) => { | ||
const firstPatientPageTwo = patientTwo.trim(); | ||
expect(firstPatientPageOne).not.to.eq(firstPatientPageTwo); | ||
patientHome.clickPreviousPage(); | ||
}); | ||
}); | ||
}); | ||
|
||
afterEach(() => { | ||
cy.saveLocalStorage(); | ||
}); | ||
}); |
Oops, something went wrong.