test(e2e): Playwright UI smoke + Go integration tests against MAS
- Playwright e2e against Vite dev server (LoginScreen renders, homeserver visible, version pinned). Fallback documented to swap to `wails dev -browser` via WAILS_DEV_URL when full backend bindings are required. - Go integration tests (//go:build integration,goolm) for Start + ListRooms + LoadTimeline + SendText + GetDiagnostics against real Synapse. Skip cleanly if MATRIX_INTEGRATION_TOKEN/USER env vars unset so CI never breaks unattended. - pnpm e2e/e2e:ui/e2e:report scripts. Per-run keyring namespace + t.TempDir XDG_CONFIG_HOME so integration tests don't clobber the production keyring entry. E2E.md explains how to run each layer + limits (OIDC not automated).
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { test, expect } from "@playwright/test";
|
||||
|
||||
// UI smoke against the React frontend served by Vite. We don't need a real
|
||||
// Wails backend: the only runtime call on mount (GetLastUserID) throws because
|
||||
// window.go is undefined, the catch path drops the loading overlay, and
|
||||
// LoginScreen renders identically to what the production app shows on first
|
||||
// launch. This catches HTML/CSS/asset regressions + Mantine bundle errors
|
||||
// without dragging the full Go+goolm compile into CI.
|
||||
|
||||
test("LoginScreen renders with Sign-in button", async ({ page }) => {
|
||||
// Swallow uncaught Wails-runtime errors so they don't fail the test.
|
||||
page.on("pageerror", () => {});
|
||||
await page.goto("/");
|
||||
await expect(page.getByRole("heading", { name: /matrix_client_pc/i })).toBeVisible();
|
||||
await expect(
|
||||
page.getByRole("button", { name: /sign in with matrix/i }),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
test("LoginScreen mentions homeserver + MAS context", async ({ page }) => {
|
||||
page.on("pageerror", () => {});
|
||||
await page.goto("/");
|
||||
await expect(page.getByText(/matrix-af2f3d/)).toBeVisible();
|
||||
await expect(
|
||||
page.getByText(/matrix authentication service/i),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
test("LoginScreen shows version tag", async ({ page }) => {
|
||||
page.on("pageerror", () => {});
|
||||
await page.goto("/");
|
||||
await expect(page.getByText(/v0\.1\.0 \(issue 0147\)/i)).toBeVisible();
|
||||
});
|
||||
Reference in New Issue
Block a user