-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add MCPAR dashboard Playwright tests (#11959)
- Loading branch information
1 parent
0f49e18
commit 07a05ff
Showing
14 changed files
with
286 additions
and
60 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
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,72 @@ | ||
import { expect, test } from "../../utils/fixtures/base"; | ||
import { stateName } from "../../utils"; | ||
|
||
let currentDate = ""; | ||
let programName = ""; | ||
let updatedProgramName = ""; | ||
|
||
test.beforeAll(async () => { | ||
currentDate = new Date().toISOString(); | ||
programName = `automated test - ${currentDate}`; | ||
updatedProgramName = `Updated: ${programName}`; | ||
}); | ||
|
||
test.describe( | ||
"MCPAR Dashboard Page - Program Creation/Editing/Archiving", | ||
() => { | ||
test("State users can create and edit reports", async ({ | ||
mcparDashboardPage, | ||
mcparGetStartedPage, | ||
stateHomePage, | ||
}) => { | ||
await stateHomePage.goto(); | ||
await stateHomePage.isReady(); | ||
|
||
await stateHomePage.mcparButton.isVisible(); | ||
await stateHomePage.mcparButton.click(); | ||
await stateHomePage.redirectPage("/mcpar/get-started"); | ||
|
||
await mcparGetStartedPage.mcparButton.isVisible(); | ||
await mcparGetStartedPage.mcparButton.click(); | ||
await mcparGetStartedPage.redirectPage("/mcpar"); | ||
|
||
const originalRow = mcparDashboardPage.table.getByRole("row", { | ||
name: programName, | ||
}); | ||
const updatedRow = mcparDashboardPage.table.getByRole("row", { | ||
name: updatedProgramName, | ||
}); | ||
|
||
// Create MCPAR | ||
await mcparDashboardPage.create(programName); | ||
await expect(originalRow).toBeVisible(); | ||
await expect(updatedRow).toBeHidden(); | ||
|
||
// Update MCPAR | ||
await mcparDashboardPage.update(programName, updatedProgramName); | ||
await expect(originalRow).toBeHidden(); | ||
await expect(updatedRow).toBeVisible(); | ||
}); | ||
|
||
test("Admin users can archive/unarchive reports", async ({ | ||
adminHomePage, | ||
}) => { | ||
await adminHomePage.archiveMCPAR(stateName, updatedProgramName); | ||
await adminHomePage.unarchiveMCPAR(stateName, updatedProgramName); | ||
}); | ||
|
||
test("State users can't see archived programs", async ({ | ||
adminHomePage, | ||
mcparDashboardPage, | ||
}) => { | ||
await adminHomePage.archiveMCPAR(stateName, updatedProgramName); | ||
|
||
await mcparDashboardPage.goto(); | ||
await mcparDashboardPage.isReady(); | ||
await mcparDashboardPage.table.isVisible(); | ||
await expect( | ||
mcparDashboardPage.table.getByRole("row", { name: updatedProgramName }) | ||
).toBeHidden(); | ||
}); | ||
} | ||
); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from "./a11y"; | ||
export * from "./consts"; | ||
export * from "./login"; | ||
export * from "./a11y"; | ||
export * from "./pageObjects"; |
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,13 @@ | ||
export { default as BasePage } from "./base.page"; | ||
export { default as BannerPage } from "./banner.page"; | ||
export { default as ProfilePage } from "./profile.page"; | ||
|
||
// Admin User | ||
export { default as AdminHomePage } from "./adminHome.page"; | ||
|
||
// State User | ||
export { default as StateHomePage } from "./stateHome.page"; | ||
|
||
// MCPAR | ||
export { default as MCPARDashboardPage } from "./mcpar/dashboard.page"; | ||
export { default as MCPARGetStartedPage } from "./mcpar/getStarted.page"; |
Oops, something went wrong.