Skip to content

Commit

Permalink
Check if menu bar buttons are display and functionality works (google…
Browse files Browse the repository at this point in the history
…#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
google#2588 and is relevant
for google#2620
  • Loading branch information
michael-kerscher committed Feb 7, 2025
1 parent 7b24dd4 commit b5f6017
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 9 deletions.
9 changes: 0 additions & 9 deletions tests/src/basic.test.ts

This file was deleted.

32 changes: 32 additions & 0 deletions tests/src/generic_page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { describe, it } from "mocha";
import { expect, browser, $ } from "@wdio/globals";

describe("Generic page", () => {
beforeEach(async () => {
await browser.url("/");
});

it("should have the default_theme light", async () => {
expect(await browser.execute(() => window.default_theme)).toBe("light");
});

it("should have theme button and show theme list on click", async () => {
await expect($("#theme-toggle")).toBeDisplayed();
await $("#theme-toggle").click();
await expect($("#theme-list")).toBeDisplayed();
});

it("should have search button and successfully provide search results on search", async () => {
await expect($("#search-toggle")).toBeDisplayed();
await $("#search-toggle").click();
await browser.keys(["Welcome"]);
// any of the <a> links in the searchresults is containing "Welcome"
await expect($("#searchresults").$("*=Welcome")).toBeDisplayed();
});

it("should have language button and show language list on click", async () => {
await expect($("#language-toggle")).toBeDisplayed();
await $("#language-toggle").click();
await expect($("#language-list")).toBeDisplayed();
});
});

0 comments on commit b5f6017

Please sign in to comment.