-
Notifications
You must be signed in to change notification settings - Fork 2
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
40 changed files
with
1,409 additions
and
5,411 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
Large diffs are not rendered by default.
Oops, something went wrong.
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,7 @@ | ||
describe("Admin Page - Accessibility Test", () => { | ||
it("is accessible on all device types for admin user", () => { | ||
cy.authenticate("adminUser"); | ||
cy.visit("/admin"); | ||
cy.testPageAccessibility(); | ||
}); | ||
}); |
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,10 @@ | ||
describe("Help Page - Accessibility Test", () => { | ||
it("is accessible on all device types for state user", () => { | ||
cy.authenticate("stateUser"); | ||
|
||
cy.visit("/help"); | ||
cy.location("pathname").should("match", /help/); | ||
|
||
cy.testPageAccessibility(); | ||
}); | ||
}); |
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,18 @@ | ||
describe("Home Page - Accessibility Test", () => { | ||
it("Is accessible when not logged in", () => { | ||
cy.visit("/"); | ||
cy.testPageAccessibility(); | ||
}); | ||
|
||
it("is accessible on all device types for admin user", () => { | ||
cy.authenticate("adminUser"); | ||
|
||
cy.testPageAccessibility(); | ||
}); | ||
|
||
it("is accessible on all device types for state user", () => { | ||
cy.authenticate("stateUser"); | ||
|
||
cy.testPageAccessibility(); | ||
}); | ||
}); |
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,19 @@ | ||
describe("Profile Page - Accessibility Test", () => { | ||
it("is accessible on all device types for admin user", () => { | ||
cy.authenticate("adminUser"); | ||
|
||
cy.visit("/profile"); | ||
cy.location("pathname").should("match", /profile/); | ||
|
||
cy.testPageAccessibility(); | ||
}); | ||
|
||
it("is accessible on all device types for state user", () => { | ||
cy.authenticate("stateUser"); | ||
|
||
cy.visit("/profile"); | ||
cy.location("pathname").should("match", /profile/); | ||
|
||
cy.testPageAccessibility(); | ||
}); | ||
}); |
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,64 @@ | ||
import { fillFormField } from "../../support"; | ||
|
||
const bannerInputArray = [ | ||
{ name: "bannerTitle", type: "text", value: "test-title" }, | ||
{ name: "bannerDescription", type: "text", value: "test-description" }, | ||
{ name: "bannerStartDate", type: "text", value: "07/14/2022" }, | ||
{ name: "bannerEndDate", type: "text", value: "07/14/2026" }, | ||
]; | ||
|
||
describe("Admin Page E2E Testing", () => { | ||
it("Create a Banner and then delete it", () => { | ||
cy.authenticate("adminUser"); | ||
|
||
// go to banner editor | ||
const menuButton = '[aria-label="my account"'; | ||
const menuOptionManageAccount = | ||
'[data-testid="header-menu-option-manage-account"]'; | ||
const adminButton = 'button:contains("Banner Editor")'; | ||
cy.get(menuButton).click(); | ||
cy.get(menuOptionManageAccount).click(); | ||
cy.get(adminButton).click(); | ||
|
||
// fill out banner form | ||
fillFormField(bannerInputArray); | ||
const submitButton = "[type='submit']"; | ||
cy.get(submitButton).click(); | ||
|
||
// check active banner | ||
cy.contains("Status: Active", { matchCase: true }).should("be.visible"); | ||
cy.get('[role="alert"]').contains("test-title"); | ||
cy.get('[role="alert"]').contains("test-description"); | ||
cy.contains(`Start Date: 07/14/2022`, { matchCase: true }).should( | ||
"be.visible" | ||
); | ||
cy.contains(`End Date: 07/14/2026`, { matchCase: true }).should( | ||
"be.visible" | ||
); | ||
|
||
checkForErrors(); | ||
|
||
// delete banner | ||
const deleteButton = "Delete Current Banner"; | ||
cy.contains(deleteButton).click(); | ||
|
||
// verify banner is gone | ||
const noCurrentBannerMessage = "There is no current banner"; | ||
cy.contains(noCurrentBannerMessage).should("be.visible"); | ||
|
||
checkForErrors(); | ||
}); | ||
}); | ||
|
||
function checkForErrors() { | ||
const bannerFetchErrorMessage = | ||
"Banner could not be fetched. Please contact support."; | ||
const bannerWriteErrorMessage = | ||
"Current banner could not be replaced. Please contact support."; | ||
const bannerDeleteErrorMessage = | ||
"Current banner could not be deleted. Please contact support."; | ||
|
||
cy.contains(bannerWriteErrorMessage).should("not.exist"); | ||
cy.contains(bannerFetchErrorMessage).should("not.exist"); | ||
cy.contains(bannerDeleteErrorMessage).should("not.exist"); | ||
} |
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,43 @@ | ||
// element selectors | ||
const accessibilityStatementLinkText = "Accessibility Statement"; | ||
|
||
beforeEach(() => { | ||
cy.authenticate("stateUser"); | ||
}); | ||
|
||
describe("Footer integration tests", () => { | ||
it("Footer help link navigates to /help", () => { | ||
cy.get("[aria-label='Get Help']").click(); | ||
cy.url().should("include", "/help"); | ||
|
||
cy.get("[alt='MCR logo']").click(); | ||
cy.url().should("include", "/"); | ||
|
||
cy.get("[aria-label='my account']").click(); | ||
cy.url().should("include", "/"); | ||
cy.get("[data-testid='header-menu-options-list']").should("be.visible"); | ||
cy.get("[data-testid='header-menu-option-manage-account']").should( | ||
"be.visible" | ||
); | ||
cy.get("[data-testid='header-menu-option-log-out']").should("be.visible"); | ||
|
||
cy.get("[data-testid='header-menu-option-manage-account']").click(); | ||
cy.url().should("include", "/profile"); | ||
|
||
cy.get("[aria-label='my account']").click(); | ||
cy.get("[data-testid='header-menu-option-log-out']").click(); | ||
cy.wait(3000); | ||
cy.visit("/"); | ||
cy.get("[data-testid='cognito-login-button']").should("be.visible"); | ||
}); | ||
|
||
it("Footer accessibility statement link navigates to the right external URL", () => { | ||
cy.get( | ||
'a[href="https://www.cms.gov/About-CMS/Agency-Information/Aboutwebsite/CMSNondiscriminationNotice"]' | ||
).contains(accessibilityStatementLinkText); | ||
|
||
cy.contains(accessibilityStatementLinkText).then((link) => { | ||
cy.request(link.prop("href")).its("status").should("eq", 200); | ||
}); | ||
}); | ||
}); |
File renamed without changes.
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,105 @@ | ||
import { fillFormField, verifyElementsArePrefilled } from "../../support"; | ||
|
||
const currentDate = new Date().toISOString(); | ||
|
||
const newReportInputArray = [ | ||
{ | ||
name: "programName", | ||
type: "text", | ||
value: `automated test - ${currentDate}`, | ||
}, | ||
{ name: "reportingPeriodStartDate", type: "text", value: "07/14/2023" }, | ||
{ name: "reportingPeriodEndDate", type: "text", value: "07/14/2026" }, | ||
{ name: "combinedData", type: "singleCheckbox", value: "true" }, | ||
{ name: "programIsPCCM", type: "radio", value: "No" }, | ||
]; | ||
|
||
describe("MCPAR Dashboard Page - Program Creation/Editing/Archiving", () => { | ||
it("State users can create and edit reports", () => { | ||
cy.authenticate("stateUser"); | ||
|
||
// go to mcpar dashboard; two clicks to get through instruction page | ||
cy.get('button:contains("Enter MCPAR online")').click(); | ||
cy.get('button:contains("Enter MCPAR online")').click(); | ||
|
||
// create a new mcpar report | ||
cy.get('button:contains("Add / copy a MCPAR")').click(); | ||
|
||
fillFormField(newReportInputArray); | ||
cy.get("button[type=submit]").contains("Save").click(); | ||
|
||
cy.wait(2000); | ||
|
||
cy.contains(`automated test - ${currentDate}`, { | ||
matchCase: true, | ||
}).should("be.visible"); | ||
|
||
// edit the report | ||
cy.get('[alt="Edit Report"]').last().click(); | ||
|
||
cy.contains(`automated test - ${currentDate}`, { | ||
matchCase: true, | ||
}).should("be.visible"); | ||
verifyElementsArePrefilled(newReportInputArray); | ||
|
||
// edit report name | ||
cy.get(`[name='programName']`) | ||
.clear() | ||
.type(`Edited Program - ${currentDate}`); | ||
cy.get("button[type=submit]").contains("Save").click(); | ||
|
||
cy.contains(`Edited Program - ${currentDate}`, { | ||
matchCase: true, | ||
}).should("be.visible"); | ||
}); | ||
}); | ||
|
||
const adminSelectorArray = [ | ||
{ name: "state", type: "dropdown", value: "District of Columbia" }, | ||
{ | ||
name: "report", | ||
type: "radio", | ||
value: "Managed Care Program Annual Report (MCPAR)", | ||
}, | ||
]; | ||
|
||
describe("Admin Archiving", () => { | ||
it("Admin users can archive/unarchive reports", () => { | ||
cy.authenticate("adminUser"); | ||
|
||
fillFormField(adminSelectorArray); | ||
cy.contains("Go to Report Dashboard").click(); | ||
|
||
// cannot create reports | ||
cy.contains("Add / copy a MCPAR").should("not.exist"); | ||
|
||
cy.contains(`Edited Program - ${currentDate}`, { | ||
matchCase: true, | ||
}).should("be.visible"); | ||
|
||
cy.get('button:contains("Archive")').last().click(); | ||
cy.contains("Unarchive").should("be.visible"); | ||
|
||
cy.contains("Unarchive").last().click(); | ||
cy.contains("Archive").should("be.visible"); | ||
|
||
cy.contains("Archive").last().click(); | ||
cy.contains("Unarchive").should("be.visible"); | ||
}); | ||
}); | ||
|
||
describe("State users can't see archived programs", () => { | ||
it("State users can't see archived programs", () => { | ||
cy.authenticate("stateUser"); | ||
|
||
// go to mcpar dashboard; two clicks to get through instruction page | ||
cy.get('button:contains("Enter MCPAR online")').click(); | ||
cy.get('button:contains("Enter MCPAR online")').click(); | ||
|
||
cy.contains(`Edited Program - ${currentDate}`, { | ||
matchCase: true, | ||
}).should("not.exist"); | ||
|
||
cy.contains("button", { "Edit Report": String }).should("not.exist"); | ||
}); | ||
}); |
Oops, something went wrong.