-
Notifications
You must be signed in to change notification settings - Fork 9
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
2 changed files
with
38 additions
and
32 deletions.
There are no files selected for viewing
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { test, expect, Page } from "@playwright/test" | ||
|
||
import { E2E_EMAIL_TEST_SITE } from "./fixtures/constants" | ||
import { setEmailSessionDefaults } from "./utils/session" | ||
|
||
test.describe("Sites flow", () => { | ||
test.beforeEach(async ({ page, context }) => { | ||
setEmailSessionDefaults(context, "Email admin") | ||
await page.goto(`/sites`) | ||
}) | ||
|
||
test("Sites page should have sites header", async ({ page }) => { | ||
const closeButton = page.getByRole("button", { name: "Close" }) | ||
await closeButton.click() | ||
|
||
const header = page.getByText("Get help") | ||
|
||
await expect(header).toBeVisible() | ||
}) | ||
|
||
test("Sites page should allow user to click into a test site repo", async ({ | ||
page, | ||
}) => { | ||
// Arrange | ||
await page.waitForLoadState("domcontentloaded") | ||
const closeButton = page.getByRole("button", { name: "Close" }) | ||
await closeButton.click() | ||
const site = page.getByRole("link", { name: E2E_EMAIL_TEST_SITE.repo }) | ||
|
||
// Act | ||
await site.click() | ||
|
||
// Assert | ||
await expect(page.url()).toContain( | ||
`/sites/${E2E_EMAIL_TEST_SITE.repo}/dashboard` | ||
) | ||
}) | ||
}) |