Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pw structure): initial restructure #1102

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion react-app/src/components/Inputs/upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export const Upload = ({ maxFiles, files, setFiles, dataTestId }: UploadProps) =
<div className="my-2 flex flex-wrap gap-2">
{files.map((file) => (
<div
data-testid={`${file.filename}-chip`}
className="flex border-2 rounded-md py-1 pl-2.5 pr-1 border-sky-500 items-center"
key={file.filename}
>
Expand Down Expand Up @@ -143,7 +144,12 @@ export const Upload = ({ maxFiles, files, setFiles, dataTestId }: UploadProps) =
>
<p>
Drag file here or{" "}
<span className="text-sky-700 underline hover:cursor-pointer">choose from folder</span>
<span
data-testid={`${dataTestId}-click`}
className="text-sky-700 underline hover:cursor-pointer"
>
choose from folder
</span>
</p>
<label htmlFor={`upload-${uniqueId}`} className="sr-only">
Drag file here or choose from folder
Expand Down
4 changes: 3 additions & 1 deletion react-app/src/features/dashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ export const Dashboard = () => {
to="/new-submission"
className="flex items-center text-white font-bold bg-primary border-none px-10 py-2 rounded cursor-pointer"
>
<span className="mr-2">New Submission</span>
<span data-testId="new-sub-button" className="mr-2">
New Submission
</span>
<PlusIcon className="w-4 h-4" />
</Link>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ exports[`WithdrawPackageAction components > renders WithdrawPackageActionWaiver

<span
class="text-sky-700 underline hover:cursor-pointer"
data-testid="supportingDocumentation-click"
>
choose from folder
</span>
Expand Down Expand Up @@ -663,6 +664,7 @@ exports[`WithdrawPackageAction components > renders WithdrawPackageActionWaiver

<span
class="text-sky-700 underline hover:cursor-pointer"
data-testid="supportingDocumentation-click"
>
choose from folder
</span>
Expand Down
88 changes: 88 additions & 0 deletions test/e2e/dashboard/dashboard.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import { test } from "@playwright/test"; // add expect when writing assertions

// TODO
test.describe.skip("Dashboard page", { tag: ["@dashboard"] }, () => {
test.describe.skip("UI validations", () => {
test.skip("nav banner updated", async () => {});

test.skip("page header", async () => {});

test.skip("SPA and Waiver tabs", async () => {});

test.skip("search field", async () => {});

test.skip("columns button", async () => {});

test.skip("filters buttons", async () => {});

test.skip("export button", async () => {});

test.describe.skip("dashboard table", () => {
test.describe.skip("spas", () => {
test.skip("column headers", async () => {});

test.skip("table data", async () => {});

test.skip("table footer", async () => {});
});

test.describe.skip("waivers", () => {
test.skip("column headers", async () => {});

test.skip("table data", async () => {});

test.skip("table footer", async () => {});
});
});
});

test.describe.skip("navigation validation", () => {
test.skip("switch to waivers", async () => {});

test.skip("switch to SPAs", async () => {});

test.skip("new submission button", async () => {});

test.skip("package actions", async () => {}); // from table

test.describe.skip("load spa package details", () => {
test.describe.skip("medicaid spa", async () => {});

test.describe.skip("chip spa", async () => {});
});

test.describe.skip("load waiver package details", () => {
test.describe.skip("1915(b)", () => {});

test.describe.skip("1915(c)", () => {});
});
});

test.describe.skip("workflow validation", () => {
test.describe.skip("table actions", () => {
test.describe.skip("spas", () => {
test.describe.skip("sort", () => {});

test.describe.skip("change record count", () => {});

test.describe.skip("page navigation", () => {});

test.describe.skip("show/hide columns", () => {}); // add export validation here

test.describe.skip("filters", () => {});
});

test.describe.skip("waivers", () => {
test.describe.skip("sort", () => {});

test.describe.skip("change record count", () => {});

test.describe.skip("page navigation", () => {});

test.describe.skip("show/hide columns", () => {}); // add export validation here

test.describe.skip("filters", () => {});
});
});
});
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test, expect } from "@playwright/test";
import { FAQPage } from "../pages/faq.page";

import { FAQPage } from "pages/faq.page";
let faqPage: FAQPage;

test.describe("FAQ page", { tag: ["@e2e", "@smoke", "@faq"] }, () => {
Expand Down
53 changes: 53 additions & 0 deletions test/e2e/forms/details/medicaid-spa-detail.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { test, expect } from "@playwright/test";

test.describe("Medicaid SPA - Sub Doc", () => {
test.beforeEach(async ({ page }) => {
await page.goto("/");
await page.getByTestId("Dashboard-d").click();
await page.locator('a[href*="details/Medicaid%20SPA/CO-22-2020"]').click();
});

test.describe("UI - Validation", () => {
test.describe.skip("Status", () => {
test("should display Status items", () => {});
});
test.describe("form actions", () => {
test("should display the details page", async ({ page }) => {
// elements before to be validated

await expect(
page.locator(
'a[href*="upload-subsequent-documents/Medicaid SPA/CO-22-2020?origin=details"]',
),
).toBeVisible();
await expect(
page.locator(
'a[href*="upload-subsequent-documents/Medicaid SPA/CO-22-2020?origin=details"]',
),
).toContainText("Upload Subsequent Document");

// elements after to be validated
});
});

test.describe.skip("package details", () => {});

test.describe.skip("package activity", () => {});
});

test.describe("Naviation - Validation", () => {
test("navigate to withdraw package page", () => {
// see below
});

test("navigate to sub doc page", async ({ page }) => {
await page
.locator(
'a[href*="/actions/upload-subsequent-documents/Medicaid SPA/CO-22-2020?origin=details"]',
)
.click();

await expect(page.getByTestId("detail-section")).toBeVisible();
});
});
});
5 changes: 5 additions & 0 deletions test/e2e/forms/details/package-details.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { test } from "@playwright/test";

test.describe.skip("Form Submission", () => {
test("Verify that the given details displayed on the package details page for any form type", async () => {});
});
5 changes: 5 additions & 0 deletions test/e2e/forms/spa/chip/chip-spa.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { test } from "@playwright/test";

test.describe.skip("Form Submission", () => {
test("Create and submit a CHIP SPA", async () => {});
});
26 changes: 26 additions & 0 deletions test/e2e/forms/spa/medicaid/medicaid-spa.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { test, expect } from "@playwright/test";

test.describe("Medicaid SPA Details page", { tag: ["@SPA", "@FCexample"] }, () => {
test.beforeEach(async ({ page }) => {
await page.goto("/dashboard");
// await page.goto("/new-submission/spa/medicaid/create?origin=spas");
await page.getByTestId("new-sub-button").click();
await page.getByTestId("card-inner-wrapper").first().click();
await page.waitForTimeout(500);
await page.getByTestId("card-inner-wrapper").first().click();
await page.waitForTimeout(500);
await page.getByTestId("card-inner-wrapper").last().click();
await page.waitForTimeout(500);
});

test("file choose sample", async ({ page }) => {
const fileName = "upload-sample.png";

await expect(page.getByTestId("attachment-section")).toBeVisible();
await expect(page.getByTestId("cmsForm179-click")).toBeVisible();

const filePath = `../fixtures/${fileName}`;
await page.getByTestId("cmsForm179-upload").setInputFiles(filePath);
await expect(page.getByTestId(`${fileName}-chip`)).toBeVisible();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { test } from "@playwright/test";

test.describe.skip("Form Submission", () => {
test("Create and submit a Capitated Amendment Waiver", async () => {});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { test } from "@playwright/test";

test.describe.skip("Form Submission", () => {
test("Create and submit a Capitated Initial Waiver", async () => {});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { test } from "@playwright/test";

test.describe.skip("Form Submission", () => {
test("Create and submit a Capitated Renewal Waiver", async () => {});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { test } from "@playwright/test";

test.describe.skip("Form Submission", () => {
test("Create and submit a Contracting Amendment Waiver", async () => {});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { test } from "@playwright/test";

test.describe.skip("Form Submission", () => {
test("Create and submit a Contracting Initial Waiver", async () => {});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { test } from "@playwright/test";

test.describe.skip("Form Submission", () => {
test("Create and submit a Contracting Renewal Waiver", async () => {});
});
5 changes: 5 additions & 0 deletions test/e2e/forms/waiver/1915-c/appendix-k-amendment.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { test } from "@playwright/test";

test.describe.skip("Form Submission", () => {
test("Create and submit a Appendix K Amendment Waiver", async () => {});
});
5 changes: 5 additions & 0 deletions test/e2e/forms/waiver/temp-extension/temp-extension.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { test } from "@playwright/test";

test.describe.skip("Form Submission", () => {
test("Create and submit a Temporary Extension Waiver", async () => {});
});
35 changes: 35 additions & 0 deletions test/e2e/home/home.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { test, expect } from "@playwright/test";
import { HomePage } from "../pages/home.page";

let homePage: HomePage;

test.describe("home page", { tag: ["@home", "@e2e", "@sample"] }, () => {
test.beforeEach(async ({ page }) => {
homePage = new HomePage(page);

await page.goto("/");
});

test("has title", async ({ page }) => {
await expect(page).toHaveTitle("OneMAC");
});

test("should not display a menu", async () => {
await expect(homePage.desktop.signInBtn).not.toBeVisible();
});

test("see freqiently asked questions header when in FAQ page", async ({ page }) => {
const popup = page.waitForEvent("popup");
await homePage.desktop.faqLink.click();
const foundFaqHeading = await popup;

await expect(
foundFaqHeading.getByRole("heading", { name: "Frequently Asked Questions" }),
).toBeVisible();
});

test("see dashboard link when logged in", async ({ page }) => {
await expect(page.getByTestId("Dashboard-d")).toBeVisible();
await expect(homePage.desktop.homeLink).toBeVisible();
});
});
Loading
Loading