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.
Add Cypress Test Suit to Verify Notify Facility
- Loading branch information
1 parent
c27f595
commit 66d6ef4
Showing
7 changed files
with
97 additions
and
11 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,36 @@ | ||
export class FacilityNotify { | ||
fillNotifyText(message: string): void { | ||
cy.get("#NotifyModalMessageInput").should("be.visible").type(message); | ||
} | ||
|
||
visitNoticeBoard(): void { | ||
cy.get("a[href='/notice_board']").should("be.visible").click(); | ||
} | ||
|
||
visitNotificationSideBar(): void { | ||
cy.get("#notification-slide-btn").should("be.visible").click(); | ||
} | ||
|
||
interceptFacilitySearchReq(): void { | ||
cy.intercept("GET", "**/api/v1/facility/**").as("searchFacility"); | ||
} | ||
verifyFacilitySearchReq(): void { | ||
cy.wait("@searchFacility").its("response.statusCode").should("eq", 200); | ||
} | ||
|
||
interceptPostNotificationReq(): void { | ||
cy.intercept("POST", "**/api/v1/notification/notify").as("notifyFacility"); | ||
} | ||
|
||
verifyPostNotificationReq(): void { | ||
cy.wait("@notifyFacility").its("response.statusCode").should("eq", 204); | ||
} | ||
|
||
interceptGetNotificationReq(): void { | ||
cy.intercept("GET", "**/api/v1/notification/**").as("getNotifications"); | ||
} | ||
|
||
verifyGetNotificationReq(): void { | ||
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
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