Skip to content

Commit 561b293

Browse files
authored
Run Vitest and Playwright scenarios from qa suite (#92606)
* test(qa): run vitest and playwright scenarios from qa suite * fix(qa): harden scenario suite dispatch * refactor(qa): share scenario path utilities * refactor(qa): share test file scenario runner * refactor(qa): route test file scenarios through suite runtime * refactor(qa): use explicit suite runtime result kind * test(qa): write suite evidence artifact * refactor(qa): clarify suite execution dispatch * fix(qa): keep test-file scenarios out of flow-only runners * refactor(qa): export mixed scenario suite runner
1 parent 21aa8fa commit 561b293

33 files changed

Lines changed: 1599 additions & 210 deletions

‎docs/concepts/qa-e2e-automation.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -787,9 +787,10 @@ the source of truth for one test run and should define:
787787
- docs and code refs
788788
- optional plugin requirements
789789
- optional gateway config patch
790-
- the executable `qa-flow`
790+
- an executable `qa-flow` block for flow scenarios, or `execution.kind`/`execution.path`
791+
for Vitest and Playwright scenarios
791792

792-
The reusable runtime surface that backs `qa-flow` is allowed to stay generic
793+
The reusable runtime surface that backs `qa-flow` blocks is allowed to stay generic
793794
and cross-cutting. For example, markdown scenarios can combine transport-side
794795
helpers with browser-side helpers that drive the embedded Control UI through the
795796
Gateway `browser.request` seam without adding a special-case runner.
@@ -915,6 +916,7 @@ The report should answer:
915916
For the inventory of available scenarios - useful when sizing follow-up work or wiring a new transport - run `pnpm openclaw qa coverage` (add `--json` for machine-readable output).
916917
When choosing focused proof for a touched behavior or file path, run `pnpm openclaw qa coverage --match <query>`.
917918
The match report searches scenario metadata, docs refs, code refs, coverage IDs, plugins, and provider requirements, then prints matching `qa suite --scenario ...` targets.
919+
Every `qa suite` scenario execution writes a `qa-evidence.json` artifact. Flow scenarios also write `qa-suite-summary.json` for existing suite/report tooling; scenarios that declare `execution.kind: vitest` or `execution.kind: playwright` run the matching test path and write `qa-vitest-report.md` or `qa-playwright-report.md` plus per-scenario logs.
918920
Treat it as a discovery aid, not a gate replacement; the selected scenario still needs the right provider mode, live transport, Multipass, Testbox, or release lane for the behavior under test.
919921

920922
For character and style checks, run the same scenario across multiple live model

‎extensions/qa-lab/api.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,6 @@ export {
106106
type QaSuiteStartLabFn,
107107
type QaSuiteSummaryJson,
108108
type QaSuiteSummaryJsonParams,
109-
runQaSuite,
109+
runQaFlowSuite,
110110
} from "./src/suite.js";
111+
export { runQaSuite, type QaSuiteRuntimeResult } from "./src/suite-launch.runtime.js";

‎extensions/qa-lab/src/character-eval.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ async function makeSuiteResult(params: {
127127
);
128128
return {
129129
outputDir: params.outputDir,
130+
evidencePath: path.join(params.outputDir, "qa-evidence.json"),
130131
reportPath: path.join(params.outputDir, "qa-suite-report.md"),
131132
summaryPath,
132133
report: "# report",

‎extensions/qa-lab/src/character-eval.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,8 +426,8 @@ async function defaultRunJudge(params: {
426426
}
427427

428428
async function defaultRunSuite(params: Parameters<RunSuiteFn>[0]) {
429-
const { runQaSuiteFromRuntime } = await import("./suite-launch.runtime.js");
430-
return await runQaSuiteFromRuntime(params);
429+
const { runQaFlowSuiteFromRuntime } = await import("./suite-launch.runtime.js");
430+
return await runQaFlowSuiteFromRuntime(params);
431431
}
432432

433433
function renderCharacterEvalReport(params: {

‎extensions/qa-lab/src/cli-paths.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@ import fs from "node:fs/promises";
33
import path from "node:path";
44
import { assertNoSymlinkParents, pathScope } from "openclaw/plugin-sdk/security-runtime";
55

6+
export function toRepoPath(filePath: string): string {
7+
return filePath.split(path.sep).join("/");
8+
}
9+
10+
export function toRepoRelativePath(repoRoot: string, filePath: string): string {
11+
return toRepoPath(path.relative(repoRoot, filePath));
12+
}
13+
14+
export function isRepoRootRelativeRef(value: string) {
15+
return !path.isAbsolute(value) && value.split(/[\\/]+/u).every((part) => part !== "..");
16+
}
17+
618
export function resolveRepoRelativeOutputDir(repoRoot: string, outputDir?: string) {
719
if (!outputDir) {
820
return undefined;

0 commit comments

Comments
 (0)