Files
oh-my-opencode/web/e2e/example.spec.ts
T
YeonGyu-Kim a7ec5395dd fix(web): address review-work findings (Category Routing, OG dims, e2e drift)
Three reviewer-flagged corrections, none with UX impact:

- Category Routing block on the landing page still showed pre-v4.0 model
  labels (`ultrabrain → GPT 5.4`, `deep → GPT 5.3 Codex`, `quick →
  Claude Haiku 4.5`) which contradicted the rest of the page after the
  model refresh. Pinned them to the actual primary chains
  (`ultrabrain → GPT 5.5 xHigh`, `deep → GPT 5.5 Medium`,
  `quick → GPT 5.4 Mini`). Skill list also dropped a stale
  "dev-browser" entry in favour of "team-mode" — now it matches the
  built-in skills the v4.0 release ships.
- OG/Twitter image metadata in app/layout.tsx claimed the hero was
  1536×1024 — actual file is 1024×683. Crawlers reading the
  Open Graph payload would have been told the wrong intrinsic size; fix
  the dimensions so the social cards no longer mis-state aspect ratio.
- e2e/example.spec.ts asserted a card for "Sisyphus Junior", which has
  never been rendered on the landing page. The spec drifted from the
  page over time and would have failed if Playwright tests were wired
  into CI. Pruned the list to the nine agents actually rendered.
2026-05-09 03:53:20 +09:00

168 lines
4.8 KiB
TypeScript

import { test, expect } from "@playwright/test"
test.describe("Landing Page", () => {
test("renders hero section with title and CTA", async ({ page }) => {
// given
await page.goto("/")
// when
const heading = page.getByRole("heading", { name: "The Best Agent Harness", level: 1 })
const getStartedButton = page.getByRole("button", { name: "Get Started" })
// then
await expect(page).toHaveTitle(/Oh My OpenAgent/)
await expect(heading).toBeVisible()
await expect(getStartedButton).toBeVisible()
})
test("renders install command", async ({ page }) => {
// given
await page.goto("/")
// when
const installCommand = page.getByText("bunx oh-my-openagent install").first()
// then
await expect(installCommand).toBeVisible()
})
test("renders all rendered agent cards", async ({ page }) => {
// given
await page.goto("/")
// when / then
const agentNames = [
"Sisyphus",
"Hephaestus",
"Oracle",
"Librarian",
"Explore",
"Prometheus",
"Metis",
"Momus",
"Atlas",
]
for (const name of agentNames) {
await expect(page.getByText(name, { exact: true }).first()).toBeVisible()
}
})
test("mobile nav toggles menu", async ({ page }) => {
// given
await page.setViewportSize({ width: 375, height: 800 })
await page.goto("/")
const mobileNav = page.locator("#mobile-nav")
await expect(mobileNav).toBeHidden()
// when
await page.getByRole("button", { name: "Open menu" }).click()
// then
await expect(mobileNav).toBeVisible()
await expect(mobileNav.getByRole("link", { name: "Docs", exact: true })).toBeVisible()
await expect(mobileNav.getByRole("link", { name: "Manifesto", exact: true })).toBeVisible()
})
test("navigates to docs page", async ({ page }) => {
// given
await page.goto("/")
// when
await Promise.all([
page.waitForURL("**/docs", { timeout: 15000 }),
page.getByRole("navigation").getByRole("link", { name: "Docs", exact: true }).click(),
])
// then
await expect(page).toHaveURL(/\/docs/)
await expect(page.getByRole("heading", { name: "Configuration Reference" })).toBeVisible()
})
test("navigates to manifesto page", async ({ page }) => {
// given
await page.goto("/")
// when
await Promise.all([
page.waitForURL("**/manifesto", { timeout: 15000 }),
page.getByRole("navigation").getByRole("link", { name: "Manifesto", exact: true }).click(),
])
// then
await expect(page).toHaveURL(/\/manifesto/)
await expect(page.getByRole("heading", { name: "Ultrawork Manifesto" })).toBeVisible()
})
})
test.describe("Docs Page", () => {
test("renders sidebar and config reference", async ({ page }) => {
// given
await page.goto("/docs")
// when
const heading = page.getByRole("heading", { name: "Configuration Reference" })
const sidebarItems = ["Overview", "Quick Start", "Agents", "Categories", "Skills", "Hooks"]
// then
await expect(heading).toBeVisible()
for (const item of sidebarItems) {
await expect(page.getByRole("button", { name: item })).toBeVisible()
}
})
test("has working search input", async ({ page }) => {
// given
await page.goto("/docs")
const searchInput = page.getByPlaceholder("Search docs...")
// when
await searchInput.fill("agent")
// then
await expect(page.getByRole("button", { name: "Agents" })).toBeVisible()
})
test("sidebar navigation scrolls instantly and highlights active section", async ({ page }) => {
// given
await page.goto("/docs")
const quickStartButton = page.getByRole("button", { name: "Quick Start" })
// when
await quickStartButton.click()
// then
await expect(page.locator("#quick-start")).toBeInViewport()
await expect(quickStartButton).toHaveClass(/bg-primary\/10/)
})
})
test.describe("Manifesto Page", () => {
test("renders hero and core philosophy", async ({ page }) => {
test.setTimeout(60000)
// given
await page.goto("/manifesto", { waitUntil: "domcontentloaded", timeout: 45000 })
// when
const heading = page.getByRole("heading", { name: "Ultrawork Manifesto" })
const bottleneckText = page.getByText("HUMAN IN THE LOOP = BOTTLENECK").first()
// then
await expect(heading).toBeVisible()
await expect(bottleneckText).toBeVisible()
})
test("renders CTA with GitHub link", async ({ page }) => {
test.setTimeout(60000)
// given
await page.goto("/manifesto", { waitUntil: "domcontentloaded", timeout: 45000 })
// when
const ctaLink = page.getByRole("link", { name: /Get Oh My OpenAgent/i })
// then
await expect(ctaLink).toBeVisible()
await expect(ctaLink).toHaveAttribute("href", "https://github.com/code-yeongyu/oh-my-openagent")
})
})