daedalOS/e2e/components/system/Wallpaper.spec.ts
2023-07-21 10:48:34 -07:00

36 lines
883 B
TypeScript

import { test } from "@playwright/test";
import {
backgroundIsUrl,
canvasBackgroundIsHidden,
canvasBackgroundIsVisible,
clickContextMenuEntry,
clickDesktop,
contextMenuIsVisible,
desktopIsVisible,
loadApp,
} from "e2e/functions";
test.beforeEach(loadApp);
test.beforeEach(desktopIsVisible);
test("has background", canvasBackgroundIsVisible);
test("can change background", async ({ page }) => {
await clickDesktop({ page }, true);
await contextMenuIsVisible({ page });
await canvasBackgroundIsVisible({ page });
await clickContextMenuEntry(/^Background$/, { page });
await clickContextMenuEntry(/^Picture Slideshow$/, { page });
await canvasBackgroundIsHidden({ page });
await backgroundIsUrl({ page });
await page.reload();
await desktopIsVisible({ page });
await canvasBackgroundIsHidden({ page });
await backgroundIsUrl({ page });
});