Skip to content

Commit

Permalink
feat(playwright): migrate (#1805)
Browse files Browse the repository at this point in the history
  • Loading branch information
seaerchin authored Mar 15, 2024
1 parent ea83fa8 commit e9c7381
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 32 deletions.
32 changes: 0 additions & 32 deletions cypress/e2e/sites.spec.ts

This file was deleted.

38 changes: 38 additions & 0 deletions e2e/sites.spec.ts
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`
)
})
})

0 comments on commit e9c7381

Please sign in to comment.