You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.3 KiB
39 lines
1.3 KiB
import { expect, test } from "@playwright/test";
|
|
import { login, restoreSqliteSnapshot, screenshot } from "../util-test";
|
|
|
|
test.describe("Example Spec", () => {
|
|
|
|
test.beforeEach(async ({ page }) => {
|
|
await restoreSqliteSnapshot(page);
|
|
});
|
|
|
|
test("dashboard", async ({ page }, testInfo) => {
|
|
await page.goto("./dashboard");
|
|
await login(page);
|
|
await screenshot(testInfo, page);
|
|
});
|
|
|
|
test("change display timezone", async ({ page }, testInfo) => {
|
|
await page.goto("./settings/general");
|
|
await login(page);
|
|
await page.getByLabel("Display Timezone").selectOption("Pacific/Fiji");
|
|
await page.getByRole("button", { name: "Save" }).click();
|
|
await screenshot(testInfo, page);
|
|
|
|
await page.goto("./dashboard");
|
|
await page.goto("./settings/general");
|
|
await expect(page.getByLabel("Display Timezone")).toHaveValue("Pacific/Fiji");
|
|
});
|
|
|
|
test("database is reset after previous test", async ({ page }, testInfo) => {
|
|
await page.goto("./settings/general");
|
|
await login(page);
|
|
|
|
const timezoneEl = page.getByLabel("Display Timezone");
|
|
await expect(timezoneEl).toBeVisible();
|
|
await expect(timezoneEl).toHaveValue("auto");
|
|
await screenshot(testInfo, page);
|
|
});
|
|
|
|
});
|