fix: resolve e2e test failures for landing and docs suites

- Change landing e2e port from 1350 to 4350 (avoids Docker conflict)
- Fix strict mode violations in docs tests (use heading roles, exact matches)
- Fix VitePress footer visibility (use DOM queries for hidden footer)
- Fix theme toggle (use evaluate click for CSS-hidden switch)
- Fix landing subpage tests (use heading roles for Privacy/Terms)
This commit is contained in:
SnapOtter
2026-04-27 22:34:11 +08:00
parent 6c1f8363bf
commit 5c8ecc7b2b
5 changed files with 60 additions and 47 deletions
+20 -8
View File
@@ -36,16 +36,22 @@ test.describe("Privacy Page", () => {
});
test("renders the page heading", async ({ page }) => {
await expect(page.getByText("Privacy Policy")).toBeVisible();
await expect(page.getByRole("heading", { name: "Privacy Policy" })).toBeVisible();
});
test("renders all section headings", async ({ page }) => {
const headings = [
"Overview", "Website (snapotter.com)", "Self-Hosted Software",
"Optional Analytics", "Contact Form", "Open Source", "Changes", "Contact",
"Overview",
"Website (snapotter.com)",
"Self-Hosted Software",
"Optional Analytics",
"Contact Form",
"Open Source",
"Changes",
"Contact",
];
for (const heading of headings) {
await expect(page.getByText(heading, { exact: true })).toBeVisible();
await expect(page.getByRole("heading", { name: heading, exact: true })).toBeVisible();
}
});
@@ -61,16 +67,22 @@ test.describe("Terms Page", () => {
});
test("renders the page heading", async ({ page }) => {
await expect(page.getByText("Terms and Conditions")).toBeVisible();
await expect(page.getByRole("heading", { name: "Terms and Conditions" })).toBeVisible();
});
test("renders all section headings", async ({ page }) => {
const headings = [
"Overview", "Software License", "Website Use", "Self-Hosted Software",
"Intellectual Property", "Limitation of Liability", "Changes", "Contact",
"Overview",
"Software License",
"Website Use",
"Self-Hosted Software",
"Intellectual Property",
"Limitation of Liability",
"Changes",
"Contact",
];
for (const heading of headings) {
await expect(page.getByText(heading, { exact: true })).toBeVisible();
await expect(page.getByRole("heading", { name: heading, exact: true })).toBeVisible();
}
});