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
This commit is contained in:
43
surfaces/gui/e2e-live/api-smoke.spec.ts
Normal file
43
surfaces/gui/e2e-live/api-smoke.spec.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
// 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"]));
|
||||
});
|
||||
Reference in New Issue
Block a user