
























@@ -3,7 +3,7 @@ import os from "node:os";
33import path from "node:path";
44import { afterEach, describe, expect, it } from "vitest";
55import { validateQaEvidenceSummaryJson } from "./evidence-summary.js";
6-import type { QaSeedScenarioWithSource } from "./scenario-catalog.js";
6+import { readQaScenarioById, type QaSeedScenarioWithSource } from "./scenario-catalog.js";
77import {
88runQaTestFileScenarios,
99type QaScenarioCommandExecution,
@@ -689,4 +689,65 @@ describe("qa test file scenario runner", () => {
689689expect(artifactPath).toBe(path.normalize(externalArtifact));
690690expect(artifactPath?.includes("..")).toBe(false);
691691});
692+693+it("runs the UX Matrix script producer and imports its evidence bundle", async () => {
694+const repoRoot = process.cwd();
695+const outputDir = await fs.mkdtemp(path.join(os.tmpdir(), "qa-ux-matrix-script-"));
696+tempRoots.push(outputDir);
697+const scenario = readQaScenarioById("ux-matrix-evidence-dashboard");
698+699+expect(scenario.execution.kind).toBe("script");
700+const result = await runQaTestFileScenarios({
701+ repoRoot,
702+ outputDir,
703+providerMode: "mock-openai",
704+primaryModel: "mock-openai/gpt-5.5",
705+scenarios: [scenario],
706+env: {
707+OPENCLAW_QA_REF: "scenario-ref",
708+} as NodeJS.ProcessEnv,
709+});
710+711+expect(result.executionKind).toBe("script");
712+expect(result.results[0]?.producerEvidence?.entries).toHaveLength(3);
713+const evidence = validateQaEvidenceSummaryJson(
714+JSON.parse(await fs.readFile(result.evidencePath, "utf8")),
715+);
716+expect(evidence.entries.map((entry) => entry.test.id)).toEqual([
717+"ux-matrix.qa-lab.producer-artifact-fixture",
718+"ux-matrix.control-ui.screenshot-artifact",
719+"ux-matrix.cli.entrypoint-help",
720+]);
721+expect(
722+evidence.entries.flatMap((entry) => entry.coverage.map((coverage) => coverage.id)),
723+).toEqual(
724+expect.arrayContaining([
725+"qa.artifact-safety",
726+"tools.evidence",
727+"workspace.artifacts",
728+"ui.control",
729+"control-ui",
730+"cli-entrypoint",
731+"status-snapshots",
732+]),
733+);
734+const artifactKinds = evidence.entries.flatMap(
735+(entry) => entry.execution?.artifacts.map((artifact) => artifact.kind) ?? [],
736+);
737+expect(artifactKinds).toEqual(expect.arrayContaining(["html", "log"]));
738+const fixtureEntry = evidence.entries.find(
739+(entry) => entry.test.id === "ux-matrix.qa-lab.producer-artifact-fixture",
740+);
741+expect(fixtureEntry?.execution?.artifacts.map((artifact) => artifact.path)).toContain(
742+path.join(
743+outputDir,
744+"ux-matrix-evidence-dashboard",
745+"surfaces",
746+"qa-lab",
747+"stages",
748+"producer-artifact-fixture",
749+"producer-artifact-fixture.html",
750+),
751+);
752+});
692753});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。