Files
OpenMesh/surfaces/gui/e2e/skills-session.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

40 lines
2.1 KiB
TypeScript

import { test, expect } from "./fixtures";
// SKILLS-SPEC §9 journey 2 — liveness from the session's seat: the composer's "/" popup is
// the live "what can my worker use right now" view. A skill created in Settings is offered;
// a disabled one vanishes. Hermetic: the popup reads /v1/sessions/{id}/skills from fixtures.
test("skills-session: new skill offered in '/', disabled one absent", async ({ page }) => {
await page.goto("/");
await page.getByText("Draft the launch note").first().click();
// The seeded menu: both enabled skills offered on "/".
const box = page.getByPlaceholder(/Ask the coworker/);
await box.fill("/");
await expect(page.getByTestId("skill-popup")).toBeVisible();
await expect(page.getByText("/weekly-report")).toBeVisible();
await expect(page.getByText("/html-to-markdown")).toBeVisible();
await box.fill(""); // close the popup
// Settings round-trip: create one skill, disable another.
await page.getByTestId("account-row").click();
await page.getByRole("button", { name: "Settings", exact: true }).click();
await page.getByRole("button", { name: "Skills", exact: true }).click();
await page.getByRole("button", { name: /Add skill/ }).click();
await page.getByText("Write it myself").click();
await page.getByLabel("Name").fill("fresh-skill");
await page.getByLabel("Instructions").fill("Do the fresh thing.");
await page.getByRole("button", { name: "Save skill" }).click();
await expect(page.getByRole("status")).toContainText("fresh-skill");
await page.getByLabel("weekly-report enabled").click();
await expect(page.getByRole("status")).toContainText("turned off everywhere");
// Back in the session: the popup reflects the new state — created offered, disabled gone.
await page.getByText("Draft the launch note").first().click();
await box.fill("/");
await expect(page.getByTestId("skill-popup")).toBeVisible();
await expect(page.getByText("/fresh-skill")).toBeVisible();
await expect(page.getByText("/weekly-report")).toHaveCount(0);
await expect(page.getByText("/html-to-markdown")).toBeVisible(); // untouched one persists
});