generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
15908 - Implement user flow for e2e smoke test for Org Settings Edit …
…Page
- Loading branch information
1 parent
f97a602
commit 32b5780
Showing
2 changed files
with
94 additions
and
8 deletions.
There are no files selected for viewing
86 changes: 86 additions & 0 deletions
86
...ct/e2e/spec/chromium-only/authenticated/organization-settings-edit-page-user-flow.spec.ts
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,86 @@ | ||
import { expect } from "@playwright/test"; | ||
import { OrganizationEditPage } from "../../../pages/authenticated/admin/organization-edit"; | ||
import { test as baseTest } from "../../../test"; | ||
|
||
export interface OrganizationEditPageFixtures { | ||
organizationEditPage: OrganizationEditPage; | ||
} | ||
|
||
const test = baseTest.extend<OrganizationEditPageFixtures>({ | ||
organizationEditPage: async ( | ||
{ | ||
page: _page, | ||
isMockDisabled, | ||
adminLogin, | ||
senderLogin, | ||
receiverLogin, | ||
storageState, | ||
frontendWarningsLogPath, | ||
isFrontendWarningsLog, | ||
}, | ||
use, | ||
) => { | ||
const page = new OrganizationEditPage({ | ||
page: _page, | ||
isMockDisabled, | ||
adminLogin, | ||
senderLogin, | ||
receiverLogin, | ||
storageState, | ||
frontendWarningsLogPath, | ||
isFrontendWarningsLog, | ||
}); | ||
await page.goto(); | ||
await use(page); | ||
}, | ||
}); | ||
|
||
test.describe("Organization Edit Page", { | ||
tag: "@smoke", | ||
}, () => { | ||
test.describe("admin user", () => { | ||
test.use({storageState: "e2e/.auth/admin.json"}); | ||
|
||
test("has correct title", async ({organizationEditPage}) => { | ||
await organizationEditPage.testHeader(false); | ||
await expect(organizationEditPage.page.getByText(/Org name: ignore/)).toBeVisible(); | ||
}); | ||
|
||
test.describe("edit section", () => { | ||
test("has expected 'Meta'", async ({organizationEditPage}) => { | ||
const meta = organizationEditPage.page.getByTestId("gridContainer").getByTestId("grid").nth(2); | ||
await expect(meta).not.toBeEmpty(); | ||
}); | ||
|
||
test("has expected 'Description'", async ({organizationEditPage}) => { | ||
await expect(organizationEditPage.page.getByTestId("description")).not.toBeEmpty(); | ||
}); | ||
|
||
test("has expected 'Jurisdiction'", async ({organizationEditPage}) => { | ||
await expect(organizationEditPage.page.getByTestId("jurisdiction")).not.toBeEmpty(); | ||
}); | ||
}); | ||
|
||
test.describe("'Organization Sender Settings' section", () => { | ||
test.beforeEach(async ({ organizationEditPage }) => { | ||
await organizationEditPage.page.locator("#orgsendersettings .usa-table tbody").waitFor({ state: "visible" }); | ||
}); | ||
|
||
test("has at least one sender listed in the table", async ({organizationEditPage}) => { | ||
const rowCount = await organizationEditPage.page.locator("#orgsendersettings .usa-table tbody tr").count(); | ||
expect(rowCount).toBeGreaterThanOrEqual(1); | ||
}); | ||
}); | ||
|
||
test.describe("'Organization Receiver Settings' section", () => { | ||
test.beforeEach(async ({ organizationEditPage }) => { | ||
await organizationEditPage.page.locator("#orgreceiversettings .usa-table tbody").waitFor({ state: "visible" }); | ||
}); | ||
|
||
test("has at least one sender listed in the table", async ({organizationEditPage}) => { | ||
const rowCount = await organizationEditPage.page.locator("#orgreceiversettings .usa-table tbody tr").count(); | ||
expect(rowCount).toBeGreaterThanOrEqual(1); | ||
}); | ||
}); | ||
}); | ||
}); |
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