forked from google/comprehensive-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check if menu bar buttons are display and functionality works (google…
…#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
1 parent
7b24dd4
commit b5f6017
Showing
2 changed files
with
32 additions
and
9 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
}); |