Files
SnapOtter/tests/e2e-landing/homepage.spec.ts
T
SnapOtter 7db6bb97da docs: add per-tool API documentation and fix parity gaps
- Create 53 per-tool VitePress documentation pages with accurate
  parameters from Zod schemas, example requests, and response formats
- Add root llms.txt for LLM-friendly repo browsing
- Fix OpenAPI spec: add auth and 422 error schemas to
  edit-metadata/inspect and strip-metadata/inspect sub-routes
- Fix tool count inconsistency (52 -> 53) across landing site,
  e2e tests, and local docs
- Rename color-adjustments.ts to adjust-colors.ts to match tool ID
- Update VitePress sidebar with all 8 tool categories and top nav
2026-06-08 11:52:28 +08:00

97 lines
4.1 KiB
TypeScript

import { expect, test } from "@playwright/test";
test.describe("Landing Homepage", () => {
test.beforeEach(async ({ page }) => {
await page.goto("/");
});
test("page loads with correct title", async ({ page }) => {
await expect(page).toHaveTitle(/SnapOtter/);
});
test("navbar renders brand and navigation links", async ({ page }) => {
await expect(page.getByText("SnapOtter").first()).toBeVisible();
await expect(page.getByRole("link", { name: "Features" }).first()).toBeVisible();
await expect(page.getByRole("link", { name: "Pricing" }).first()).toBeVisible();
await expect(page.getByRole("link", { name: "Docs" }).first()).toBeVisible();
await expect(page.getByRole("link", { name: "Contact" }).first()).toBeVisible();
});
test("navbar renders Book a Demo CTA", async ({ page }) => {
await expect(page.getByRole("link", { name: "Book a Demo" }).first()).toBeVisible();
});
test("hero section renders headline and subheadline", async ({ page }) => {
await expect(page.getByText("Your images. Stay yours.")).toBeVisible();
await expect(page.getByText("Every image tool you need.")).toBeVisible();
});
test("hero CTA links to GitHub", async ({ page }) => {
const cta = page.getByRole("link", { name: "Get it for free" });
await expect(cta).toBeVisible();
await expect(cta).toHaveAttribute("href", "https://github.com/snapotter-hq/snapotter");
await expect(cta).toHaveAttribute("target", "_blank");
});
test("how-it-works section renders Docker command", async ({ page }) => {
await expect(page.getByText("Get started in seconds")).toBeVisible();
await expect(page.getByText("docker run -d --name SnapOtter", { exact: false })).toBeVisible();
});
test("why-choose section renders all 9 benefit cards", async ({ page }) => {
await expect(page.getByText("Built different. On purpose.")).toBeVisible();
const cards = [
"No Signup",
"No Uploads",
"Forever Free",
"No Limits",
"Batch Processing",
"Lightning Fast",
"Open Source",
"REST API",
"Pipeline Automation",
];
for (const card of cards) {
await expect(page.getByText(card, { exact: true }).first()).toBeVisible();
}
});
test("bento grid renders with search and tool count", async ({ page }) => {
await expect(page.getByText("50+ tools. Zero cloud dependency.")).toBeVisible();
await expect(page.getByPlaceholder("Search tools...")).toBeVisible();
await expect(page.getByText(/Showing 53 of 53 tools/)).toBeVisible();
});
test("enterprise section renders feature cards", async ({ page }) => {
await expect(page.getByText("Your data never leaves your network.")).toBeVisible();
await expect(page.getByText("Data Sovereignty")).toBeVisible();
await expect(page.getByText("Enterprise Controls")).toBeVisible();
await expect(page.getByText("Deploy Anywhere")).toBeVisible();
});
test("pricing section renders both plans", async ({ page }) => {
await expect(page.getByText(/Free for everyone/)).toBeVisible();
const openSource = page.getByText("Open Source", { exact: true });
await expect(openSource.first()).toBeVisible();
await expect(page.getByText("Enterprise", { exact: true }).first()).toBeVisible();
});
test("open-source section renders with GitHub link", async ({ page }) => {
await expect(page.getByText("Open source. Always.")).toBeVisible();
const ghLink = page.getByRole("link", { name: "Star on GitHub" }).first();
await expect(ghLink).toHaveAttribute("href", "https://github.com/snapotter-hq/snapotter");
});
test("footer renders all column titles", async ({ page }) => {
await expect(page.getByText("Product", { exact: true })).toBeVisible();
await expect(page.getByText("Resources", { exact: true })).toBeVisible();
await expect(page.getByText("Community", { exact: true })).toBeVisible();
await expect(page.getByText("Legal", { exact: true })).toBeVisible();
});
test("footer renders copyright with current year", async ({ page }) => {
const year = new Date().getFullYear();
await expect(page.getByText(new RegExp(String(year)))).toBeVisible();
});
});