Skip to content

Commit

Permalink
test: added basic e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
TimPietrusky committed Feb 22, 2024
1 parent 376c118 commit 12fa0c4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
25 changes: 25 additions & 0 deletions playwright/live-painting.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import type { ElectronApplication, Page } from "@playwright/test";
import { test, expect } from "@playwright/test";
import { _electron as electron } from "playwright";

let electronApp: ElectronApplication;
let page: Page;

test.beforeAll(async () => {
electronApp = await electron.launch({ args: ["."] });
const isPackaged = await electronApp.evaluate(async ({ app }) => app.isPackaged);

expect(isPackaged).toBe(false);
});

test.afterAll(async () => {
await electronApp.close();
});

test("Open Live Painting", async () => {
page = await electronApp.firstWindow();

await expect(page.getByTestId("sidebar-live-painting")).toBeVisible();
await page.getByTestId("sidebar-live-painting").click();
await expect(page.getByText("Live Painting")).toBeVisible();
});
6 changes: 5 additions & 1 deletion src/client/organisms/layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ export function Layout({ children }: { children?: ReactNode }) {
<SidebarButton disabled href="/training" startDecorator={<FitnessCenterIcon />}>
{t("common:training")}
</SidebarButton>
<SidebarButton href="/live-painting" startDecorator={<BrushIcon />}>
<SidebarButton
href="/live-painting"
startDecorator={<BrushIcon />}
data-testid="sidebar-live-painting"
>
{t("labels:livePainting")}
</SidebarButton>
<Box sx={{ flex: 1 }} />
Expand Down

0 comments on commit 12fa0c4

Please sign in to comment.