Skip to content

Commit 553ee97

Browse files
committed
#3414 webpage: fix frontpage test and add more tests
Signed-off-by: Patrizio Bekerle <[email protected]>
1 parent ab7d036 commit 553ee97

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

webpage/tests/basic.spec.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,20 @@ import { test, expect } from "./fixtures.js";
44
// Test that all activities show
55
test("frontpage", async ({ page, config }) => {
66
await page.goto(config.baseURL);
7-
await expect(page.locator("title")).toContainText(/QOwnNotes/);
7+
await expect(page).toHaveTitle(/QOwnNotes/);
8+
await expect(
9+
page.getByText("Free open source plain-text file markdown note-taking"),
10+
).toBeVisible();
11+
await expect(page.getByRole("link", { name: "Quick Start →" })).toBeVisible();
12+
});
13+
14+
test("concept", async ({ page, config }) => {
15+
await page.goto(config.baseURL + "/getting-started/concept.html");
16+
await expect(page).toHaveTitle(/Concept/);
17+
await expect(
18+
page.getByRole("heading", { level: 1, name: "Concept" }),
19+
).toBeVisible();
20+
await expect(
21+
page.locator(".mermaid-diagram").getByText("Command-line snippet manager"),
22+
).toBeVisible();
823
});

webpage/tests/sitemap.spec.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// @ts-check
2+
import { test, expect } from "./fixtures.js";
3+
4+
test("sitemap", async ({ page, config }) => {
5+
const response = await page.goto(config.baseURL + "/sitemap.xml");
6+
expect(response.status()).toBe(200);
7+
expect(response.headers()["content-type"]).toContain("xml");
8+
const content = await page.content();
9+
expect(content).toContain("<urlset");
10+
expect(content).toContain("<url>");
11+
expect(content).toContain("<loc>");
12+
expect(content).toContain("/getting-started/concept.html");
13+
});

0 commit comments

Comments
 (0)