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.
Moved facility-cover-image-test to a new file
- Loading branch information
1 parent
5ae7257
commit 8e76e29
Showing
2 changed files
with
208 additions
and
180 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 FacilityPage from "../../pageobject/Facility/FacilityCreation"; | ||
import FacilityManage from "../../pageobject/Facility/FacilityManage"; | ||
|
||
const roleUserFacilities = [ | ||
{ username: "devdistrictadmin", facilityName: "Dummy Facility 40" }, | ||
{ username: "devdoctor", facilityName: "Dummy Facility 4" }, | ||
]; | ||
|
||
roleUserFacilities.forEach(({ username, facilityName }) => { | ||
describe("Facility Cover Image Functionality", () => { | ||
const facilityManage = new FacilityManage(); | ||
const facilityPage = new FacilityPage(); | ||
|
||
before(() => { | ||
cy.loginByApi(username, "Coronasafe@123"); | ||
cy.saveLocalStorage(); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.viewport(1280, 720); | ||
cy.restoreLocalStorage(); | ||
cy.clearLocalStorage(/filters--.+/); | ||
cy.awaitUrl("/"); | ||
facilityPage.typeFacilitySearch(facilityName); | ||
facilityPage.verifyFacilityBadgeContent(facilityName); | ||
facilityPage.visitAlreadyCreatedFacility(); | ||
}); | ||
|
||
it("Facility Cover Image button functionality", () => { | ||
// It's only button functionality because we can't access S3 bucket in local | ||
// Check: Cancel button functionality | ||
facilityManage.clickCoverImage(); | ||
facilityManage.clickCancelButton(); | ||
facilityManage.verifyCoverImageModalClosed(); | ||
// Check: upload an image, verifying the API response. | ||
facilityManage.clickCoverImage(); | ||
facilityManage.verifyUploadButtonVisible(); | ||
facilityManage.uploadCoverImage("facility-cover-image.jpg"); | ||
facilityManage.clickSaveCoverImage(); | ||
facilityManage.verifyCoverImageModalClosed(); | ||
// //Check: Edit the current cover image by uploading a new one, and verify the API response. | ||
facilityManage.clickCoverImage(); | ||
facilityManage.verifyUploadButtonVisible(); | ||
facilityManage.uploadCoverImage("new-facility-cover-image.jpg"); | ||
facilityManage.clickSaveCoverImage(); | ||
facilityManage.verifyCoverImageModalClosed(); | ||
//Check: Delete the existing cover image, confirming the API response. | ||
facilityManage.clickCoverImage(); | ||
facilityManage.clickDeleteCoverImage(); | ||
}); | ||
|
||
afterEach(() => { | ||
cy.saveLocalStorage(); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.