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:
SnapOtter
2026-07-10 14:03:29 +08:00
committed by GitHub
parent af011d5538
commit 10ae6d1d3d
4 changed files with 10 additions and 10 deletions
@@ -13,7 +13,7 @@ const RELEASE = "https://github.com/snapotter-hq/SnapOtter/releases/tag/v2.0.0";
<span>&#9733; SnapOtter <b>2.0</b> is HERE &#9733; SnapOtter <b>2.0</b> is HERE &#9733; SnapOtter <b>2.0</b> is HERE &#9733; SnapOtter <b>2.0</b> is HERE &#9733; SnapOtter <b>2.0</b> is HERE &#9733;&nbsp;</span> <span>&#9733; SnapOtter <b>2.0</b> is HERE &#9733; SnapOtter <b>2.0</b> is HERE &#9733; SnapOtter <b>2.0</b> is HERE &#9733; SnapOtter <b>2.0</b> is HERE &#9733; SnapOtter <b>2.0</b> is HERE &#9733;&nbsp;</span>
</div> </div>
</div> </div>
<a class="lb-btn" href={RELEASE} aria-label="See the SnapOtter 2.0 release notes">Click here!</a> <a class="lb-btn" href={RELEASE} target="_blank" rel="noopener noreferrer" aria-label="See the SnapOtter 2.0 release notes">Click here!</a>
<button class="lb-x" type="button" data-lb-close aria-label="Dismiss announcement">&#10005;</button> <button class="lb-x" type="button" data-lb-close aria-label="Dismiss announcement">&#10005;</button>
</aside> </aside>
+2 -2
View File
@@ -13,8 +13,8 @@ test.describe("Heading Hierarchy", () => {
for (const { path, name } of pages) { for (const { path, name } of pages) {
test(`${name} page has exactly one h1`, async ({ page }) => { test(`${name} page has exactly one h1`, async ({ page }) => {
await page.goto(path); await page.goto(path);
const h1Count = await page.locator("h1").count(); // toHaveCount auto-waits, so it doesn't race the dev server's on-demand render.
expect(h1Count).toBe(1); await expect(page.locator("h1")).toHaveCount(1);
}); });
} }
}); });
+1 -1
View File
@@ -47,6 +47,6 @@ test.describe("Mobile Navigation", () => {
await expect(page.getByRole("link", { name: "Enterprise" }).last()).toBeVisible(); await expect(page.getByRole("link", { name: "Enterprise" }).last()).toBeVisible();
await expect(page.getByRole("link", { name: "Pricing" }).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: "Docs" }).last()).toBeVisible();
await expect(page.getByRole("link", { name: "Contact" }).last()).toBeVisible(); await expect(page.getByRole("link", { name: "Talk to a human" }).last()).toBeVisible();
}); });
}); });
+6 -6
View File
@@ -45,7 +45,7 @@ test.describe("Privacy Page", () => {
"Overview", "Overview",
"Website (snapotter.com)", "Website (snapotter.com)",
"Self-Hosted Software", "Self-Hosted Software",
"Optional Analytics", "Analytics",
"Contact Form", "Contact Form",
"Open Source", "Open Source",
"Changes", "Changes",
@@ -115,16 +115,16 @@ test.describe("Cross-Page Navigation", () => {
await expect(page.getByText("Frequently Asked Questions")).toBeVisible(); 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.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).toHaveURL("/contact");
await expect(page.getByText("Get in touch")).toBeVisible(); 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("/"); await page.goto("/");
const contactSales = page.getByRole("link", { name: /Contact Sales/ }); const enterpriseCta = page.getByRole("link", { name: /Let.s talk/ }).first();
await expect(contactSales).toHaveAttribute("href", "/contact"); await expect(enterpriseCta).toHaveAttribute("href", "/contact");
}); });
}); });