forked from evcc-io/evcc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsmart-cost-only.spec.js
31 lines (26 loc) · 1.08 KB
/
smart-cost-only.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
import { test, expect } from "@playwright/test";
import { start, stop, baseUrl } from "./evcc";
test.use({ baseURL: baseUrl() });
test.beforeAll(async () => {
await start("smart-cost-only.evcc.yaml", "password.sql");
});
test.afterAll(async () => {
await stop();
});
test.beforeEach(async ({ page }) => {
await page.goto("/");
});
test.describe("main screen", async () => {
test("smart mode", async ({ page }) => {
await expect(page.getByRole("button", { name: "Off" })).toBeVisible();
await expect(page.getByRole("button", { name: "Smart" })).toBeVisible();
await expect(page.getByRole("button", { name: "Fast" })).toBeVisible();
});
test("no production and feedin", async ({ page }) => {
await page.getByTestId("energyflow").click();
await expect(page.getByTestId("energyflow-entry-gridimport")).toBeVisible();
await expect(page.getByTestId("energyflow-entry-home")).not.toBeVisible();
await expect(page.getByTestId("energyflow-entry-loadpoints")).toBeVisible();
await expect(page.getByTestId("energyflow-entry-gridexport")).not.toBeVisible();
});
});