mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix(landing): green the landing e2e suite (#470)
Repairs 6 pre-existing landing Playwright failures: launch-banner external-link noopener, one-h1 assertion auto-wait, nav label drift to 'Talk to a human', privacy 'Analytics' heading, and pricing 'Let's talk' CTA.
This commit is contained in:
@@ -13,8 +13,8 @@ test.describe("Heading Hierarchy", () => {
|
||||
for (const { path, name } of pages) {
|
||||
test(`${name} page has exactly one h1`, async ({ page }) => {
|
||||
await page.goto(path);
|
||||
const h1Count = await page.locator("h1").count();
|
||||
expect(h1Count).toBe(1);
|
||||
// toHaveCount auto-waits, so it doesn't race the dev server's on-demand render.
|
||||
await expect(page.locator("h1")).toHaveCount(1);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -47,6 +47,6 @@ test.describe("Mobile Navigation", () => {
|
||||
await expect(page.getByRole("link", { name: "Enterprise" }).last()).toBeVisible();
|
||||
await expect(page.getByRole("link", { name: "Pricing" }).last()).toBeVisible();
|
||||
await expect(page.getByRole("link", { name: "Docs" }).last()).toBeVisible();
|
||||
await expect(page.getByRole("link", { name: "Contact" }).last()).toBeVisible();
|
||||
await expect(page.getByRole("link", { name: "Talk to a human" }).last()).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -45,7 +45,7 @@ test.describe("Privacy Page", () => {
|
||||
"Overview",
|
||||
"Website (snapotter.com)",
|
||||
"Self-Hosted Software",
|
||||
"Optional Analytics",
|
||||
"Analytics",
|
||||
"Contact Form",
|
||||
"Open Source",
|
||||
"Changes",
|
||||
@@ -115,16 +115,16 @@ test.describe("Cross-Page Navigation", () => {
|
||||
await expect(page.getByText("Frequently Asked Questions")).toBeVisible();
|
||||
});
|
||||
|
||||
test("navbar Contact link navigates to /contact", async ({ page }) => {
|
||||
test("navbar Talk to a human link navigates to /contact", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.getByRole("link", { name: "Contact" }).first().click();
|
||||
await page.getByRole("link", { name: "Talk to a human" }).first().click();
|
||||
await expect(page).toHaveURL("/contact");
|
||||
await expect(page.getByText("Get in touch")).toBeVisible();
|
||||
});
|
||||
|
||||
test("pricing Contact Sales links to /contact", async ({ page }) => {
|
||||
test("pricing enterprise CTA links to /contact", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
const contactSales = page.getByRole("link", { name: /Contact Sales/ });
|
||||
await expect(contactSales).toHaveAttribute("href", "/contact");
|
||||
const enterpriseCta = page.getByRole("link", { name: /Let.s talk/ }).first();
|
||||
await expect(enterpriseCta).toHaveAttribute("href", "/contact");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user