forked from evcc-io/evcc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logs.spec.js
43 lines (39 loc) · 1.62 KB
/
logs.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { test, expect } from "@playwright/test";
import { start, stop, baseUrl } from "./evcc";
test.use({ baseURL: baseUrl() });
test.beforeAll(async () => {
await start("basics.evcc.yaml");
});
test.afterAll(async () => {
await stop();
});
test.describe("opening logs", async () => {
test("via config", async ({ page }) => {
await page.goto("/");
await page.getByTestId("topnavigation-button").click();
await page.getByRole("link", { name: "Configuration" }).click();
await page.getByRole("link", { name: "Logs" }).click();
await expect(page.getByRole("heading", { name: "Logs", exact: false })).toBeVisible();
});
test("via notifications", async ({ page }) => {
await page.goto("/");
await page.evaluate(() => window.app.raise({ message: "Fake Error" }));
await page.getByTestId("notification-icon").click();
await page.getByRole("link", { name: "View full logs" }).click();
await expect(page.getByRole("heading", { name: "Logs", exact: false })).toBeVisible();
});
test("via need help", async ({ page }) => {
await page.goto("/");
await page.getByTestId("topnavigation-button").click();
await page.getByRole("button", { name: "Need Help?" }).click();
await page.getByRole("link", { name: "View logs" }).click();
await expect(page.getByRole("heading", { name: "Logs", exact: false })).toBeVisible();
});
});
test.describe("features", async () => {
test("content", async ({ page }) => {
await page.goto("/#/log");
await page.getByTestId("log-search").fill("listening at");
await expect(page.getByTestId("log-content")).toContainText("listening at");
});
});