feat(scenario): export scenarios as standalone playwright e2e test projects

- Added E2eExportService to package scenarios as plug-and-play zip archives
  containing package.json, playwright.config.ts, test.spec.ts, .env, credentials.json,
  snippets, and referenced scenario files
- Only bundles credentials, snippets, and files actually referenced (directly or
  transitively) by the scenario's steps, reducing archive size
- Exported test runs entirely offline using a context shim that mirrors liqa's API
  (page, getCredential, runSnippet, getScenarioFiles, downloadFile, assert, etc.)
- Added GET /scenarios/:id/export-e2e HTTP endpoint and export_e2e_test MCP tool
- Added getUsedSnippets() endpoint to list snippets referenced by a scenario
- Added "Used Snippets" section on scenario detail page
- Added archiver@^7.0.1 dependency for zip archive creation
- Bumped version to 1.11.0
This commit is contained in:
ars9 committed 2026-09-16 12:33:16 +03:00
1 parent 385f51f3ba
commit 1eea4eb8d8
14 files changed
+1348 -11

No files matched your search

+7 -1
View File
@@ -5,7 +5,7 @@ import {
OnModuleInit,
} from "@nestjs/common";
import { InjectRepository } from "@nestjs/typeorm";
import { Repository } from "typeorm";
import { In, Repository } from "typeorm";
import {
PaginatedResult,
PaginationQueryDto,
@@ -111,6 +111,12 @@ export class SnippetService implements OnModuleInit {
return Object.fromEntries(data.map((s) => [s.alias, s.code]));
}
/** Returns the snippet entities matching the given aliases (used by executor/executor consumers). */
async findByAliases(aliases: string[]): Promise<SnippetEntity[]> {
if (aliases.length === 0) return [];
return this.repo.find({ where: { alias: In(aliases) } });
}
exportSnippet(snippet: SnippetEntity): SnippetExportDto {
return {
kind: "snippet",