forked from evcc-io/evcc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvehicle-error.spec.js
30 lines (24 loc) · 1018 Bytes
/
vehicle-error.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
import { test, expect } from "@playwright/test";
import { start, stop, baseUrl } from "./evcc";
test.use({ baseURL: baseUrl() });
test.beforeAll(async () => {
await start("vehicle-error.evcc.yaml", "password.sql");
});
test.afterAll(async () => {
await stop();
});
test.beforeEach(async ({ page }) => {
await page.goto("/");
});
test.describe("vehicle startup error", async () => {
test("broken vehicle: normal title and 'not reachable' icon", async ({ page }) => {
await expect(page.getByTestId("vehicle-name")).toHaveText("Broken Tesla");
await expect(page.getByTestId("vehicle-not-reachable-icon")).toBeVisible();
});
test("guest vehicle: normal title and no icon", async ({ page }) => {
// switch to offline vehicle
await page.getByTestId("change-vehicle").locator("select").selectOption("Guest vehicle");
await expect(page.getByTestId("vehicle-name")).toHaveText("Guest vehicle");
await expect(page.getByTestId("vehicle-not-reachable-icon")).not.toBeVisible();
});
});