Include scenario version in e2e test export filename #20

Closed
opened 2026-10-08 18:12:49 +03:00 by ars9 · 0 comments
Owner

#13 put the version in the scenario and snippet YAML export filenames, and made the client request that exact version so the file content always matches its name. The e2e test export (Export e2e test button, GET /scenarios/:id/export-e2e, MCP export_e2e_test) still has neither of those:

  • The zip is always named <slug>-e2e-test.zip (server) / <scenario name>-e2e-test.zip (client), so exports of different versions overwrite each other or can't be told apart.
  • E2eExportService.buildE2eTestPackage always builds from the scenario's current steps. There's no way to export a specific version.

Proposed changes

Server

  • GET /scenarios/:id/export-e2e takes an optional ?version=N (same ParseIntPipe({ optional: true }) as /export). It defaults to the latest version.
  • buildE2eTestPackage(id, version?) reads the steps from scenarioService.findVersion(id, version ?? scenario.version) instead of scenario.steps.
  • Name the zip <slug>-v<N>-e2e-test.zip and the generated package.json <slug>-v<N>-e2e-test. Optionally, put the version in the generated README header too.
  • 404 for a version that doesn't exist, as /export does.

MCP

  • export_e2e_test takes an optional version input ("Scenario version to export. Defaults to the latest"), like export_scenario.

Client

  • scenarios.exportE2eTestUrl(id, version?) appends ?version=N.
  • ScenarioDetailPage passes scenario.version and downloads as ${scenario.name}-v${scenario.version}-e2e-test.zip.

Docs/tests

  • Update docs/scenario.md / docs/mcp.md for the new parameter.
  • Add server tests: the default and explicit version select the right steps, the filename includes the version, and an unknown version returns 404.

Note on snippets

Snippets are resolved the same way as in the YAML export: versions pinned with alias@N are bundled at that version, and unpinned runSnippet("alias") calls get the latest snippet version. Scenario versions don't record which snippet version was latest when they were saved, so an older scenario export can pick up newer snippet code. That's existing behavior and out of scope here.

#13 put the version in the scenario and snippet YAML export filenames, and made the client request that exact version so the file content always matches its name. The e2e test export (`Export e2e test` button, `GET /scenarios/:id/export-e2e`, MCP `export_e2e_test`) still has neither of those: - The zip is always named `<slug>-e2e-test.zip` (server) / `<scenario name>-e2e-test.zip` (client), so exports of different versions overwrite each other or can't be told apart. - `E2eExportService.buildE2eTestPackage` always builds from the scenario's current steps. There's no way to export a specific version. ## Proposed changes **Server** - `GET /scenarios/:id/export-e2e` takes an optional `?version=N` (same `ParseIntPipe({ optional: true })` as `/export`). It defaults to the latest version. - `buildE2eTestPackage(id, version?)` reads the steps from `scenarioService.findVersion(id, version ?? scenario.version)` instead of `scenario.steps`. - Name the zip `<slug>-v<N>-e2e-test.zip` and the generated `package.json` `<slug>-v<N>-e2e-test`. Optionally, put the version in the generated README header too. - 404 for a version that doesn't exist, as `/export` does. **MCP** - `export_e2e_test` takes an optional `version` input ("Scenario version to export. Defaults to the latest"), like `export_scenario`. **Client** - `scenarios.exportE2eTestUrl(id, version?)` appends `?version=N`. - `ScenarioDetailPage` passes `scenario.version` and downloads as `${scenario.name}-v${scenario.version}-e2e-test.zip`. **Docs/tests** - Update `docs/scenario.md` / `docs/mcp.md` for the new parameter. - Add server tests: the default and explicit version select the right steps, the filename includes the version, and an unknown version returns 404. ## Note on snippets Snippets are resolved the same way as in the YAML export: versions pinned with `alias@N` are bundled at that version, and unpinned `runSnippet("alias")` calls get the latest snippet version. Scenario versions don't record which snippet version was latest when they were saved, so an older scenario export can pick up newer snippet code. That's existing behavior and out of scope here.
ars9 closed this issue 2026-10-08 18:53:27 +03:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ars9/liqa#20