Compare commits

...
Author SHA1 Message Date
ars9 d4bb274982 chore(release): cut minor release
CI / changes (push) Skipped
CI / server (push) Failing after 34m15s
CI / client (push) Successful in 2m43s
CI / image (push) Skipped
- bump version to 1.26.0
- add versioned e2e test export to the changelog
2026-10-08 18:54:34 +03:00
ars9 969f24ea73 Merge pull request 'feat: export e2e tests for a chosen scenario version' (#21) from feat/e2e-export-version into master
CI / changes (push) Successful in 16s
CI / server (push) Successful in 1m32s
CI / client (push) Successful in 1m32s
CI / image (push) Skipped
Reviewed-on: #21
2026-10-08 18:53:26 +03:00
ars9 81164f8494 feat: export e2e tests for a chosen scenario version
CI / changes (pull_request) Successful in 14s
CI / server (pull_request) Successful in 2m25s
CI / client (pull_request) Successful in 1m35s
CI / image (pull_request) Skipped
- GET /scenarios/:id/export-e2e and the export_e2e_test MCP tool take
  an optional version, defaulting to the latest
- build the test project from that version's steps, name and timeout
- put the version in the zip name (<scenario>-vN-e2e-test.zip), the
  generated package name and the README heading
- the Export e2e test button exports the version being viewed
- document the e2e export in scenario.md and mcp.md
2026-10-08 18:37:33 +03:00
ars9 14763103cf chore(release): cut minor release
CI / server (push) Successful in 1m7s
CI / changes (push) Skipped
CI / client (push) Successful in 1m23s
CI / image (push) Successful in 1m59s
- bump version to 1.25.0
- add browser notifications for scenario runs to the changelog
2026-10-07 19:23:01 +03:00
ars9 78f4c35d56 docs(claude): forbid co-author trailers and issue refs in commits
CI / changes (push) Successful in 6s
CI / server (push) Skipped
CI / client (push) Skipped
CI / image (push) Skipped
- keep issue references like Closes #12 for pull request descriptions
2026-10-07 19:22:02 +03:00
ars9 4b050fbdc4 Merge pull request 'Browser notifications' (#14) from feat/browser-notifications into master
CI / changes (push) Successful in 6s
CI / server (push) Successful in 3m4s
CI / client (push) Successful in 1m33s
CI / image (push) Skipped
Reviewed-on: #14
2026-10-07 19:20:59 +03:00
12 changed files with 132 additions and 20 deletions

No files matched your search

+25
View File
@@ -2,6 +2,31 @@
All notable changes to this project will be documented in this file.
## 1.26.0 - 2026-10-08
Changes since 1.25.0:
### Added
- e2e test export for a chosen scenario version: `GET /api/v1/scenarios/:id/export-e2e` and the `export_e2e_test` MCP tool take an optional `version` (defaults to the latest), and the test project is built from that version's steps, name and timeout. The Export e2e test button in the UI exports the version being viewed.
### Changed
- Exported e2e test archives include the version in their filename (`<scenario name>-v<N>-e2e-test.zip`), and the version also appears in the generated package name and README heading.
## 1.25.0 - 2026-10-07
Changes since 1.24.4:
### Added
- Browser notifications for scenario runs: the UI shows "Run started / passed / failed: <scenario>" notifications for runs started from the UI, the REST API, MCP or the scheduler; clicking one opens the run. Turn them on with the bell button in the side panel footer (granting the permission from the browser's prompt or site settings works too). Notifications need a secure context (HTTPS or `localhost`).
- `GET /api/v1/scenarios/runs/events`: a server-sent events stream of run lifecycle events (`run.started`, `run.finished`) with a periodic `ping` heartbeat.
### Changed
- Runs lists refresh as soon as a run finishes while notifications are on.
## 1.24.4 - 2026-10-07
Changes since 1.24.3:
+2
View File
@@ -31,6 +31,8 @@ The live database is `data/liqa.db`. The container applies pending migrations be
Never commit directly to `master` when implementing a feature, chore or bug fix: create a separate branch for the work first, forked from `master`. These commits don't change the version or `CHANGELOG.md`; the branch is merged back to `master` through a pull request. Only release commits (see "Releasing a new version") are made on `master`.
Never add a `Co-Authored-By` trailer to commit messages. Don't put issue references like `Closes #12` in commit messages either; they belong only in the pull request description.
When committing on a work branch, also update the docs affected by the change (`docs/*.md`, `README.md`, `.env.example`, MCP tool descriptions) in the same branch.
## Code quality
+3 -2
View File
@@ -275,8 +275,9 @@ export const scenarios = {
}
return request(`/scenarios/${id}/export?${params.toString()}`);
},
exportE2eTestUrl(id: string): string {
return `${BASE_URL}/scenarios/${id}/export-e2e`;
exportE2eTestUrl(id: string, version?: number): string {
const query = version === undefined ? '' : `?version=${version}`;
return `${BASE_URL}/scenarios/${id}/export-e2e${query}`;
},
usedSnippets(id: string): Promise<UsedSnippet[]> {
return request(`/scenarios/${id}/used-snippets`);
@@ -504,7 +504,10 @@ export function ScenarioDetailPage() {
variant="secondary"
size="sm"
onClick={() =>
handleFileDownload(scenarios.exportE2eTestUrl(id!), `${scenario.name}-e2e-test.zip`)
handleFileDownload(
scenarios.exportE2eTestUrl(id!, scenario.version),
`${scenario.name}-v${scenario.version}-e2e-test.zip`,
)
}
>
<FileArchive size={14} />
+1 -1
View File
@@ -61,7 +61,7 @@ The server registers the following tools. All entity IDs are UUIDs; list tools a
| `export_scenario` | Export one scenario version (optional `version`, defaults to the latest) |
| `import_scenario` | Import one scenario version; `version` is required (see "Versioning" in [scenario.md](scenario.md)) |
| `import_yaml` | Import any mix of environments, credentials, snippets and scenarios from YAML (see "Import" in [scenario.md](scenario.md)) |
| `export_e2e_test` | Export a scenario as a standalone Playwright test project (zip, base64) |
| `export_e2e_test` | Export one scenario version as a standalone Playwright test project (zip, base64; optional `version`, defaults to the latest) |
Changes to scenario content (fields and steps) create a new scenario version; credential assignments and files are not versioned.
+4
View File
@@ -114,6 +114,10 @@ steps:
execCode: await context.page.goto(context.getEnv("base_url"));
```
### E2e test export
`GET /scenarios/:id/export-e2e` (the "Export e2e test" button, the `export_e2e_test` MCP tool) exports one scenario version as a standalone Playwright test project, zipped as `<scenario>-v<N>-e2e-test.zip`. It takes an optional `version` (default: the latest). Snippets are bundled the same way as in the scenario export: the latest version for plain `runSnippet("alias")` calls, plus each version pinned with `alias@N`. The environment, credentials and files are the scenario's current ones; they are not versioned.
## Playwright traces
A run can record a [Playwright trace](https://playwright.dev/docs/trace-viewer) of its browser context (screenshots and DOM snapshots). When the run finishes, the trace is uploaded to the run's files as `trace.zip`. Download it from the run detail page, then open it with `npx playwright show-trace trace.zip` or at https://trace.playwright.dev.
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "liqa",
"version": "1.24.4",
"version": "1.26.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "liqa",
"version": "1.24.4",
"version": "1.26.0",
"license": "MIT",
"workspaces": [
"server",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "liqa",
"version": "1.24.4",
"version": "1.26.0",
"private": true,
"license": "MIT",
"author": "Andrii Arsenin",
+9 -3
View File
@@ -1343,15 +1343,21 @@ export class McpService {
"export_e2e_test",
{
description:
"Export a scenario as a standalone, plug-and-play Playwright e2e test project (package.json, playwright.config.ts, test.spec.ts, .env), zipped and returned as base64",
"Export one version of a scenario as a standalone, plug-and-play Playwright e2e test project (package.json, playwright.config.ts, test.spec.ts, .env), zipped and returned as base64",
inputSchema: {
id: z.uuid().describe("Scenario ID to export"),
version: z
.number()
.int()
.min(1)
.optional()
.describe("Scenario version to export. Defaults to the latest"),
},
},
async ({ id }) => {
async ({ id, version }) => {
try {
const { filename, buffer } =
await this.e2eExportService.buildE2eTestPackage(id);
await this.e2eExportService.buildE2eTestPackage(id, version);
return {
content: [
{
+16 -8
View File
@@ -42,8 +42,16 @@ export class E2eExportService {
private readonly snippetService: SnippetService,
) {}
async buildE2eTestPackage(scenarioId: string): Promise<{ filename: string; buffer: Buffer }> {
/** Builds the package for the latest version, or `version` when given. */
async buildE2eTestPackage(
scenarioId: string,
version?: number,
): Promise<{ filename: string; buffer: Buffer }> {
const scenario = await this.scenarioService.findOne(scenarioId);
const content = await this.scenarioService.findVersion(
scenarioId,
version ?? scenario.version,
);
const [credentialMap, snippetMap, attachedFiles] = await Promise.all([
this.scenarioService.buildCredentialMap(scenarioId),
this.snippetService.buildSnippetMap(),
@@ -51,10 +59,10 @@ export class E2eExportService {
]);
const envData = scenario.environment?.data ?? {};
const slug = slugify(scenario.name);
const slug = `${slugify(content.name)}-v${content.version}`;
const files: Record<string, string | Buffer> = {
"package.json": this.buildPackageJson(slug),
"playwright.config.ts": this.buildPlaywrightConfig(scenario.timeoutSeconds),
"playwright.config.ts": this.buildPlaywrightConfig(content.timeoutSeconds),
".env": this.buildEnvFile(envData),
"credentials.json": JSON.stringify(credentialMap, null, 2) + "\n",
".gitignore": [
@@ -65,7 +73,7 @@ export class E2eExportService {
".env",
"credentials.json",
].join("\n") + "\n",
"README.md": this.buildReadme(scenario.name, scenario.description),
"README.md": this.buildReadme(content.name, content.version, content.description),
};
// Bundle any files attached to the scenario so getScenarioFiles works offline.
@@ -97,7 +105,7 @@ export class E2eExportService {
// Bundle only the snippets actually referenced (directly or transitively via
// other snippets) by this scenario's steps, as individual .js files under snippets/.
const usedAliases = resolveUsedSnippetAliases(
scenario.steps.map((s) => s.execCode ?? ""),
content.steps.map((s) => s.execCode ?? ""),
snippetMap,
);
const snippetManifest: { alias: string; filename: string }[] = [];
@@ -116,7 +124,7 @@ export class E2eExportService {
snippetManifest.push({ alias, filename });
}
files["test.spec.ts"] = this.buildTestSpec(scenario, snippetManifest, fileManifest);
files["test.spec.ts"] = this.buildTestSpec(content, snippetManifest, fileManifest);
const buffer = await this.zip(files);
return { filename: `${slug}-e2e-test.zip`, buffer };
@@ -173,9 +181,9 @@ export default defineConfig({
);
}
private buildReadme(scenarioName: string, description: string | null): string {
private buildReadme(scenarioName: string, version: number, description: string | null): string {
const descriptionSection = description?.trim() ? `${description.trim()}\n\n` : "";
return `# ${scenarioName} - standalone e2e test
return `# ${scenarioName} (v${version}) - standalone e2e test
${descriptionSection}## Setup
+7 -2
View File
@@ -203,12 +203,17 @@ export class ScenarioController {
summary: "Export a scenario as a standalone, plug-and-play Playwright e2e test (zip)",
})
@ApiResponse({ status: 200, description: "Zip archive" })
@ApiResponse({ status: 404, description: "Scenario not found" })
@ApiResponse({ status: 404, description: "Scenario or version not found" })
async exportE2eTest(
@Param("id", ParseUUIDPipe) id: string,
@Query("version", new ParseIntPipe({ optional: true }))
version: number | undefined,
@Res() res: Response,
) {
const { filename, buffer } = await this.e2eExportService.buildE2eTestPackage(id);
const { filename, buffer } = await this.e2eExportService.buildE2eTestPackage(
id,
version,
);
res.setHeader("Content-Type", "application/zip");
res.setHeader("Content-Disposition", `attachment; filename="${filename}"`);
res.setHeader("Content-Length", buffer.length);
+58
View File
@@ -4,6 +4,7 @@
* - runs record and execute the scenario version they were created with
* - runSnippet("alias@N") pins a snippet version
* - export/import carry and restore exact versions
* - e2e test exports build the requested version
*/
import { INestApplication } from "@nestjs/common";
@@ -12,6 +13,7 @@ import { DataSource } from "typeorm";
import { buildTestApp } from "./app.harness";
import { CredentialEntity } from "../src/credential/credential.entity";
import { EnvironmentEntity } from "../src/environment/environment.entity";
import { E2eExportService } from "../src/scenario/e2e-export.service";
import { ScenarioSchedulerService } from "../src/scenario/scenario-scheduler.service";
import { ScenarioService } from "../src/scenario/scenario.service";
import { SnippetService } from "../src/snippet/snippet.service";
@@ -367,6 +369,62 @@ describe("Versioning", () => {
});
});
describe("e2e test export", () => {
/** Captures the files the next e2e export zips. */
function captureZippedFiles() {
const service = app.get(E2eExportService) as unknown as {
zip: (files: Record<string, string | Buffer>) => Promise<Buffer>;
};
const spy = jest.spyOn(service, "zip");
return () => {
const files = spy.mock.calls[0][0];
spy.mockRestore();
return files;
};
}
it("exports the latest version, or the one asked for", async () => {
const name = `E2e ${uniq()}`;
const slug = name.toLowerCase().replace(" ", "-");
const sc = await scenarioService.create({ name });
await scenarioService.createStep(sc.id, { execCode: "return 'v2';" });
let files = captureZippedFiles();
const latest = await request(app.getHttpServer())
.get(`/scenarios/${sc.id}/export-e2e`)
.expect(200);
expect(latest.headers["content-disposition"]).toBe(
`attachment; filename="${slug}-v2-e2e-test.zip"`,
);
let zipped = files();
expect(zipped["test.spec.ts"]).toContain("return 'v2';");
expect(JSON.parse(zipped["package.json"] as string).name).toBe(
`${slug}-v2-e2e-test`,
);
expect(zipped["README.md"]).toContain(`# ${name} (v2)`);
files = captureZippedFiles();
const first = await request(app.getHttpServer())
.get(`/scenarios/${sc.id}/export-e2e?version=1`)
.expect(200);
expect(first.headers["content-disposition"]).toBe(
`attachment; filename="${slug}-v1-e2e-test.zip"`,
);
zipped = files();
expect(zipped["test.spec.ts"]).not.toContain("return 'v2';");
});
it("rejects a missing or invalid version", async () => {
const sc = await scenarioService.create({ name: `e2e-${uniq()}` });
await request(app.getHttpServer())
.get(`/scenarios/${sc.id}/export-e2e?version=9`)
.expect(404);
await request(app.getHttpServer())
.get(`/scenarios/${sc.id}/export-e2e?version=abc`)
.expect(400);
});
});
describe("snippet export/import", () => {
it("export includes the version and import requires it", async () => {
const alias = `sexp-${uniq()}`;