Files
logos-tutorial/outputs/logos-calc-ui/tests/ui-tests.mjs
Iuri Matias d17fce1360 support --output option ; generate both tutorials and example code from test specs
support --output option ; generate both tutorials and example code from test specs

delete old code files

add to readme instructions about run.sh

update run.sh to avoid logs and hardcoded paths
2026-05-29 11:50:37 -04:00

35 lines
942 B
JavaScript

import { resolve } from "node:path";
// CI sets LOGOS_QT_MCP automatically; for interactive use: nix build .#test-framework -o result-mcp
const root =
process.env.LOGOS_QT_MCP ||
new URL("../result-mcp", import.meta.url).pathname;
const { test, run } = await import(
resolve(root, "test-framework/framework.mjs")
);
test("calc_ui: loads and shows title", async (app) => {
await app.waitFor(
async () => {
await app.expectTexts(["Logos Calculator"]);
},
{ timeout: 15000, interval: 500, description: "calc_ui to load" },
);
});
test("calc_ui: add button visible", async (app) => {
await app.expectTexts(["Add"]);
});
test("calc_ui: click add shows validation", async (app) => {
await app.click("Add");
await app.waitFor(
async () => {
await app.expectTexts(["Enter values for a and b"]);
},
{ timeout: 5000, interval: 500, description: "validation message to appear" },
);
});
run();