Files
OpenMesh/surfaces/gui/e2e-live/api-smoke.spec.ts
zhaolei 6f402ffcee
Some checks failed
CI / pytest (push) Has been cancelled
CI / gui-unit (push) Has been cancelled
CI / gui-e2e (push) Has been cancelled
feat: OpenMesh 基础平台与 MD/PDF 转换技能
- 后端: coworker 智能体框架, WS API, 文件上传, 附件处理
- 前端: Open WebUI, 文件全量走 upload API (含 MD/TXT/JSON 等文本类)
- 技能: md-to-office (pandoc + wkhtmltopdf)
- 修复: 上传文件路径丢失, Agent 搜索浪费, 输出文件跑到 uploads/
- 打包: PyInstaller one-dir, 预打包 pandoc/wkhtmltopdf/chromium
2026-09-13 23:41:04 +08:00

44 lines
1.7 KiB
TypeScript

// LIVE smoke — API shape only (no model tokens). Hits the REAL sidecar's /v1/health and
// /v1/providers to catch integration drift between the GUI's expectations and the backend's
// responses. Skips cleanly when the backend is down, so it's safe to run anytime. No creds needed.
import { expect, test } from "@playwright/test";
import { backendFetch } from "./helpers";
async function backendUp(): Promise<boolean> {
try {
const res = await backendFetch("/v1/health");
return res.ok;
} catch {
return false;
}
}
test("health reports ok with the fields the GUI reads", async () => {
test.skip(!(await backendUp()), "backend not running on :8765");
const s = await (await backendFetch("/v1/health")).json();
expect(s.status).toBe("ok");
// The GUI's boot reads these three off /v1/health.
expect(s).toHaveProperty("model");
expect(s).toHaveProperty("default_workspace");
});
test("providers list has the shape the Settings pane expects", async () => {
test.skip(!(await backendUp()), "backend not running on :8765");
const providers = await (await backendFetch("/v1/providers")).json();
expect(Array.isArray(providers)).toBe(true);
expect(providers.length).toBeGreaterThan(0);
// Each descriptor carries what ManageTabs renders: name/title/needs_key/fields/configured.
for (const p of providers) {
expect(p).toMatchObject({
name: expect.any(String),
title: expect.any(String),
needs_key: expect.any(Boolean),
configured: expect.any(Boolean),
});
expect(Array.isArray(p.fields)).toBe(true);
}
// The core providers Rohit tested should be present.
const names = providers.map((p: any) => p.name);
expect(names).toEqual(expect.arrayContaining(["openai", "anthropic"]));
});