fc644ecd6e
Reemplaza el scaffold del echobot por la plataforma completa de bots traida desde ~/DataProyects/Github/agents_and_robots tras la operacion Matrix-out: los bots ya no hablan por Matrix sino por el bus unibus (modelo todo-rooms + E2E via shell/transportunibus sobre github.com/enmanuel/unibus/pkg/client). - go.mod: replace de unibus -> ../unibus y de fn-registry -> ../../../.. (paths relativos reajustados a la nueva ubicacion dentro de fn_registry). - app.md: bump a 0.2.0, descripcion + arquitectura + comandos + gotchas reales. - modulo Go conservado como github.com/enmanuel/agents (sin reescribir imports). agents_and_robots queda archivado como museo de la era Matrix.
64 lines
1.7 KiB
TypeScript
64 lines
1.7 KiB
TypeScript
import { test, expect, handleElementDialogs } from "../fixtures/persistent-context";
|
|
import {
|
|
goToRoom,
|
|
sendMessage,
|
|
waitForBotReply,
|
|
assertNoDecryptionErrors,
|
|
} from "../fixtures/matrix-room";
|
|
|
|
test.describe("assistant-bot", () => {
|
|
test.beforeEach(async ({ page }) => {
|
|
await page.goto("/");
|
|
await handleElementDialogs(page);
|
|
await goToRoom(page, "Assistant");
|
|
});
|
|
|
|
test("responde a un saludo en DM", async ({ page }) => {
|
|
await sendMessage(page, "Hola, como estas?");
|
|
|
|
const reply = await waitForBotReply(page, {
|
|
timeout: 60_000,
|
|
sender: "Assistant",
|
|
});
|
|
expect(reply).toBeTruthy();
|
|
expect(reply.length).toBeGreaterThan(10);
|
|
});
|
|
|
|
test("responde a una pregunta con contenido coherente", async ({ page }) => {
|
|
await sendMessage(page, "Que es la fotosintesis? Responde en una frase.");
|
|
|
|
const reply = await waitForBotReply(page, {
|
|
timeout: 60_000,
|
|
sender: "Assistant",
|
|
});
|
|
expect(reply).toBeTruthy();
|
|
expect(reply.length).toBeGreaterThan(10);
|
|
});
|
|
|
|
test("!help muestra lista de comandos", async ({ page }) => {
|
|
await sendMessage(page, "!help");
|
|
|
|
const reply = await waitForBotReply(page, {
|
|
timeout: 10_000,
|
|
sender: "Assistant",
|
|
});
|
|
expect(reply).toBeTruthy();
|
|
expect(reply.toLowerCase()).toContain("help");
|
|
expect(reply.toLowerCase()).toContain("ping");
|
|
});
|
|
|
|
test("!ping responde", async ({ page }) => {
|
|
await sendMessage(page, "!ping");
|
|
|
|
const reply = await waitForBotReply(page, {
|
|
timeout: 10_000,
|
|
sender: "Assistant",
|
|
});
|
|
expect(reply).toBeTruthy();
|
|
});
|
|
|
|
test("no hay errores de E2EE en el timeline", async ({ page }) => {
|
|
await assertNoDecryptionErrors(page);
|
|
});
|
|
});
|