Skip to content

Commit 2cf9a35

Browse files
Check if menu bar buttons are display and functionality works (#2621)
Test the main page for existence of - theme button visible - clicking shows the list of themes - search button visible - and tests successful search for "Welcome" - language button visible - clicking shows the list of languages this is testing functionality missing in dev environments in #2588 and is relevant for #2620
1 parent 466f213 commit 2cf9a35

File tree

2 files changed

+32
-9
lines changed

2 files changed

+32
-9
lines changed

tests/src/basic.test.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

tests/src/generic_page.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { describe, it } from "mocha";
2+
import { expect, browser, $ } from "@wdio/globals";
3+
4+
describe("Generic page", () => {
5+
beforeEach(async () => {
6+
await browser.url("/");
7+
});
8+
9+
it("should have the default_theme light", async () => {
10+
expect(await browser.execute(() => window.default_theme)).toBe("light");
11+
});
12+
13+
it("should have theme button and show theme list on click", async () => {
14+
await expect($("#theme-toggle")).toBeDisplayed();
15+
await $("#theme-toggle").click();
16+
await expect($("#theme-list")).toBeDisplayed();
17+
});
18+
19+
it("should have search button and successfully provide search results on search", async () => {
20+
await expect($("#search-toggle")).toBeDisplayed();
21+
await $("#search-toggle").click();
22+
await browser.keys(["Welcome"]);
23+
// any of the <a> links in the searchresults is containing "Welcome"
24+
await expect($("#searchresults").$("*=Welcome")).toBeDisplayed();
25+
});
26+
27+
it("should have language button and show language list on click", async () => {
28+
await expect($("#language-toggle")).toBeDisplayed();
29+
await $("#language-toggle").click();
30+
await expect($("#language-list")).toBeDisplayed();
31+
});
32+
});

0 commit comments

Comments
 (0)