@midscene/core 1.13.2-beta-20260923035443.0 → 1.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/agent/utils.mjs +1 -1
- package/dist/es/index.mjs +1 -2
- package/dist/es/index.mjs.map +1 -1
- package/dist/es/report-html-template.mjs +1 -1
- package/dist/es/report.mjs +1 -2
- package/dist/es/report.mjs.map +1 -1
- package/dist/es/utils.mjs +1 -1
- package/dist/lib/agent/utils.js +1 -1
- package/dist/lib/index.js +29 -36
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/report-html-template.js +1 -1
- package/dist/lib/report.js +3 -10
- package/dist/lib/report.js.map +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/report.d.ts +0 -1
- package/dist/types/report.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/es/test-run-health.mjs +0 -47
- package/dist/es/test-run-health.mjs.map +0 -1
- package/dist/lib/test-run-health.js +0 -84
- package/dist/lib/test-run-health.js.map +0 -1
- package/dist/types/test-run-health.d.ts +0 -29
- package/dist/types/test-run-health.d.ts.map +0 -1
package/dist/lib/report.js
CHANGED
|
@@ -24,15 +24,13 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
ReportMergingTool: ()=>ReportMergingTool,
|
|
28
|
-
removeReportArtifact: ()=>removeReportArtifact,
|
|
29
27
|
collectDedupedExecutions: ()=>collectDedupedExecutions,
|
|
30
|
-
TestRunReportAssembler: ()=>TestRunReportAssembler,
|
|
31
28
|
splitReportHtmlByExecution: ()=>splitReportHtmlByExecution,
|
|
29
|
+
ReportMergingTool: ()=>ReportMergingTool,
|
|
32
30
|
isDirectoryModeReport: ()=>isDirectoryModeReport,
|
|
33
31
|
dedupeExecutionsKeepLatest: ()=>dedupeExecutionsKeepLatest,
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
removeReportArtifact: ()=>removeReportArtifact,
|
|
33
|
+
TestRunReportAssembler: ()=>TestRunReportAssembler
|
|
36
34
|
});
|
|
37
35
|
const external_node_fs_namespaceObject = require("node:fs");
|
|
38
36
|
const promises_namespaceObject = require("node:fs/promises");
|
|
@@ -47,7 +45,6 @@ const external_report_stats_js_namespaceObject = require("./report-stats.js");
|
|
|
47
45
|
const merge_report_js_namespaceObject = require("./test-runner/reporting/merge-report.js");
|
|
48
46
|
const external_types_js_namespaceObject = require("./types.js");
|
|
49
47
|
const external_utils_js_namespaceObject = require("./utils.js");
|
|
50
|
-
const external_test_run_health_js_namespaceObject = require("./test-run-health.js");
|
|
51
48
|
function _define_property(obj, key, value) {
|
|
52
49
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
53
50
|
value: value,
|
|
@@ -704,8 +701,6 @@ function splitReportHtmlByExecution(options) {
|
|
|
704
701
|
}
|
|
705
702
|
exports.ReportMergingTool = __webpack_exports__.ReportMergingTool;
|
|
706
703
|
exports.TestRunReportAssembler = __webpack_exports__.TestRunReportAssembler;
|
|
707
|
-
exports.calculateTestRunHealth = __webpack_exports__.calculateTestRunHealth;
|
|
708
|
-
exports.classifyTestRunCase = __webpack_exports__.classifyTestRunCase;
|
|
709
704
|
exports.collectDedupedExecutions = __webpack_exports__.collectDedupedExecutions;
|
|
710
705
|
exports.dedupeExecutionsKeepLatest = __webpack_exports__.dedupeExecutionsKeepLatest;
|
|
711
706
|
exports.isDirectoryModeReport = __webpack_exports__.isDirectoryModeReport;
|
|
@@ -714,8 +709,6 @@ exports.splitReportHtmlByExecution = __webpack_exports__.splitReportHtmlByExecut
|
|
|
714
709
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
715
710
|
"ReportMergingTool",
|
|
716
711
|
"TestRunReportAssembler",
|
|
717
|
-
"calculateTestRunHealth",
|
|
718
|
-
"classifyTestRunCase",
|
|
719
712
|
"collectDedupedExecutions",
|
|
720
713
|
"dedupeExecutionsKeepLatest",
|
|
721
714
|
"isDirectoryModeReport",
|
package/dist/lib/report.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../src/report.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import {\n appendFileSync,\n copyFileSync,\n existsSync,\n mkdirSync,\n mkdtempSync,\n readFileSync,\n readdirSync,\n renameSync,\n rmSync,\n unlinkSync,\n writeFileSync,\n} from 'node:fs';\nimport * as fsAsync from 'node:fs/promises';\nimport * as path from 'node:path';\nimport { getMidsceneRunSubDir } from '@midscene/shared/common';\nimport { antiEscapeScriptTag, logMsg, uuid } from '@midscene/shared/utils';\nimport { getReportFileName } from './agent/report-file-name';\nimport {\n DATA_SCREENSHOT_MODE_ATTR,\n extractAllDumpScriptsSync,\n extractLastDumpScriptSync,\n extractTestRunReportDumpSync,\n generateAgentReportComment,\n getBaseUrlFixScript,\n generateTestRunReportScriptTag as runnerDumpScript,\n streamDumpScriptsSync,\n streamImageScriptsToFile,\n} from './dump/html-utils';\nimport {\n imageRefFileExtension,\n normalizeStoredImageRef,\n} from './dump/image-reference';\nimport {\n parseBase64ImageDataUrl,\n resolveImageSource,\n} from './dump/screenshot-store';\nimport { collectReportSummary } from './report-stats';\nimport type {\n AssembleTestRunReportOptions,\n IndexedTestRunReportSource,\n TestRunReportMetrics,\n TestRunReportSource,\n TestRunReportSourceIndex,\n} from './test-run-report';\nimport {\n type MergeTestRunReportSource,\n mergeTestRunReportDumps,\n} from './test-runner/reporting/merge-report';\nimport {\n type ExecutionDump,\n type IExecutionDump,\n ReportActionDump,\n type ScreenshotMode,\n} from './types';\nimport type { ReportFileWithAttributes } from './types';\nimport { getReportTpl, getVersion, reportHTMLContent } from './utils';\n\nexport {\n calculateTestRunHealth,\n classifyTestRunCase,\n} from './test-run-health';\n\n/**\n * Read the screenshot storage mode a report declared at generation time.\n *\n * Reports written by current versions stamp `data-screenshot-mode` onto every\n * dump script tag, so we only need to peek at the first real dump script (the\n * template's bundled JS also references the dump type string, hence the\n * `data-group-id` filter) and can stop streaming immediately.\n *\n * Returns undefined for legacy reports that predate the attribute or for\n * unreadable files, letting the caller fall back to a filesystem heuristic.\n */\nconst screenshotModeAttrRegExp = new RegExp(\n `${DATA_SCREENSHOT_MODE_ATTR}=\"(inline|directory)\"`,\n);\n\nfunction readDeclaredScreenshotMode(\n reportFilePath: string,\n): ScreenshotMode | undefined {\n let mode: ScreenshotMode | undefined;\n try {\n streamDumpScriptsSync(reportFilePath, ({ openTag }) => {\n // Skip false matches from the template's bundled JS code.\n if (!openTag.includes('data-group-id')) return false;\n const match = openTag.match(screenshotModeAttrRegExp);\n mode = match?.[1] as ScreenshotMode | undefined;\n return true; // the first real dump script decides the mode\n });\n } catch {\n // Unreadable / non-existent file — let the caller fall back.\n }\n return mode;\n}\n\n/**\n * Check if a report is in directory mode (html-and-external-assets).\n * Directory mode reports: {name}/index.html + {name}/screenshots/\n *\n * The mode is read from the report's own `data-screenshot-mode` metadata, which\n * is authoritative regardless of whether the run happened to capture any\n * screenshots. For legacy reports without the attribute we fall back to the old\n * filesystem heuristic (an `index.html` that has a sibling `screenshots/` dir).\n */\nexport function isDirectoryModeReport(reportFilePath: string): boolean {\n // Directory-mode reports are always written as `{name}/index.html`, so any\n // other filename is inline. Short-circuit before touching the file so the\n // common inline case (`{name}.html`) costs nothing.\n if (path.basename(reportFilePath) !== 'index.html') return false;\n\n const declared = readDeclaredScreenshotMode(reportFilePath);\n if (declared) return declared === 'directory';\n\n // Legacy fallback for reports generated before screenshotMode was embedded.\n return existsSync(path.join(path.dirname(reportFilePath), 'screenshots'));\n}\n\n/**\n * Whether a report lives in its own dedicated directory (`{name}/index.html`)\n * rather than being a single standalone file (`{name}.html`).\n *\n * This is a structural fact about *where the report file sits*, independent of\n * how it stores screenshots: a directory report can keep screenshots external\n * (a `screenshots/` sibling) OR inline them into `index.html`. Deletion needs\n * this — not the screenshot mode — to decide whether to remove the whole\n * directory or just unlink a file, so that an inline-screenshot report nested in\n * its own folder still has the folder removed instead of being orphaned.\n */\nfunction isDirectoryBasedReport(reportFilePath: string): boolean {\n return path.basename(reportFilePath) === 'index.html';\n}\n\n/**\n * Remove a complete report artifact from disk.\n *\n * Standalone reports own only their HTML file, while directory-based reports\n * own the directory containing `index.html`. Callers must decide whether they\n * own the source artifact and should only invoke this after its replacement\n * has been produced successfully.\n *\n * @param reportFilePath Path to the standalone report or directory report's\n * `index.html` entry point.\n * @throws When the owned report artifact cannot be removed.\n */\nexport function removeReportArtifact(reportFilePath: string): void {\n if (isDirectoryBasedReport(reportFilePath)) {\n rmSync(path.dirname(reportFilePath), { recursive: true, force: true });\n return;\n }\n unlinkSync(reportFilePath);\n}\n\n/**\n * Deduplicate executions by stable id, keeping only the last occurrence.\n * Old-format executions without id are always preserved.\n */\nexport function dedupeExecutionsKeepLatest<T extends Pick<ExecutionDump, 'id'>>(\n executions: T[],\n): T[] {\n let noIdCounter = 0;\n const deduped = new Map<string, T>();\n for (const exec of executions) {\n const key = exec.id || `__no_id_${noIdCounter++}`;\n deduped.set(key, exec);\n }\n return Array.from(deduped.values());\n}\n/**\n * Peek at the first `sdkVersion` field embedded in a midscene_web_dump\n * script tag inside the given report file. Returns undefined if no\n * recognizable tag or sdkVersion is present.\n */\nfunction peekReportSdkVersion(reportFilePath: string): string | undefined {\n try {\n const dump = extractLastDumpScriptSync(reportFilePath);\n if (!dump) return undefined;\n const match = dump.match(/\"sdkVersion\"\\s*:\\s*\"([^\"]+)\"/);\n return match?.[1];\n } catch {\n return undefined;\n }\n}\n\nconst warnedMismatchedVersions = new Set<string>();\n\nfunction tryParseAgentReportDump(dumpString: string): ReportActionDump | null {\n const trimmed = dumpString.trimStart();\n if (!trimmed.startsWith('{') || !trimmed.includes('\"executions\"')) {\n return null;\n }\n\n try {\n return ReportActionDump.fromSerializedString(trimmed);\n } catch {\n return null;\n }\n}\n\nfunction mergedAgentReportComment(reports: ReportActionDump[]): string {\n if (reports.length === 0) {\n return '';\n }\n if (reports.length === 1) {\n return generateAgentReportComment(reports[0]);\n }\n\n const deviceTypes = Array.from(\n new Set(reports.map((report) => report.deviceType).filter(Boolean)),\n );\n const mergedReport = new ReportActionDump({\n sdkVersion: reports[0].sdkVersion || getVersion(),\n groupName: 'Merged Midscene Report',\n groupDescription: 'Agent-readable summary for merged report HTML',\n modelBriefs: reports.flatMap((report) => report.modelBriefs ?? []),\n deviceType: deviceTypes.length === 1 ? deviceTypes[0] : 'mixed',\n executions: dedupeExecutionsKeepLatest(\n reports.flatMap((report) => report.executions ?? []),\n ),\n });\n return generateAgentReportComment(mergedReport);\n}\n\nexport class ReportMergingTool {\n private reportInfos: ReportFileWithAttributes[] = [];\n\n private createEmptyDumpString(groupName: string, groupDescription?: string) {\n return new ReportActionDump({\n sdkVersion: '',\n groupName,\n groupDescription,\n modelBriefs: [],\n executions: [],\n }).serialize();\n }\n\n public append(reportInfo: ReportFileWithAttributes) {\n if (\n !reportInfo.reportFilePath &&\n reportInfo.reportAttributes.testStatus !== 'skipped'\n ) {\n throw new Error(\n 'reportFilePath is required unless reportAttributes.testStatus is \"skipped\"',\n );\n }\n\n if (reportInfo.reportFilePath) {\n const sourceVersion = peekReportSdkVersion(reportInfo.reportFilePath);\n const currentVersion = getVersion();\n if (\n sourceVersion &&\n currentVersion &&\n sourceVersion !== currentVersion &&\n !warnedMismatchedVersions.has(sourceVersion)\n ) {\n warnedMismatchedVersions.add(sourceVersion);\n logMsg(\n `[@midscene/core] ReportMergingTool version mismatch: source report was written by @midscene/core@${sourceVersion} but the merger is @midscene/core@${currentVersion}. This commonly means @midscene/core and the device package (e.g. @midscene/android) resolve to different versions in node_modules. Merged output may silently drop intermediate steps. Align the versions and reinstall (rm -rf node_modules package-lock.json && npm install).`,\n );\n }\n }\n this.reportInfos.push(reportInfo);\n }\n public clear() {\n this.reportInfos = [];\n }\n\n /**\n * Merge multiple dump script contents (from the same source report)\n * into a single serialized ReportActionDump string.\n * If there's only one dump, return it as-is. If multiple, merge\n * all executions into the first dump's group structure.\n */\n private mergeDumpScripts(contents: string[]): string {\n const unescaped = contents\n .map((c) => antiEscapeScriptTag(c))\n .filter((c) => c.length > 0);\n if (unescaped.length === 0) return '';\n if (unescaped.length === 1) return unescaped[0];\n\n // Parse all dumps and collect executions, deduplicating by id (keep last).\n // Only executions with a stable id are deduped; old-format entries without\n // id are always kept (they may be distinct despite sharing the same name).\n const base = ReportActionDump.fromSerializedString(unescaped[0]);\n const allExecutions = [...base.executions];\n for (let i = 1; i < unescaped.length; i++) {\n const other = ReportActionDump.fromSerializedString(unescaped[i]);\n allExecutions.push(...other.executions);\n }\n base.executions = dedupeExecutionsKeepLatest(allExecutions);\n return base.serialize();\n }\n\n public mergeReports(\n reportFileName: 'AUTO' | string = 'AUTO',\n opts?: {\n rmOriginalReports?: boolean;\n overwrite?: boolean;\n outputDir?: string;\n },\n ): string | null {\n const {\n rmOriginalReports = false,\n overwrite = false,\n outputDir,\n } = opts ?? {};\n\n if (this.reportInfos.length === 0) {\n logMsg('No reports to merge');\n return null;\n }\n\n const runnerDumps = this.reportInfos.map((info) =>\n info.reportFilePath\n ? extractTestRunReportDumpSync(info.reportFilePath)\n : undefined,\n );\n const hasRunnerDump = runnerDumps.some(Boolean);\n\n const targetDir = outputDir\n ? path.resolve(outputDir)\n : getMidsceneRunSubDir('report');\n if (outputDir) {\n mkdirSync(targetDir, { recursive: true });\n }\n\n // Resolve each report's screenshot mode exactly once. isDirectoryModeReport\n // reads the file to find the authoritative metadata, so recomputing it for\n // both the output-path decision and the per-report merge loop would re-scan\n // every report twice.\n const isDirModeByIndex = this.reportInfos.map((info) =>\n Boolean(\n info.reportFilePath && isDirectoryModeReport(info.reportFilePath),\n ),\n );\n const hasDirectoryModeReport = isDirModeByIndex.some(Boolean);\n\n const resolvedName =\n reportFileName === 'AUTO'\n ? getReportFileName('merged-report')\n : reportFileName;\n\n // Directory mode: output as {name}/index.html to keep relative paths working\n // Inline mode: output as {name}.html (single file)\n const outputFilePath = hasDirectoryModeReport\n ? path.resolve(targetDir, resolvedName, 'index.html')\n : path.resolve(targetDir, `${resolvedName}.html`);\n\n if (reportFileName !== 'AUTO' && existsSync(outputFilePath)) {\n if (!overwrite) {\n throw new Error(\n `Report file already exists: ${outputFilePath}\\nSet overwrite to true to overwrite this file.`,\n );\n }\n if (hasDirectoryModeReport) {\n rmSync(path.dirname(outputFilePath), { recursive: true, force: true });\n } else {\n unlinkSync(outputFilePath);\n }\n }\n\n if (hasDirectoryModeReport) {\n mkdirSync(path.dirname(outputFilePath), { recursive: true });\n }\n\n logMsg(\n `Start merging ${this.reportInfos.length} reports...\\nCreating template file...`,\n );\n\n try {\n // Write template without closing </html> tag so we can append\n // dump scripts before it. The closing tag is added at the end.\n const htmlEndTag = '</html>';\n const tpl = getReportTpl();\n const htmlEndIdx = tpl.lastIndexOf(htmlEndTag);\n const tplWithoutClose =\n htmlEndIdx !== -1 ? tpl.slice(0, htmlEndIdx) : tpl;\n appendFileSync(outputFilePath, tplWithoutClose);\n\n // For directory-mode output, inject base URL fix script\n if (hasDirectoryModeReport) {\n appendFileSync(outputFilePath, getBaseUrlFixScript());\n }\n\n const agentReports: ReportActionDump[] = [];\n const runnerSources: MergeTestRunReportSource[] = [];\n const writtenInlineImageIds = new Set<string>();\n\n // Process all reports one by one\n for (let i = 0; i < this.reportInfos.length; i++) {\n const reportInfo = this.reportInfos[i];\n logMsg(`Processing report ${i + 1}/${this.reportInfos.length}`);\n\n const { reportAttributes } = reportInfo;\n let dumpString = this.createEmptyDumpString(\n reportAttributes.testTitle,\n reportAttributes.testDescription,\n );\n let mergedGroupId = `merged-group-${i}`;\n\n if (reportInfo.reportFilePath) {\n if (isDirModeByIndex[i]) {\n // Directory mode: copy external screenshot files. A directory-mode\n // report can legitimately have no screenshots/ dir (a run that\n // captured nothing), so only copy when the source dir exists.\n const reportDir = path.dirname(reportInfo.reportFilePath);\n const screenshotsDir = path.join(reportDir, 'screenshots');\n if (existsSync(screenshotsDir)) {\n const mergedScreenshotsDir = path.join(\n path.dirname(outputFilePath),\n 'screenshots',\n );\n mkdirSync(mergedScreenshotsDir, { recursive: true });\n for (const file of readdirSync(screenshotsDir)) {\n const src = path.join(screenshotsDir, file);\n const dest = path.join(mergedScreenshotsDir, file);\n copyFileSync(src, dest);\n }\n }\n } else {\n // Inline mode: stream image scripts to output file\n streamImageScriptsToFile(\n reportInfo.reportFilePath,\n outputFilePath,\n writtenInlineImageIds,\n );\n }\n\n // Extract all dump scripts from the source report.\n // After the per-execution append refactor, a single source report\n // may contain multiple <script type=\"midscene_web_dump\"> tags\n // (one per execution). We merge them into a single ReportActionDump.\n // Filter by data-group-id to exclude false matches from the template's\n // bundled JS code, which also references the midscene_web_dump type string.\n const allDumps = extractAllDumpScriptsSync(\n reportInfo.reportFilePath,\n ).filter((d) => d.openTag.includes('data-group-id'));\n const groupIdMatch = allDumps[0]?.openTag.match(\n /data-group-id=\"([^\"]+)\"/,\n );\n if (groupIdMatch && !hasRunnerDump) {\n mergedGroupId = decodeURIComponent(groupIdMatch[1]);\n }\n const extractedDumpString =\n allDumps.length > 0\n ? this.mergeDumpScripts(allDumps.map((d) => d.content))\n : extractLastDumpScriptSync(reportInfo.reportFilePath);\n if (extractedDumpString) {\n dumpString = extractedDumpString;\n }\n }\n\n const agentReport = tryParseAgentReportDump(dumpString);\n if (agentReport) {\n agentReports.push(agentReport);\n }\n if (hasRunnerDump)\n runnerSources.push({\n reportId: mergedGroupId,\n sourcePath: reportInfo.reportFilePath ?? '<skipped-agent-report>',\n attributes: reportAttributes,\n dump: runnerDumps[i],\n timing: agentReport\n ? agentReportTiming(agentReport, reportAttributes.testDuration)\n : undefined,\n });\n\n const reportHtmlStr = `${reportHTMLContent(\n {\n dumpString,\n attributes: {\n 'data-group-id': mergedGroupId,\n ...(hasRunnerDump ? { 'data-report-id': mergedGroupId } : {}),\n [DATA_SCREENSHOT_MODE_ATTR]: hasDirectoryModeReport\n ? 'directory'\n : 'inline',\n playwright_test_duration: reportAttributes.testDuration,\n playwright_test_status: reportAttributes.testStatus,\n playwright_test_title: reportAttributes.testTitle,\n playwright_test_id: reportAttributes.testId,\n playwright_test_description: reportAttributes.testDescription,\n is_merged: true,\n },\n },\n undefined,\n undefined,\n false,\n )}\\n`;\n\n appendFileSync(outputFilePath, reportHtmlStr);\n }\n\n if (hasRunnerDump) {\n const summary = collectReportSummary({\n executions: dedupeExecutionsKeepLatest(\n agentReports.flatMap((report) => report.executions),\n ),\n });\n appendFileSync(\n outputFilePath,\n runnerDumpScript(\n mergeTestRunReportDumps(\n runnerSources,\n {\n modelCallCount: summary.timing.modelCallCount,\n modelTimeMs: summary.timing.modelCallTimeMs,\n ...summary.tokens,\n },\n uuid(),\n ),\n ),\n );\n }\n\n const agentComment = mergedAgentReportComment(agentReports);\n if (agentComment) {\n appendFileSync(outputFilePath, agentComment);\n }\n\n // Close the HTML document\n appendFileSync(outputFilePath, `${htmlEndTag}\\n`);\n\n logMsg(`Successfully merged new report: ${outputFilePath}`);\n\n // Remove original reports if needed\n if (rmOriginalReports) {\n let removedReportCount = 0;\n let reportCountWithFilePath = 0;\n for (const info of this.reportInfos) {\n if (!info.reportFilePath) continue;\n reportCountWithFilePath += 1;\n try {\n removeReportArtifact(info.reportFilePath);\n removedReportCount += 1;\n } catch (error) {\n logMsg(`Error deleting report ${info.reportFilePath}: ${error}`);\n }\n }\n logMsg(\n `Removed ${removedReportCount}/${reportCountWithFilePath} original reports`,\n );\n }\n return outputFilePath;\n } catch (error) {\n logMsg(`Error in mergeReports: ${error}`);\n throw error;\n }\n }\n}\n\nfunction agentReportTiming(\n report: ReportActionDump,\n durationMs: number,\n): MergeTestRunReportSource['timing'] {\n const timing = collectReportSummary(report).timing;\n const executionTimes = report.executions\n .map((execution) => execution.logTime)\n .filter(\n (value): value is number =>\n typeof value === 'number' && Number.isFinite(value),\n );\n const started =\n timing.wallTimeStart ??\n (executionTimes.length ? Math.min(...executionTimes) : undefined);\n if (started === undefined) return undefined;\n const ended =\n timing.wallTimeEnd ??\n Math.max(\n ...executionTimes,\n started + (Number.isFinite(durationMs) ? Math.max(0, durationMs) : 0),\n );\n return {\n startedAt: new Date(started).toISOString(),\n endedAt: new Date(ended).toISOString(),\n durationMs: Math.max(0, ended - started),\n };\n}\n\ninterface PreparedTestRunReportSource extends IndexedTestRunReportSource {\n dump: ReportActionDump;\n directoryMode: boolean;\n dumpPath?: string;\n}\n\nconst validateTestRunReportFileName = (fileName: string): void => {\n if (\n !fileName ||\n fileName === '.' ||\n fileName === '..' ||\n path.basename(fileName) !== fileName ||\n fileName.endsWith('.html')\n ) {\n throw new Error(\n `Midscene Test reportFileName must be one path segment without an extension: ${fileName}`,\n );\n }\n};\n\nconst uniqueTestRunReportSources = (\n sources: readonly TestRunReportSource[],\n): TestRunReportSource[] => {\n const unique = new Map<string, TestRunReportSource>();\n\n for (const source of sources) {\n const scopeId = source.scopeId.trim();\n const sourcePath = path.resolve(source.sourcePath);\n if (!scopeId) {\n throw new Error('Midscene Test report source scopeId must not be empty.');\n }\n\n unique.set(`${scopeId}\\u0000${source.dumpPath ?? sourcePath}`, {\n ...source,\n scopeId,\n sourcePath,\n });\n }\n\n return [...unique.values()];\n};\n\nconst prepareTestRunReportSources = (\n sources: readonly TestRunReportSource[],\n loadedDumps?: ReadonlyMap<string, string>,\n): {\n sources: PreparedTestRunReportSource[];\n metrics: TestRunReportMetrics;\n} => {\n const prepared: PreparedTestRunReportSource[] = [];\n const ownerByScopedExecution = new Map<string, string>();\n const preparedByPath = new Map<string, PreparedTestRunReportSource>();\n\n for (const [sourceIndex, source] of uniqueTestRunReportSources(\n sources,\n ).entries()) {\n // A borrowed Agent can serve several sequential test scopes. Reuse its\n // report group and metrics while indexing each scope's execution links.\n const sourceKey = source.sourcePath;\n const shared = preparedByPath.get(sourceKey);\n if (shared) {\n if (source.dumpPath) {\n const snapshot = ReportActionDump.fromSerializedString(\n loadedDumps?.get(source.dumpPath) ??\n readFileSync(source.dumpPath, 'utf8'),\n );\n shared.dump.executions = dedupeExecutionsKeepLatest([\n ...shared.dump.executions,\n ...snapshot.executions,\n ]);\n shared.executionIds.splice(\n 0,\n shared.executionIds.length,\n ...shared.dump.executions.flatMap((execution) =>\n execution.id ? [execution.id] : [],\n ),\n );\n }\n for (const executionId of shared.executionIds) {\n const key = `${source.scopeId}\\u0000${executionId}`;\n const owner = ownerByScopedExecution.get(key);\n if (owner && owner !== shared.reportId)\n throw new Error(\n `Agent execution ${executionId} is present in multiple reports for test scope ${source.scopeId}: ${owner}, ${shared.reportId}`,\n );\n ownerByScopedExecution.set(key, shared.reportId);\n }\n prepared.push({ ...shared, scopeId: source.scopeId });\n continue;\n }\n if (!source.dumpPath && !existsSync(source.sourcePath)) {\n throw new Error(`Agent report does not exist: ${source.sourcePath}`);\n }\n\n const sourceVersion = source.dumpPath\n ? undefined\n : peekReportSdkVersion(source.sourcePath);\n const currentVersion = getVersion();\n if (\n sourceVersion &&\n currentVersion &&\n sourceVersion !== currentVersion &&\n !warnedMismatchedVersions.has(sourceVersion)\n ) {\n warnedMismatchedVersions.add(sourceVersion);\n logMsg(\n `[@midscene/core] TestRunReportAssembler version mismatch: source report was written by @midscene/core@${sourceVersion} but the assembler is @midscene/core@${currentVersion}. Align the workspace package versions before generating the Midscene Test report.`,\n );\n }\n\n const reportId = `runner-report-${sourceIndex + 1}`;\n const snapshot = source.dumpPath\n ? ReportActionDump.fromSerializedString(\n loadedDumps?.get(source.dumpPath) ??\n readFileSync(source.dumpPath, 'utf8'),\n )\n : undefined;\n const { baseDump, executions } = snapshot\n ? { baseDump: snapshot, executions: snapshot.executions }\n : collectDedupedExecutions(source.sourcePath);\n const executionIds: string[] = [];\n for (const execution of executions) {\n if (!execution.id) continue;\n const scopedExecution = `${source.scopeId}\\u0000${execution.id}`;\n const previousOwner = ownerByScopedExecution.get(scopedExecution);\n if (previousOwner && previousOwner !== reportId) {\n throw new Error(\n `Agent execution ${execution.id} is present in multiple reports for test scope ${source.scopeId}: ${previousOwner}, ${reportId}`,\n );\n }\n ownerByScopedExecution.set(scopedExecution, reportId);\n executionIds.push(execution.id);\n }\n\n const dump = new ReportActionDump({\n sdkVersion: baseDump.sdkVersion,\n groupName: baseDump.groupName,\n groupDescription: baseDump.groupDescription,\n modelBriefs: baseDump.modelBriefs,\n deviceType: baseDump.deviceType,\n executions,\n });\n const preparedSource = {\n reportId,\n scopeId: source.scopeId,\n sourcePath: source.sourcePath,\n executionIds,\n dump,\n directoryMode:\n !!source.dumpPath || isDirectoryModeReport(source.sourcePath),\n ...(source.dumpPath ? { dumpPath: source.dumpPath } : {}),\n };\n prepared.push(preparedSource);\n preparedByPath.set(sourceKey, preparedSource);\n }\n\n // A legacy invocation can preserve a snapshot of an Agent also used by\n // native scopes. Count stable executions once across both paths.\n const summary = collectReportSummary({\n executions: dedupeExecutionsKeepLatest(\n [...preparedByPath.values()].flatMap((source) => source.dump.executions),\n ),\n });\n return {\n sources: prepared,\n metrics: {\n modelCallCount: summary.timing.modelCallCount,\n modelTimeMs: summary.timing.modelCallTimeMs,\n ...summary.tokens,\n },\n };\n};\n\n/**\n * Build a self-contained Midscene Test report while preserving the existing\n * Agent dump format consumed by the Report App.\n *\n * Test hierarchy and status live in `midscene_test_run_dump`; Agent reports\n * remain independent `midscene_web_dump` groups addressed by `data-report-id`.\n */\nexport class TestRunReportAssembler {\n /** Runtime publisher: current Agent snapshots avoid parsing HTML or copying unused images. */\n public async assembleAsync(\n options: AssembleTestRunReportOptions,\n ): Promise<string> {\n validateTestRunReportFileName(options.reportFileName);\n const loaded = new Map<string, string>();\n await Promise.all(\n options.sources.map(async (source) => {\n if (source.dumpPath)\n loaded.set(\n source.dumpPath,\n await fsAsync.readFile(source.dumpPath, 'utf8'),\n );\n }),\n );\n const prepared = prepareTestRunReportSources(options.sources, loaded);\n const dump = options.buildRunnerDump({\n sources: prepared.sources,\n metrics: prepared.metrics,\n });\n if (dump.kind !== 'test-runner' || dump.schemaVersion !== 1)\n throw new Error('Invalid Runner report dump');\n const directoryMode = prepared.sources.some(\n (source) => source.directoryMode,\n );\n const outputDir = path.resolve(options.outputDir);\n await fsAsync.mkdir(outputDir, { recursive: true });\n const artifact = path.join(outputDir, options.reportFileName);\n const finalPath = directoryMode\n ? path.join(artifact, 'index.html')\n : `${artifact}.html`;\n if (\n !options.overwrite &&\n (existsSync(artifact) || existsSync(`${artifact}.html`))\n )\n throw new Error(`Report artifact already exists: ${artifact}`);\n const temporary = await fsAsync.mkdtemp(\n path.join(outputDir, '.test-run-report-'),\n );\n const htmlPath = path.join(temporary, 'index.html');\n try {\n const parts = [\n getReportTpl(),\n directoryMode ? getBaseUrlFixScript() : '',\n ];\n const imageIds = new Set<string>();\n const reports: ReportActionDump[] = [];\n for (const source of new Map(\n prepared.sources.map((source) => [source.reportId, source]),\n ).values()) {\n const serialized = source.dump.serialize();\n if (source.dumpPath) {\n const refs = new Map<\n string,\n ReturnType<typeof normalizeStoredImageRef> & {}\n >();\n JSON.parse(serialized, (_key, value) => {\n const ref = normalizeStoredImageRef(value);\n if (ref) refs.set(ref.id, ref);\n return value;\n });\n if (refs.size)\n await fsAsync.mkdir(path.join(temporary, 'screenshots'), {\n recursive: true,\n });\n for (const ref of refs.values()) {\n if (imageIds.has(ref.id)) continue;\n if (ref.storage !== 'file' || !ref.path)\n throw new Error(`Snapshot image ${ref.id} has no file source`);\n await fsAsync.copyFile(\n path.resolve(path.dirname(source.dumpPath), ref.path),\n path.join(\n temporary,\n 'screenshots',\n `${ref.id}.${imageRefFileExtension(ref)}`,\n ),\n );\n imageIds.add(ref.id);\n }\n } else {\n // An explicit external provider may still return a finalized HTML artifact.\n // This is a public provider contract, not a second execution/serialization schema.\n if (source.directoryMode) {\n const images = path.join(\n path.dirname(source.sourcePath),\n 'screenshots',\n );\n if (existsSync(images))\n await fsAsync.cp(images, path.join(temporary, 'screenshots'), {\n recursive: true,\n });\n } else {\n const html = await fsAsync.readFile(source.sourcePath, 'utf8');\n for (const match of html.matchAll(\n /<script\\b([^>]*)>[\\s\\S]*?<\\/script>/g,\n )) {\n if (/(?:^|\\s)type=[\"']midscene-image[\"']/.test(match[1]))\n parts.push(match[0]);\n }\n }\n }\n reports.push(source.dump);\n parts.push(\n reportHTMLContent(\n {\n dumpString: serialized,\n attributes: {\n 'data-group-id': source.reportId,\n 'data-report-id': source.reportId,\n 'data-runner-scope-id': source.scopeId,\n [DATA_SCREENSHOT_MODE_ATTR]: directoryMode\n ? 'directory'\n : 'inline',\n },\n },\n undefined,\n undefined,\n false,\n ),\n );\n }\n parts.push(runnerDumpScript(dump), mergedAgentReportComment(reports));\n await fsAsync.writeFile(htmlPath, parts.join('\\n'));\n if (options.overwrite) {\n await fsAsync.rm(artifact, { recursive: true, force: true });\n await fsAsync.rm(`${artifact}.html`, { force: true });\n }\n await fsAsync.rename(\n directoryMode ? temporary : htmlPath,\n directoryMode ? artifact : finalPath,\n );\n return finalPath;\n } finally {\n await fsAsync.rm(temporary, { recursive: true, force: true });\n }\n }\n\n public assemble(options: AssembleTestRunReportOptions): string {\n validateTestRunReportFileName(options.reportFileName);\n const outputDir = path.resolve(options.outputDir);\n mkdirSync(outputDir, { recursive: true });\n\n const prepared = prepareTestRunReportSources(options.sources);\n const index: TestRunReportSourceIndex = {\n sources: prepared.sources.map(\n ({ reportId, scopeId, sourcePath, executionIds }) => ({\n reportId,\n scopeId,\n sourcePath,\n executionIds,\n }),\n ),\n metrics: prepared.metrics,\n };\n const runnerDump = options.buildRunnerDump(index);\n if (runnerDump.schemaVersion !== 1 || runnerDump.kind !== 'test-runner') {\n throw new Error(\n 'buildRunnerDump must return a Midscene Test report dump with schemaVersion 1 and kind \"test-runner\".',\n );\n }\n // Validate serializability before creating any output artifact.\n JSON.stringify(runnerDump);\n\n const directoryMode = prepared.sources.some(\n (source) => source.directoryMode,\n );\n const finalArtifactPath = path.join(outputDir, options.reportFileName);\n const directoryReportPath = path.join(finalArtifactPath, 'index.html');\n const standaloneReportPath = `${finalArtifactPath}.html`;\n const finalReportPath = directoryMode\n ? directoryReportPath\n : standaloneReportPath;\n const existingArtifacts = [finalArtifactPath, standaloneReportPath].filter(\n existsSync,\n );\n if (existingArtifacts.length > 0 && !options.overwrite) {\n throw new Error(\n `Report artifact already exists: ${existingArtifacts[0]}\\nSet overwrite to true to overwrite this report.`,\n );\n }\n\n const temporaryRoot = mkdtempSync(\n path.join(outputDir, '.test-run-report-'),\n );\n const temporaryArtifactPath = path.join(\n temporaryRoot,\n options.reportFileName,\n );\n const temporaryReportPath = directoryMode\n ? path.join(temporaryArtifactPath, 'index.html')\n : `${temporaryArtifactPath}.html`;\n\n try {\n if (directoryMode) {\n mkdirSync(temporaryArtifactPath, { recursive: true });\n }\n\n const htmlEndTag = '</html>';\n const template = getReportTpl();\n const htmlEndIndex = template.lastIndexOf(htmlEndTag);\n appendFileSync(\n temporaryReportPath,\n htmlEndIndex === -1 ? template : template.slice(0, htmlEndIndex),\n );\n if (directoryMode) {\n appendFileSync(temporaryReportPath, getBaseUrlFixScript());\n }\n\n const agentReports: ReportActionDump[] = [];\n for (const source of new Map(\n prepared.sources.map((source) => [source.reportId, source]),\n ).values()) {\n if (source.directoryMode) {\n const screenshotsDir = path.join(\n path.dirname(source.sourcePath),\n 'screenshots',\n );\n if (existsSync(screenshotsDir)) {\n const targetScreenshotsDir = path.join(\n path.dirname(temporaryReportPath),\n 'screenshots',\n );\n mkdirSync(targetScreenshotsDir, { recursive: true });\n for (const file of readdirSync(screenshotsDir)) {\n copyFileSync(\n path.join(screenshotsDir, file),\n path.join(targetScreenshotsDir, file),\n );\n }\n }\n } else {\n streamImageScriptsToFile(source.sourcePath, temporaryReportPath);\n }\n\n agentReports.push(source.dump);\n appendFileSync(\n temporaryReportPath,\n `${reportHTMLContent(\n {\n dumpString: source.dump.serialize(),\n attributes: {\n 'data-group-id': source.reportId,\n 'data-report-id': source.reportId,\n 'data-runner-scope-id': source.scopeId,\n [DATA_SCREENSHOT_MODE_ATTR]: directoryMode\n ? 'directory'\n : 'inline',\n },\n },\n undefined,\n undefined,\n false,\n )}\\n`,\n );\n }\n\n appendFileSync(temporaryReportPath, runnerDumpScript(runnerDump));\n const agentComment = mergedAgentReportComment(agentReports);\n if (agentComment) {\n appendFileSync(temporaryReportPath, agentComment);\n }\n appendFileSync(temporaryReportPath, `${htmlEndTag}\\n`);\n\n if (existsSync(finalArtifactPath)) {\n rmSync(finalArtifactPath, { recursive: true, force: true });\n }\n if (existsSync(standaloneReportPath)) {\n unlinkSync(standaloneReportPath);\n }\n renameSync(\n directoryMode ? temporaryArtifactPath : temporaryReportPath,\n directoryMode ? finalArtifactPath : standaloneReportPath,\n );\n rmSync(temporaryRoot, { recursive: true, force: true });\n return finalReportPath;\n } catch (error) {\n rmSync(temporaryRoot, { recursive: true, force: true });\n throw error;\n }\n }\n}\n\nexport interface SplitReportHtmlOptions {\n htmlPath: string;\n outputDir: string;\n}\n\nexport interface SplitReportHtmlResult {\n executionJsonFiles: string[];\n screenshotFiles: string[];\n}\n\nexport interface CollectedReportExecutions {\n baseDump: ReportActionDump;\n executions: IExecutionDump[];\n}\n\n/**\n * Collect executions from a report HTML, deduplicating by stable id while\n * keeping only the latest occurrence. Old-format executions without id are\n * always preserved.\n */\nexport function collectDedupedExecutions(\n htmlPath: string,\n): CollectedReportExecutions {\n let baseDump: ReportActionDump | null = null;\n let executionSerial = 0;\n const latestSerialByExecutionId = new Map<string, number>();\n\n streamDumpScriptsSync(htmlPath, (dumpScript) => {\n if (!dumpScript.openTag.includes('data-group-id')) {\n return false;\n }\n const groupedDump = ReportActionDump.fromSerializedString(\n antiEscapeScriptTag(dumpScript.content),\n );\n for (const execution of groupedDump.executions) {\n executionSerial += 1;\n if (execution.id) {\n latestSerialByExecutionId.set(execution.id, executionSerial);\n }\n }\n return false;\n });\n\n const executions: IExecutionDump[] = [];\n executionSerial = 0;\n streamDumpScriptsSync(htmlPath, (dumpScript) => {\n if (!dumpScript.openTag.includes('data-group-id')) {\n return false;\n }\n\n const groupedDump = ReportActionDump.fromSerializedString(\n antiEscapeScriptTag(dumpScript.content),\n );\n if (!baseDump) {\n baseDump = groupedDump;\n }\n\n for (const execution of groupedDump.executions) {\n executionSerial += 1;\n if (\n execution.id &&\n latestSerialByExecutionId.get(execution.id) !== executionSerial\n ) {\n continue;\n }\n executions.push(execution);\n }\n\n return false;\n });\n\n if (!baseDump) {\n throw new Error(`No report dump scripts found in ${htmlPath}`);\n }\n\n return {\n baseDump,\n executions,\n };\n}\n\nfunction externalizeImagesInExecution(\n execution: IExecutionDump,\n opts: {\n htmlPath: string;\n screenshotsDir: string;\n writtenFiles: Set<string>;\n },\n): void {\n const visit = (node: unknown): void => {\n if (Array.isArray(node)) {\n for (const item of node) {\n visit(item);\n }\n return;\n }\n\n if (typeof node !== 'object' || node === null) return;\n\n const ref = normalizeStoredImageRef(node);\n if (ref) {\n const ext = imageRefFileExtension(ref);\n const fileName = `${ref.id}.${ext}`;\n const relativePath = `./screenshots/${fileName}`;\n const absolutePath = path.join(opts.screenshotsDir, fileName);\n\n if (!opts.writtenFiles.has(fileName)) {\n const resolved = resolveImageSource(ref, {\n reportPath: opts.htmlPath,\n });\n if (resolved.type === 'data-uri') {\n const { rawBase64 } = parseBase64ImageDataUrl(resolved.dataUri);\n writeFileSync(absolutePath, Buffer.from(rawBase64, 'base64'));\n } else {\n copyFileSync(resolved.filePath, absolutePath);\n }\n opts.writtenFiles.add(fileName);\n }\n\n ref.storage = 'file';\n ref.path = relativePath;\n return;\n }\n\n for (const value of Object.values(node)) {\n visit(value);\n }\n };\n\n visit(execution);\n}\n\n/**\n * Reverse parse a Midscene report HTML into per-execution JSON files and\n * externalized screenshots.\n */\nexport function splitReportHtmlByExecution(\n options: SplitReportHtmlOptions,\n): SplitReportHtmlResult {\n const { htmlPath, outputDir } = options;\n const screenshotsDir = path.join(outputDir, 'screenshots');\n\n mkdirSync(outputDir, { recursive: true });\n mkdirSync(screenshotsDir, { recursive: true });\n\n const executionJsonFiles: string[] = [];\n const writtenScreenshotFiles = new Set<string>();\n const { baseDump, executions } = collectDedupedExecutions(htmlPath);\n\n let fileIndex = 0;\n for (const execution of executions) {\n fileIndex += 1;\n externalizeImagesInExecution(execution, {\n htmlPath,\n screenshotsDir,\n writtenFiles: writtenScreenshotFiles,\n });\n const singleExecutionDump = new ReportActionDump({\n sdkVersion: baseDump.sdkVersion,\n groupName: baseDump.groupName,\n groupDescription: baseDump.groupDescription,\n modelBriefs: baseDump.modelBriefs,\n deviceType: baseDump.deviceType,\n executions: [execution],\n });\n\n const jsonFilePath = path.join(outputDir, `${fileIndex}.execution.json`);\n writeFileSync(jsonFilePath, singleExecutionDump.serialize(2), 'utf-8');\n executionJsonFiles.push(jsonFilePath);\n }\n\n return {\n executionJsonFiles,\n screenshotFiles: Array.from(writtenScreenshotFiles)\n .sort()\n .map((fileName) => path.join(screenshotsDir, fileName)),\n };\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","screenshotModeAttrRegExp","RegExp","DATA_SCREENSHOT_MODE_ATTR","readDeclaredScreenshotMode","reportFilePath","mode","streamDumpScriptsSync","openTag","match","isDirectoryModeReport","path","declared","existsSync","isDirectoryBasedReport","removeReportArtifact","rmSync","unlinkSync","dedupeExecutionsKeepLatest","executions","noIdCounter","deduped","Map","exec","Array","peekReportSdkVersion","dump","extractLastDumpScriptSync","warnedMismatchedVersions","Set","tryParseAgentReportDump","dumpString","trimmed","ReportActionDump","mergedAgentReportComment","reports","generateAgentReportComment","deviceTypes","report","Boolean","mergedReport","getVersion","ReportMergingTool","groupName","groupDescription","reportInfo","Error","sourceVersion","currentVersion","logMsg","contents","unescaped","c","antiEscapeScriptTag","base","allExecutions","i","other","reportFileName","opts","rmOriginalReports","overwrite","outputDir","runnerDumps","info","extractTestRunReportDumpSync","undefined","hasRunnerDump","targetDir","getMidsceneRunSubDir","mkdirSync","isDirModeByIndex","hasDirectoryModeReport","resolvedName","getReportFileName","outputFilePath","htmlEndTag","tpl","getReportTpl","htmlEndIdx","tplWithoutClose","appendFileSync","getBaseUrlFixScript","agentReports","runnerSources","writtenInlineImageIds","reportAttributes","mergedGroupId","reportDir","screenshotsDir","mergedScreenshotsDir","file","readdirSync","src","dest","copyFileSync","streamImageScriptsToFile","allDumps","extractAllDumpScriptsSync","d","groupIdMatch","decodeURIComponent","extractedDumpString","agentReport","agentReportTiming","reportHtmlStr","reportHTMLContent","summary","collectReportSummary","runnerDumpScript","mergeTestRunReportDumps","uuid","agentComment","removedReportCount","reportCountWithFilePath","error","durationMs","timing","executionTimes","execution","value","Number","started","Math","ended","Date","validateTestRunReportFileName","fileName","uniqueTestRunReportSources","sources","unique","source","scopeId","sourcePath","prepareTestRunReportSources","loadedDumps","prepared","ownerByScopedExecution","preparedByPath","sourceIndex","sourceKey","shared","snapshot","readFileSync","executionId","owner","reportId","baseDump","collectDedupedExecutions","executionIds","scopedExecution","previousOwner","preparedSource","TestRunReportAssembler","options","loaded","Promise","fsAsync","directoryMode","artifact","finalPath","temporary","htmlPath","parts","imageIds","serialized","refs","JSON","_key","ref","normalizeStoredImageRef","imageRefFileExtension","images","html","index","runnerDump","finalArtifactPath","directoryReportPath","standaloneReportPath","finalReportPath","existingArtifacts","temporaryRoot","mkdtempSync","temporaryArtifactPath","temporaryReportPath","template","htmlEndIndex","targetScreenshotsDir","renameSync","executionSerial","latestSerialByExecutionId","dumpScript","groupedDump","externalizeImagesInExecution","visit","node","item","ext","relativePath","absolutePath","resolved","resolveImageSource","rawBase64","parseBase64ImageDataUrl","writeFileSync","Buffer","splitReportHtmlByExecution","executionJsonFiles","writtenScreenshotFiles","fileIndex","singleExecutionDump","jsonFilePath"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOM,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACoEA,MAAMI,2BAA2B,IAAIC,OACnC,GAAGC,8BAAAA,yBAAyBA,CAAC,qBAAqB,CAAC;AAGrD,SAASC,2BACPC,cAAsB;IAEtB,IAAIC;IACJ,IAAI;QACFC,IAAAA,8BAAAA,qBAAAA,AAAAA,EAAsBF,gBAAgB,CAAC,EAAEG,OAAO,EAAE;YAEhD,IAAI,CAACA,QAAQ,QAAQ,CAAC,kBAAkB,OAAO;YAC/C,MAAMC,QAAQD,QAAQ,KAAK,CAACP;YAC5BK,OAAOG,OAAO,CAAC,EAAE;YACjB,OAAO;QACT;IACF,EAAE,OAAM,CAER;IACA,OAAOH;AACT;AAWO,SAASI,sBAAsBL,c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gBsC;IACjD;AACF"}
|
|
1
|
+
{"version":3,"file":"report.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../src/report.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import {\n appendFileSync,\n copyFileSync,\n existsSync,\n mkdirSync,\n mkdtempSync,\n readFileSync,\n readdirSync,\n renameSync,\n rmSync,\n unlinkSync,\n writeFileSync,\n} from 'node:fs';\nimport * as fsAsync from 'node:fs/promises';\nimport * as path from 'node:path';\nimport { getMidsceneRunSubDir } from '@midscene/shared/common';\nimport { antiEscapeScriptTag, logMsg, uuid } from '@midscene/shared/utils';\nimport { getReportFileName } from './agent/report-file-name';\nimport {\n DATA_SCREENSHOT_MODE_ATTR,\n extractAllDumpScriptsSync,\n extractLastDumpScriptSync,\n extractTestRunReportDumpSync,\n generateAgentReportComment,\n getBaseUrlFixScript,\n generateTestRunReportScriptTag as runnerDumpScript,\n streamDumpScriptsSync,\n streamImageScriptsToFile,\n} from './dump/html-utils';\nimport {\n imageRefFileExtension,\n normalizeStoredImageRef,\n} from './dump/image-reference';\nimport {\n parseBase64ImageDataUrl,\n resolveImageSource,\n} from './dump/screenshot-store';\nimport { collectReportSummary } from './report-stats';\nimport type {\n AssembleTestRunReportOptions,\n IndexedTestRunReportSource,\n TestRunReportMetrics,\n TestRunReportSource,\n TestRunReportSourceIndex,\n} from './test-run-report';\nimport {\n type MergeTestRunReportSource,\n mergeTestRunReportDumps,\n} from './test-runner/reporting/merge-report';\nimport {\n type ExecutionDump,\n type IExecutionDump,\n ReportActionDump,\n type ScreenshotMode,\n} from './types';\nimport type { ReportFileWithAttributes } from './types';\nimport { getReportTpl, getVersion, reportHTMLContent } from './utils';\n\n/**\n * Read the screenshot storage mode a report declared at generation time.\n *\n * Reports written by current versions stamp `data-screenshot-mode` onto every\n * dump script tag, so we only need to peek at the first real dump script (the\n * template's bundled JS also references the dump type string, hence the\n * `data-group-id` filter) and can stop streaming immediately.\n *\n * Returns undefined for legacy reports that predate the attribute or for\n * unreadable files, letting the caller fall back to a filesystem heuristic.\n */\nconst screenshotModeAttrRegExp = new RegExp(\n `${DATA_SCREENSHOT_MODE_ATTR}=\"(inline|directory)\"`,\n);\n\nfunction readDeclaredScreenshotMode(\n reportFilePath: string,\n): ScreenshotMode | undefined {\n let mode: ScreenshotMode | undefined;\n try {\n streamDumpScriptsSync(reportFilePath, ({ openTag }) => {\n // Skip false matches from the template's bundled JS code.\n if (!openTag.includes('data-group-id')) return false;\n const match = openTag.match(screenshotModeAttrRegExp);\n mode = match?.[1] as ScreenshotMode | undefined;\n return true; // the first real dump script decides the mode\n });\n } catch {\n // Unreadable / non-existent file — let the caller fall back.\n }\n return mode;\n}\n\n/**\n * Check if a report is in directory mode (html-and-external-assets).\n * Directory mode reports: {name}/index.html + {name}/screenshots/\n *\n * The mode is read from the report's own `data-screenshot-mode` metadata, which\n * is authoritative regardless of whether the run happened to capture any\n * screenshots. For legacy reports without the attribute we fall back to the old\n * filesystem heuristic (an `index.html` that has a sibling `screenshots/` dir).\n */\nexport function isDirectoryModeReport(reportFilePath: string): boolean {\n // Directory-mode reports are always written as `{name}/index.html`, so any\n // other filename is inline. Short-circuit before touching the file so the\n // common inline case (`{name}.html`) costs nothing.\n if (path.basename(reportFilePath) !== 'index.html') return false;\n\n const declared = readDeclaredScreenshotMode(reportFilePath);\n if (declared) return declared === 'directory';\n\n // Legacy fallback for reports generated before screenshotMode was embedded.\n return existsSync(path.join(path.dirname(reportFilePath), 'screenshots'));\n}\n\n/**\n * Whether a report lives in its own dedicated directory (`{name}/index.html`)\n * rather than being a single standalone file (`{name}.html`).\n *\n * This is a structural fact about *where the report file sits*, independent of\n * how it stores screenshots: a directory report can keep screenshots external\n * (a `screenshots/` sibling) OR inline them into `index.html`. Deletion needs\n * this — not the screenshot mode — to decide whether to remove the whole\n * directory or just unlink a file, so that an inline-screenshot report nested in\n * its own folder still has the folder removed instead of being orphaned.\n */\nfunction isDirectoryBasedReport(reportFilePath: string): boolean {\n return path.basename(reportFilePath) === 'index.html';\n}\n\n/**\n * Remove a complete report artifact from disk.\n *\n * Standalone reports own only their HTML file, while directory-based reports\n * own the directory containing `index.html`. Callers must decide whether they\n * own the source artifact and should only invoke this after its replacement\n * has been produced successfully.\n *\n * @param reportFilePath Path to the standalone report or directory report's\n * `index.html` entry point.\n * @throws When the owned report artifact cannot be removed.\n */\nexport function removeReportArtifact(reportFilePath: string): void {\n if (isDirectoryBasedReport(reportFilePath)) {\n rmSync(path.dirname(reportFilePath), { recursive: true, force: true });\n return;\n }\n unlinkSync(reportFilePath);\n}\n\n/**\n * Deduplicate executions by stable id, keeping only the last occurrence.\n * Old-format executions without id are always preserved.\n */\nexport function dedupeExecutionsKeepLatest<T extends Pick<ExecutionDump, 'id'>>(\n executions: T[],\n): T[] {\n let noIdCounter = 0;\n const deduped = new Map<string, T>();\n for (const exec of executions) {\n const key = exec.id || `__no_id_${noIdCounter++}`;\n deduped.set(key, exec);\n }\n return Array.from(deduped.values());\n}\n/**\n * Peek at the first `sdkVersion` field embedded in a midscene_web_dump\n * script tag inside the given report file. Returns undefined if no\n * recognizable tag or sdkVersion is present.\n */\nfunction peekReportSdkVersion(reportFilePath: string): string | undefined {\n try {\n const dump = extractLastDumpScriptSync(reportFilePath);\n if (!dump) return undefined;\n const match = dump.match(/\"sdkVersion\"\\s*:\\s*\"([^\"]+)\"/);\n return match?.[1];\n } catch {\n return undefined;\n }\n}\n\nconst warnedMismatchedVersions = new Set<string>();\n\nfunction tryParseAgentReportDump(dumpString: string): ReportActionDump | null {\n const trimmed = dumpString.trimStart();\n if (!trimmed.startsWith('{') || !trimmed.includes('\"executions\"')) {\n return null;\n }\n\n try {\n return ReportActionDump.fromSerializedString(trimmed);\n } catch {\n return null;\n }\n}\n\nfunction mergedAgentReportComment(reports: ReportActionDump[]): string {\n if (reports.length === 0) {\n return '';\n }\n if (reports.length === 1) {\n return generateAgentReportComment(reports[0]);\n }\n\n const deviceTypes = Array.from(\n new Set(reports.map((report) => report.deviceType).filter(Boolean)),\n );\n const mergedReport = new ReportActionDump({\n sdkVersion: reports[0].sdkVersion || getVersion(),\n groupName: 'Merged Midscene Report',\n groupDescription: 'Agent-readable summary for merged report HTML',\n modelBriefs: reports.flatMap((report) => report.modelBriefs ?? []),\n deviceType: deviceTypes.length === 1 ? deviceTypes[0] : 'mixed',\n executions: dedupeExecutionsKeepLatest(\n reports.flatMap((report) => report.executions ?? []),\n ),\n });\n return generateAgentReportComment(mergedReport);\n}\n\nexport class ReportMergingTool {\n private reportInfos: ReportFileWithAttributes[] = [];\n\n private createEmptyDumpString(groupName: string, groupDescription?: string) {\n return new ReportActionDump({\n sdkVersion: '',\n groupName,\n groupDescription,\n modelBriefs: [],\n executions: [],\n }).serialize();\n }\n\n public append(reportInfo: ReportFileWithAttributes) {\n if (\n !reportInfo.reportFilePath &&\n reportInfo.reportAttributes.testStatus !== 'skipped'\n ) {\n throw new Error(\n 'reportFilePath is required unless reportAttributes.testStatus is \"skipped\"',\n );\n }\n\n if (reportInfo.reportFilePath) {\n const sourceVersion = peekReportSdkVersion(reportInfo.reportFilePath);\n const currentVersion = getVersion();\n if (\n sourceVersion &&\n currentVersion &&\n sourceVersion !== currentVersion &&\n !warnedMismatchedVersions.has(sourceVersion)\n ) {\n warnedMismatchedVersions.add(sourceVersion);\n logMsg(\n `[@midscene/core] ReportMergingTool version mismatch: source report was written by @midscene/core@${sourceVersion} but the merger is @midscene/core@${currentVersion}. This commonly means @midscene/core and the device package (e.g. @midscene/android) resolve to different versions in node_modules. Merged output may silently drop intermediate steps. Align the versions and reinstall (rm -rf node_modules package-lock.json && npm install).`,\n );\n }\n }\n this.reportInfos.push(reportInfo);\n }\n public clear() {\n this.reportInfos = [];\n }\n\n /**\n * Merge multiple dump script contents (from the same source report)\n * into a single serialized ReportActionDump string.\n * If there's only one dump, return it as-is. If multiple, merge\n * all executions into the first dump's group structure.\n */\n private mergeDumpScripts(contents: string[]): string {\n const unescaped = contents\n .map((c) => antiEscapeScriptTag(c))\n .filter((c) => c.length > 0);\n if (unescaped.length === 0) return '';\n if (unescaped.length === 1) return unescaped[0];\n\n // Parse all dumps and collect executions, deduplicating by id (keep last).\n // Only executions with a stable id are deduped; old-format entries without\n // id are always kept (they may be distinct despite sharing the same name).\n const base = ReportActionDump.fromSerializedString(unescaped[0]);\n const allExecutions = [...base.executions];\n for (let i = 1; i < unescaped.length; i++) {\n const other = ReportActionDump.fromSerializedString(unescaped[i]);\n allExecutions.push(...other.executions);\n }\n base.executions = dedupeExecutionsKeepLatest(allExecutions);\n return base.serialize();\n }\n\n public mergeReports(\n reportFileName: 'AUTO' | string = 'AUTO',\n opts?: {\n rmOriginalReports?: boolean;\n overwrite?: boolean;\n outputDir?: string;\n },\n ): string | null {\n const {\n rmOriginalReports = false,\n overwrite = false,\n outputDir,\n } = opts ?? {};\n\n if (this.reportInfos.length === 0) {\n logMsg('No reports to merge');\n return null;\n }\n\n const runnerDumps = this.reportInfos.map((info) =>\n info.reportFilePath\n ? extractTestRunReportDumpSync(info.reportFilePath)\n : undefined,\n );\n const hasRunnerDump = runnerDumps.some(Boolean);\n\n const targetDir = outputDir\n ? path.resolve(outputDir)\n : getMidsceneRunSubDir('report');\n if (outputDir) {\n mkdirSync(targetDir, { recursive: true });\n }\n\n // Resolve each report's screenshot mode exactly once. isDirectoryModeReport\n // reads the file to find the authoritative metadata, so recomputing it for\n // both the output-path decision and the per-report merge loop would re-scan\n // every report twice.\n const isDirModeByIndex = this.reportInfos.map((info) =>\n Boolean(\n info.reportFilePath && isDirectoryModeReport(info.reportFilePath),\n ),\n );\n const hasDirectoryModeReport = isDirModeByIndex.some(Boolean);\n\n const resolvedName =\n reportFileName === 'AUTO'\n ? getReportFileName('merged-report')\n : reportFileName;\n\n // Directory mode: output as {name}/index.html to keep relative paths working\n // Inline mode: output as {name}.html (single file)\n const outputFilePath = hasDirectoryModeReport\n ? path.resolve(targetDir, resolvedName, 'index.html')\n : path.resolve(targetDir, `${resolvedName}.html`);\n\n if (reportFileName !== 'AUTO' && existsSync(outputFilePath)) {\n if (!overwrite) {\n throw new Error(\n `Report file already exists: ${outputFilePath}\\nSet overwrite to true to overwrite this file.`,\n );\n }\n if (hasDirectoryModeReport) {\n rmSync(path.dirname(outputFilePath), { recursive: true, force: true });\n } else {\n unlinkSync(outputFilePath);\n }\n }\n\n if (hasDirectoryModeReport) {\n mkdirSync(path.dirname(outputFilePath), { recursive: true });\n }\n\n logMsg(\n `Start merging ${this.reportInfos.length} reports...\\nCreating template file...`,\n );\n\n try {\n // Write template without closing </html> tag so we can append\n // dump scripts before it. The closing tag is added at the end.\n const htmlEndTag = '</html>';\n const tpl = getReportTpl();\n const htmlEndIdx = tpl.lastIndexOf(htmlEndTag);\n const tplWithoutClose =\n htmlEndIdx !== -1 ? tpl.slice(0, htmlEndIdx) : tpl;\n appendFileSync(outputFilePath, tplWithoutClose);\n\n // For directory-mode output, inject base URL fix script\n if (hasDirectoryModeReport) {\n appendFileSync(outputFilePath, getBaseUrlFixScript());\n }\n\n const agentReports: ReportActionDump[] = [];\n const runnerSources: MergeTestRunReportSource[] = [];\n const writtenInlineImageIds = new Set<string>();\n\n // Process all reports one by one\n for (let i = 0; i < this.reportInfos.length; i++) {\n const reportInfo = this.reportInfos[i];\n logMsg(`Processing report ${i + 1}/${this.reportInfos.length}`);\n\n const { reportAttributes } = reportInfo;\n let dumpString = this.createEmptyDumpString(\n reportAttributes.testTitle,\n reportAttributes.testDescription,\n );\n let mergedGroupId = `merged-group-${i}`;\n\n if (reportInfo.reportFilePath) {\n if (isDirModeByIndex[i]) {\n // Directory mode: copy external screenshot files. A directory-mode\n // report can legitimately have no screenshots/ dir (a run that\n // captured nothing), so only copy when the source dir exists.\n const reportDir = path.dirname(reportInfo.reportFilePath);\n const screenshotsDir = path.join(reportDir, 'screenshots');\n if (existsSync(screenshotsDir)) {\n const mergedScreenshotsDir = path.join(\n path.dirname(outputFilePath),\n 'screenshots',\n );\n mkdirSync(mergedScreenshotsDir, { recursive: true });\n for (const file of readdirSync(screenshotsDir)) {\n const src = path.join(screenshotsDir, file);\n const dest = path.join(mergedScreenshotsDir, file);\n copyFileSync(src, dest);\n }\n }\n } else {\n // Inline mode: stream image scripts to output file\n streamImageScriptsToFile(\n reportInfo.reportFilePath,\n outputFilePath,\n writtenInlineImageIds,\n );\n }\n\n // Extract all dump scripts from the source report.\n // After the per-execution append refactor, a single source report\n // may contain multiple <script type=\"midscene_web_dump\"> tags\n // (one per execution). We merge them into a single ReportActionDump.\n // Filter by data-group-id to exclude false matches from the template's\n // bundled JS code, which also references the midscene_web_dump type string.\n const allDumps = extractAllDumpScriptsSync(\n reportInfo.reportFilePath,\n ).filter((d) => d.openTag.includes('data-group-id'));\n const groupIdMatch = allDumps[0]?.openTag.match(\n /data-group-id=\"([^\"]+)\"/,\n );\n if (groupIdMatch && !hasRunnerDump) {\n mergedGroupId = decodeURIComponent(groupIdMatch[1]);\n }\n const extractedDumpString =\n allDumps.length > 0\n ? this.mergeDumpScripts(allDumps.map((d) => d.content))\n : extractLastDumpScriptSync(reportInfo.reportFilePath);\n if (extractedDumpString) {\n dumpString = extractedDumpString;\n }\n }\n\n const agentReport = tryParseAgentReportDump(dumpString);\n if (agentReport) {\n agentReports.push(agentReport);\n }\n if (hasRunnerDump)\n runnerSources.push({\n reportId: mergedGroupId,\n sourcePath: reportInfo.reportFilePath ?? '<skipped-agent-report>',\n attributes: reportAttributes,\n dump: runnerDumps[i],\n timing: agentReport\n ? agentReportTiming(agentReport, reportAttributes.testDuration)\n : undefined,\n });\n\n const reportHtmlStr = `${reportHTMLContent(\n {\n dumpString,\n attributes: {\n 'data-group-id': mergedGroupId,\n ...(hasRunnerDump ? { 'data-report-id': mergedGroupId } : {}),\n [DATA_SCREENSHOT_MODE_ATTR]: hasDirectoryModeReport\n ? 'directory'\n : 'inline',\n playwright_test_duration: reportAttributes.testDuration,\n playwright_test_status: reportAttributes.testStatus,\n playwright_test_title: reportAttributes.testTitle,\n playwright_test_id: reportAttributes.testId,\n playwright_test_description: reportAttributes.testDescription,\n is_merged: true,\n },\n },\n undefined,\n undefined,\n false,\n )}\\n`;\n\n appendFileSync(outputFilePath, reportHtmlStr);\n }\n\n if (hasRunnerDump) {\n const summary = collectReportSummary({\n executions: dedupeExecutionsKeepLatest(\n agentReports.flatMap((report) => report.executions),\n ),\n });\n appendFileSync(\n outputFilePath,\n runnerDumpScript(\n mergeTestRunReportDumps(\n runnerSources,\n {\n modelCallCount: summary.timing.modelCallCount,\n modelTimeMs: summary.timing.modelCallTimeMs,\n ...summary.tokens,\n },\n uuid(),\n ),\n ),\n );\n }\n\n const agentComment = mergedAgentReportComment(agentReports);\n if (agentComment) {\n appendFileSync(outputFilePath, agentComment);\n }\n\n // Close the HTML document\n appendFileSync(outputFilePath, `${htmlEndTag}\\n`);\n\n logMsg(`Successfully merged new report: ${outputFilePath}`);\n\n // Remove original reports if needed\n if (rmOriginalReports) {\n let removedReportCount = 0;\n let reportCountWithFilePath = 0;\n for (const info of this.reportInfos) {\n if (!info.reportFilePath) continue;\n reportCountWithFilePath += 1;\n try {\n removeReportArtifact(info.reportFilePath);\n removedReportCount += 1;\n } catch (error) {\n logMsg(`Error deleting report ${info.reportFilePath}: ${error}`);\n }\n }\n logMsg(\n `Removed ${removedReportCount}/${reportCountWithFilePath} original reports`,\n );\n }\n return outputFilePath;\n } catch (error) {\n logMsg(`Error in mergeReports: ${error}`);\n throw error;\n }\n }\n}\n\nfunction agentReportTiming(\n report: ReportActionDump,\n durationMs: number,\n): MergeTestRunReportSource['timing'] {\n const timing = collectReportSummary(report).timing;\n const executionTimes = report.executions\n .map((execution) => execution.logTime)\n .filter(\n (value): value is number =>\n typeof value === 'number' && Number.isFinite(value),\n );\n const started =\n timing.wallTimeStart ??\n (executionTimes.length ? Math.min(...executionTimes) : undefined);\n if (started === undefined) return undefined;\n const ended =\n timing.wallTimeEnd ??\n Math.max(\n ...executionTimes,\n started + (Number.isFinite(durationMs) ? Math.max(0, durationMs) : 0),\n );\n return {\n startedAt: new Date(started).toISOString(),\n endedAt: new Date(ended).toISOString(),\n durationMs: Math.max(0, ended - started),\n };\n}\n\ninterface PreparedTestRunReportSource extends IndexedTestRunReportSource {\n dump: ReportActionDump;\n directoryMode: boolean;\n dumpPath?: string;\n}\n\nconst validateTestRunReportFileName = (fileName: string): void => {\n if (\n !fileName ||\n fileName === '.' ||\n fileName === '..' ||\n path.basename(fileName) !== fileName ||\n fileName.endsWith('.html')\n ) {\n throw new Error(\n `Midscene Test reportFileName must be one path segment without an extension: ${fileName}`,\n );\n }\n};\n\nconst uniqueTestRunReportSources = (\n sources: readonly TestRunReportSource[],\n): TestRunReportSource[] => {\n const unique = new Map<string, TestRunReportSource>();\n\n for (const source of sources) {\n const scopeId = source.scopeId.trim();\n const sourcePath = path.resolve(source.sourcePath);\n if (!scopeId) {\n throw new Error('Midscene Test report source scopeId must not be empty.');\n }\n\n unique.set(`${scopeId}\\u0000${source.dumpPath ?? sourcePath}`, {\n ...source,\n scopeId,\n sourcePath,\n });\n }\n\n return [...unique.values()];\n};\n\nconst prepareTestRunReportSources = (\n sources: readonly TestRunReportSource[],\n loadedDumps?: ReadonlyMap<string, string>,\n): {\n sources: PreparedTestRunReportSource[];\n metrics: TestRunReportMetrics;\n} => {\n const prepared: PreparedTestRunReportSource[] = [];\n const ownerByScopedExecution = new Map<string, string>();\n const preparedByPath = new Map<string, PreparedTestRunReportSource>();\n\n for (const [sourceIndex, source] of uniqueTestRunReportSources(\n sources,\n ).entries()) {\n // A borrowed Agent can serve several sequential test scopes. Reuse its\n // report group and metrics while indexing each scope's execution links.\n const sourceKey = source.sourcePath;\n const shared = preparedByPath.get(sourceKey);\n if (shared) {\n if (source.dumpPath) {\n const snapshot = ReportActionDump.fromSerializedString(\n loadedDumps?.get(source.dumpPath) ??\n readFileSync(source.dumpPath, 'utf8'),\n );\n shared.dump.executions = dedupeExecutionsKeepLatest([\n ...shared.dump.executions,\n ...snapshot.executions,\n ]);\n shared.executionIds.splice(\n 0,\n shared.executionIds.length,\n ...shared.dump.executions.flatMap((execution) =>\n execution.id ? [execution.id] : [],\n ),\n );\n }\n for (const executionId of shared.executionIds) {\n const key = `${source.scopeId}\\u0000${executionId}`;\n const owner = ownerByScopedExecution.get(key);\n if (owner && owner !== shared.reportId)\n throw new Error(\n `Agent execution ${executionId} is present in multiple reports for test scope ${source.scopeId}: ${owner}, ${shared.reportId}`,\n );\n ownerByScopedExecution.set(key, shared.reportId);\n }\n prepared.push({ ...shared, scopeId: source.scopeId });\n continue;\n }\n if (!source.dumpPath && !existsSync(source.sourcePath)) {\n throw new Error(`Agent report does not exist: ${source.sourcePath}`);\n }\n\n const sourceVersion = source.dumpPath\n ? undefined\n : peekReportSdkVersion(source.sourcePath);\n const currentVersion = getVersion();\n if (\n sourceVersion &&\n currentVersion &&\n sourceVersion !== currentVersion &&\n !warnedMismatchedVersions.has(sourceVersion)\n ) {\n warnedMismatchedVersions.add(sourceVersion);\n logMsg(\n `[@midscene/core] TestRunReportAssembler version mismatch: source report was written by @midscene/core@${sourceVersion} but the assembler is @midscene/core@${currentVersion}. Align the workspace package versions before generating the Midscene Test report.`,\n );\n }\n\n const reportId = `runner-report-${sourceIndex + 1}`;\n const snapshot = source.dumpPath\n ? ReportActionDump.fromSerializedString(\n loadedDumps?.get(source.dumpPath) ??\n readFileSync(source.dumpPath, 'utf8'),\n )\n : undefined;\n const { baseDump, executions } = snapshot\n ? { baseDump: snapshot, executions: snapshot.executions }\n : collectDedupedExecutions(source.sourcePath);\n const executionIds: string[] = [];\n for (const execution of executions) {\n if (!execution.id) continue;\n const scopedExecution = `${source.scopeId}\\u0000${execution.id}`;\n const previousOwner = ownerByScopedExecution.get(scopedExecution);\n if (previousOwner && previousOwner !== reportId) {\n throw new Error(\n `Agent execution ${execution.id} is present in multiple reports for test scope ${source.scopeId}: ${previousOwner}, ${reportId}`,\n );\n }\n ownerByScopedExecution.set(scopedExecution, reportId);\n executionIds.push(execution.id);\n }\n\n const dump = new ReportActionDump({\n sdkVersion: baseDump.sdkVersion,\n groupName: baseDump.groupName,\n groupDescription: baseDump.groupDescription,\n modelBriefs: baseDump.modelBriefs,\n deviceType: baseDump.deviceType,\n executions,\n });\n const preparedSource = {\n reportId,\n scopeId: source.scopeId,\n sourcePath: source.sourcePath,\n executionIds,\n dump,\n directoryMode:\n !!source.dumpPath || isDirectoryModeReport(source.sourcePath),\n ...(source.dumpPath ? { dumpPath: source.dumpPath } : {}),\n };\n prepared.push(preparedSource);\n preparedByPath.set(sourceKey, preparedSource);\n }\n\n // A legacy invocation can preserve a snapshot of an Agent also used by\n // native scopes. Count stable executions once across both paths.\n const summary = collectReportSummary({\n executions: dedupeExecutionsKeepLatest(\n [...preparedByPath.values()].flatMap((source) => source.dump.executions),\n ),\n });\n return {\n sources: prepared,\n metrics: {\n modelCallCount: summary.timing.modelCallCount,\n modelTimeMs: summary.timing.modelCallTimeMs,\n ...summary.tokens,\n },\n };\n};\n\n/**\n * Build a self-contained Midscene Test report while preserving the existing\n * Agent dump format consumed by the Report App.\n *\n * Test hierarchy and status live in `midscene_test_run_dump`; Agent reports\n * remain independent `midscene_web_dump` groups addressed by `data-report-id`.\n */\nexport class TestRunReportAssembler {\n /** Runtime publisher: current Agent snapshots avoid parsing HTML or copying unused images. */\n public async assembleAsync(\n options: AssembleTestRunReportOptions,\n ): Promise<string> {\n validateTestRunReportFileName(options.reportFileName);\n const loaded = new Map<string, string>();\n await Promise.all(\n options.sources.map(async (source) => {\n if (source.dumpPath)\n loaded.set(\n source.dumpPath,\n await fsAsync.readFile(source.dumpPath, 'utf8'),\n );\n }),\n );\n const prepared = prepareTestRunReportSources(options.sources, loaded);\n const dump = options.buildRunnerDump({\n sources: prepared.sources,\n metrics: prepared.metrics,\n });\n if (dump.kind !== 'test-runner' || dump.schemaVersion !== 1)\n throw new Error('Invalid Runner report dump');\n const directoryMode = prepared.sources.some(\n (source) => source.directoryMode,\n );\n const outputDir = path.resolve(options.outputDir);\n await fsAsync.mkdir(outputDir, { recursive: true });\n const artifact = path.join(outputDir, options.reportFileName);\n const finalPath = directoryMode\n ? path.join(artifact, 'index.html')\n : `${artifact}.html`;\n if (\n !options.overwrite &&\n (existsSync(artifact) || existsSync(`${artifact}.html`))\n )\n throw new Error(`Report artifact already exists: ${artifact}`);\n const temporary = await fsAsync.mkdtemp(\n path.join(outputDir, '.test-run-report-'),\n );\n const htmlPath = path.join(temporary, 'index.html');\n try {\n const parts = [\n getReportTpl(),\n directoryMode ? getBaseUrlFixScript() : '',\n ];\n const imageIds = new Set<string>();\n const reports: ReportActionDump[] = [];\n for (const source of new Map(\n prepared.sources.map((source) => [source.reportId, source]),\n ).values()) {\n const serialized = source.dump.serialize();\n if (source.dumpPath) {\n const refs = new Map<\n string,\n ReturnType<typeof normalizeStoredImageRef> & {}\n >();\n JSON.parse(serialized, (_key, value) => {\n const ref = normalizeStoredImageRef(value);\n if (ref) refs.set(ref.id, ref);\n return value;\n });\n if (refs.size)\n await fsAsync.mkdir(path.join(temporary, 'screenshots'), {\n recursive: true,\n });\n for (const ref of refs.values()) {\n if (imageIds.has(ref.id)) continue;\n if (ref.storage !== 'file' || !ref.path)\n throw new Error(`Snapshot image ${ref.id} has no file source`);\n await fsAsync.copyFile(\n path.resolve(path.dirname(source.dumpPath), ref.path),\n path.join(\n temporary,\n 'screenshots',\n `${ref.id}.${imageRefFileExtension(ref)}`,\n ),\n );\n imageIds.add(ref.id);\n }\n } else {\n // An explicit external provider may still return a finalized HTML artifact.\n // This is a public provider contract, not a second execution/serialization schema.\n if (source.directoryMode) {\n const images = path.join(\n path.dirname(source.sourcePath),\n 'screenshots',\n );\n if (existsSync(images))\n await fsAsync.cp(images, path.join(temporary, 'screenshots'), {\n recursive: true,\n });\n } else {\n const html = await fsAsync.readFile(source.sourcePath, 'utf8');\n for (const match of html.matchAll(\n /<script\\b([^>]*)>[\\s\\S]*?<\\/script>/g,\n )) {\n if (/(?:^|\\s)type=[\"']midscene-image[\"']/.test(match[1]))\n parts.push(match[0]);\n }\n }\n }\n reports.push(source.dump);\n parts.push(\n reportHTMLContent(\n {\n dumpString: serialized,\n attributes: {\n 'data-group-id': source.reportId,\n 'data-report-id': source.reportId,\n 'data-runner-scope-id': source.scopeId,\n [DATA_SCREENSHOT_MODE_ATTR]: directoryMode\n ? 'directory'\n : 'inline',\n },\n },\n undefined,\n undefined,\n false,\n ),\n );\n }\n parts.push(runnerDumpScript(dump), mergedAgentReportComment(reports));\n await fsAsync.writeFile(htmlPath, parts.join('\\n'));\n if (options.overwrite) {\n await fsAsync.rm(artifact, { recursive: true, force: true });\n await fsAsync.rm(`${artifact}.html`, { force: true });\n }\n await fsAsync.rename(\n directoryMode ? temporary : htmlPath,\n directoryMode ? artifact : finalPath,\n );\n return finalPath;\n } finally {\n await fsAsync.rm(temporary, { recursive: true, force: true });\n }\n }\n\n public assemble(options: AssembleTestRunReportOptions): string {\n validateTestRunReportFileName(options.reportFileName);\n const outputDir = path.resolve(options.outputDir);\n mkdirSync(outputDir, { recursive: true });\n\n const prepared = prepareTestRunReportSources(options.sources);\n const index: TestRunReportSourceIndex = {\n sources: prepared.sources.map(\n ({ reportId, scopeId, sourcePath, executionIds }) => ({\n reportId,\n scopeId,\n sourcePath,\n executionIds,\n }),\n ),\n metrics: prepared.metrics,\n };\n const runnerDump = options.buildRunnerDump(index);\n if (runnerDump.schemaVersion !== 1 || runnerDump.kind !== 'test-runner') {\n throw new Error(\n 'buildRunnerDump must return a Midscene Test report dump with schemaVersion 1 and kind \"test-runner\".',\n );\n }\n // Validate serializability before creating any output artifact.\n JSON.stringify(runnerDump);\n\n const directoryMode = prepared.sources.some(\n (source) => source.directoryMode,\n );\n const finalArtifactPath = path.join(outputDir, options.reportFileName);\n const directoryReportPath = path.join(finalArtifactPath, 'index.html');\n const standaloneReportPath = `${finalArtifactPath}.html`;\n const finalReportPath = directoryMode\n ? directoryReportPath\n : standaloneReportPath;\n const existingArtifacts = [finalArtifactPath, standaloneReportPath].filter(\n existsSync,\n );\n if (existingArtifacts.length > 0 && !options.overwrite) {\n throw new Error(\n `Report artifact already exists: ${existingArtifacts[0]}\\nSet overwrite to true to overwrite this report.`,\n );\n }\n\n const temporaryRoot = mkdtempSync(\n path.join(outputDir, '.test-run-report-'),\n );\n const temporaryArtifactPath = path.join(\n temporaryRoot,\n options.reportFileName,\n );\n const temporaryReportPath = directoryMode\n ? path.join(temporaryArtifactPath, 'index.html')\n : `${temporaryArtifactPath}.html`;\n\n try {\n if (directoryMode) {\n mkdirSync(temporaryArtifactPath, { recursive: true });\n }\n\n const htmlEndTag = '</html>';\n const template = getReportTpl();\n const htmlEndIndex = template.lastIndexOf(htmlEndTag);\n appendFileSync(\n temporaryReportPath,\n htmlEndIndex === -1 ? template : template.slice(0, htmlEndIndex),\n );\n if (directoryMode) {\n appendFileSync(temporaryReportPath, getBaseUrlFixScript());\n }\n\n const agentReports: ReportActionDump[] = [];\n for (const source of new Map(\n prepared.sources.map((source) => [source.reportId, source]),\n ).values()) {\n if (source.directoryMode) {\n const screenshotsDir = path.join(\n path.dirname(source.sourcePath),\n 'screenshots',\n );\n if (existsSync(screenshotsDir)) {\n const targetScreenshotsDir = path.join(\n path.dirname(temporaryReportPath),\n 'screenshots',\n );\n mkdirSync(targetScreenshotsDir, { recursive: true });\n for (const file of readdirSync(screenshotsDir)) {\n copyFileSync(\n path.join(screenshotsDir, file),\n path.join(targetScreenshotsDir, file),\n );\n }\n }\n } else {\n streamImageScriptsToFile(source.sourcePath, temporaryReportPath);\n }\n\n agentReports.push(source.dump);\n appendFileSync(\n temporaryReportPath,\n `${reportHTMLContent(\n {\n dumpString: source.dump.serialize(),\n attributes: {\n 'data-group-id': source.reportId,\n 'data-report-id': source.reportId,\n 'data-runner-scope-id': source.scopeId,\n [DATA_SCREENSHOT_MODE_ATTR]: directoryMode\n ? 'directory'\n : 'inline',\n },\n },\n undefined,\n undefined,\n false,\n )}\\n`,\n );\n }\n\n appendFileSync(temporaryReportPath, runnerDumpScript(runnerDump));\n const agentComment = mergedAgentReportComment(agentReports);\n if (agentComment) {\n appendFileSync(temporaryReportPath, agentComment);\n }\n appendFileSync(temporaryReportPath, `${htmlEndTag}\\n`);\n\n if (existsSync(finalArtifactPath)) {\n rmSync(finalArtifactPath, { recursive: true, force: true });\n }\n if (existsSync(standaloneReportPath)) {\n unlinkSync(standaloneReportPath);\n }\n renameSync(\n directoryMode ? temporaryArtifactPath : temporaryReportPath,\n directoryMode ? finalArtifactPath : standaloneReportPath,\n );\n rmSync(temporaryRoot, { recursive: true, force: true });\n return finalReportPath;\n } catch (error) {\n rmSync(temporaryRoot, { recursive: true, force: true });\n throw error;\n }\n }\n}\n\nexport interface SplitReportHtmlOptions {\n htmlPath: string;\n outputDir: string;\n}\n\nexport interface SplitReportHtmlResult {\n executionJsonFiles: string[];\n screenshotFiles: string[];\n}\n\nexport interface CollectedReportExecutions {\n baseDump: ReportActionDump;\n executions: IExecutionDump[];\n}\n\n/**\n * Collect executions from a report HTML, deduplicating by stable id while\n * keeping only the latest occurrence. Old-format executions without id are\n * always preserved.\n */\nexport function collectDedupedExecutions(\n htmlPath: string,\n): CollectedReportExecutions {\n let baseDump: ReportActionDump | null = null;\n let executionSerial = 0;\n const latestSerialByExecutionId = new Map<string, number>();\n\n streamDumpScriptsSync(htmlPath, (dumpScript) => {\n if (!dumpScript.openTag.includes('data-group-id')) {\n return false;\n }\n const groupedDump = ReportActionDump.fromSerializedString(\n antiEscapeScriptTag(dumpScript.content),\n );\n for (const execution of groupedDump.executions) {\n executionSerial += 1;\n if (execution.id) {\n latestSerialByExecutionId.set(execution.id, executionSerial);\n }\n }\n return false;\n });\n\n const executions: IExecutionDump[] = [];\n executionSerial = 0;\n streamDumpScriptsSync(htmlPath, (dumpScript) => {\n if (!dumpScript.openTag.includes('data-group-id')) {\n return false;\n }\n\n const groupedDump = ReportActionDump.fromSerializedString(\n antiEscapeScriptTag(dumpScript.content),\n );\n if (!baseDump) {\n baseDump = groupedDump;\n }\n\n for (const execution of groupedDump.executions) {\n executionSerial += 1;\n if (\n execution.id &&\n latestSerialByExecutionId.get(execution.id) !== executionSerial\n ) {\n continue;\n }\n executions.push(execution);\n }\n\n return false;\n });\n\n if (!baseDump) {\n throw new Error(`No report dump scripts found in ${htmlPath}`);\n }\n\n return {\n baseDump,\n executions,\n };\n}\n\nfunction externalizeImagesInExecution(\n execution: IExecutionDump,\n opts: {\n htmlPath: string;\n screenshotsDir: string;\n writtenFiles: Set<string>;\n },\n): void {\n const visit = (node: unknown): void => {\n if (Array.isArray(node)) {\n for (const item of node) {\n visit(item);\n }\n return;\n }\n\n if (typeof node !== 'object' || node === null) return;\n\n const ref = normalizeStoredImageRef(node);\n if (ref) {\n const ext = imageRefFileExtension(ref);\n const fileName = `${ref.id}.${ext}`;\n const relativePath = `./screenshots/${fileName}`;\n const absolutePath = path.join(opts.screenshotsDir, fileName);\n\n if (!opts.writtenFiles.has(fileName)) {\n const resolved = resolveImageSource(ref, {\n reportPath: opts.htmlPath,\n });\n if (resolved.type === 'data-uri') {\n const { rawBase64 } = parseBase64ImageDataUrl(resolved.dataUri);\n writeFileSync(absolutePath, Buffer.from(rawBase64, 'base64'));\n } else {\n copyFileSync(resolved.filePath, absolutePath);\n }\n opts.writtenFiles.add(fileName);\n }\n\n ref.storage = 'file';\n ref.path = relativePath;\n return;\n }\n\n for (const value of Object.values(node)) {\n visit(value);\n }\n };\n\n visit(execution);\n}\n\n/**\n * Reverse parse a Midscene report HTML into per-execution JSON files and\n * externalized screenshots.\n */\nexport function splitReportHtmlByExecution(\n options: SplitReportHtmlOptions,\n): SplitReportHtmlResult {\n const { htmlPath, outputDir } = options;\n const screenshotsDir = path.join(outputDir, 'screenshots');\n\n mkdirSync(outputDir, { recursive: true });\n mkdirSync(screenshotsDir, { recursive: true });\n\n const executionJsonFiles: string[] = [];\n const writtenScreenshotFiles = new Set<string>();\n const { baseDump, executions } = collectDedupedExecutions(htmlPath);\n\n let fileIndex = 0;\n for (const execution of executions) {\n fileIndex += 1;\n externalizeImagesInExecution(execution, {\n htmlPath,\n screenshotsDir,\n writtenFiles: writtenScreenshotFiles,\n });\n const singleExecutionDump = new ReportActionDump({\n sdkVersion: baseDump.sdkVersion,\n groupName: baseDump.groupName,\n groupDescription: baseDump.groupDescription,\n modelBriefs: baseDump.modelBriefs,\n deviceType: baseDump.deviceType,\n executions: [execution],\n });\n\n const jsonFilePath = path.join(outputDir, `${fileIndex}.execution.json`);\n writeFileSync(jsonFilePath, singleExecutionDump.serialize(2), 'utf-8');\n executionJsonFiles.push(jsonFilePath);\n }\n\n return {\n executionJsonFiles,\n screenshotFiles: Array.from(writtenScreenshotFiles)\n .sort()\n .map((fileName) => path.join(screenshotsDir, fileName)),\n };\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","screenshotModeAttrRegExp","RegExp","DATA_SCREENSHOT_MODE_ATTR","readDeclaredScreenshotMode","reportFilePath","mode","streamDumpScriptsSync","openTag","match","isDirectoryModeReport","path","declared","existsSync","isDirectoryBasedReport","removeReportArtifact","rmSync","unlinkSync","dedupeExecutionsKeepLatest","executions","noIdCounter","deduped","Map","exec","Array","peekReportSdkVersion","dump","extractLastDumpScriptSync","warnedMismatchedVersions","Set","tryParseAgentReportDump","dumpString","trimmed","ReportActionDump","mergedAgentReportComment","reports","generateAgentReportComment","deviceTypes","report","Boolean","mergedReport","getVersion","ReportMergingTool","groupName","groupDescription","reportInfo","Error","sourceVersion","currentVersion","logMsg","contents","unescaped","c","antiEscapeScriptTag","base","allExecutions","i","other","reportFileName","opts","rmOriginalReports","overwrite","outputDir","runnerDumps","info","extractTestRunReportDumpSync","undefined","hasRunnerDump","targetDir","getMidsceneRunSubDir","mkdirSync","isDirModeByIndex","hasDirectoryModeReport","resolvedName","getReportFileName","outputFilePath","htmlEndTag","tpl","getReportTpl","htmlEndIdx","tplWithoutClose","appendFileSync","getBaseUrlFixScript","agentReports","runnerSources","writtenInlineImageIds","reportAttributes","mergedGroupId","reportDir","screenshotsDir","mergedScreenshotsDir","file","readdirSync","src","dest","copyFileSync","streamImageScriptsToFile","allDumps","extractAllDumpScriptsSync","d","groupIdMatch","decodeURIComponent","extractedDumpString","agentReport","agentReportTiming","reportHtmlStr","reportHTMLContent","summary","collectReportSummary","runnerDumpScript","mergeTestRunReportDumps","uuid","agentComment","removedReportCount","reportCountWithFilePath","error","durationMs","timing","executionTimes","execution","value","Number","started","Math","ended","Date","validateTestRunReportFileName","fileName","uniqueTestRunReportSources","sources","unique","source","scopeId","sourcePath","prepareTestRunReportSources","loadedDumps","prepared","ownerByScopedExecution","preparedByPath","sourceIndex","sourceKey","shared","snapshot","readFileSync","executionId","owner","reportId","baseDump","collectDedupedExecutions","executionIds","scopedExecution","previousOwner","preparedSource","TestRunReportAssembler","options","loaded","Promise","fsAsync","directoryMode","artifact","finalPath","temporary","htmlPath","parts","imageIds","serialized","refs","JSON","_key","ref","normalizeStoredImageRef","imageRefFileExtension","images","html","index","runnerDump","finalArtifactPath","directoryReportPath","standaloneReportPath","finalReportPath","existingArtifacts","temporaryRoot","mkdtempSync","temporaryArtifactPath","temporaryReportPath","template","htmlEndIndex","targetScreenshotsDir","renameSync","executionSerial","latestSerialByExecutionId","dumpScript","groupedDump","externalizeImagesInExecution","visit","node","item","ext","relativePath","absolutePath","resolved","resolveImageSource","rawBase64","parseBase64ImageDataUrl","writeFileSync","Buffer","splitReportHtmlByExecution","executionJsonFiles","writtenScreenshotFiles","fileIndex","singleExecut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AE/B,MAAM,EAAEQ,QAAQ,EAAEpG,SAAS,EAAE,GAAG4F;IAChC,MAAMjE,iBAAiB9E,mCAAAA,IAAS,CAACmD,WAAW;IAE5CQ,IAAAA,iCAAAA,SAAAA,AAAAA,EAAUR,WAAW;QAAE,WAAW;IAAK;IACvCQ,IAAAA,iCAAAA,SAAAA,AAAAA,EAAUmB,gBAAgB;QAAE,WAAW;IAAK;IAE5C,MAAMsH,qBAA+B,EAAE;IACvC,MAAMC,yBAAyB,IAAInL;IACnC,MAAM,EAAEsH,QAAQ,EAAEhI,UAAU,EAAE,GAAGiI,yBAAyBc;IAE1D,IAAI+C,YAAY;IAChB,KAAK,MAAM1F,aAAapG,WAAY;QAClC8L,aAAa;QACbhB,6BAA6B1E,WAAW;YACtC2C;YACAzE;YACA,cAAcuH;QAChB;QACA,MAAME,sBAAsB,IAAIjL,kCAAAA,gBAAgBA,CAAC;YAC/C,YAAYkH,SAAS,UAAU;YAC/B,WAAWA,SAAS,SAAS;YAC7B,kBAAkBA,SAAS,gBAAgB;YAC3C,aAAaA,SAAS,WAAW;YACjC,YAAYA,SAAS,UAAU;YAC/B,YAAY;gBAAC5B;aAAU;QACzB;QAEA,MAAM4F,eAAexM,mCAAAA,IAAS,CAACmD,WAAW,GAAGmJ,UAAU,eAAe,CAAC;QACvEL,IAAAA,iCAAAA,aAAAA,AAAAA,EAAcO,cAAcD,oBAAoB,SAAS,CAAC,IAAI;QAC9DH,mBAAmB,IAAI,CAACI;IAC1B;IAEA,OAAO;QACLJ;QACA,iBAAiBvL,MAAM,IAAI,CAACwL,wBACzB,IAAI,GACJ,GAAG,CAAC,CAACjF,WAAapH,mCAAAA,IAAS,CAAC8E,gBAAgBsC;IACjD;AACF"}
|
package/dist/lib/utils.js
CHANGED
|
@@ -228,7 +228,7 @@ function stringifyDumpData(data, indents) {
|
|
|
228
228
|
return JSON.stringify(data, replacerForPageObject, indents);
|
|
229
229
|
}
|
|
230
230
|
function getVersion() {
|
|
231
|
-
return "1.13.2
|
|
231
|
+
return "1.13.2";
|
|
232
232
|
}
|
|
233
233
|
function debugLog(...message) {
|
|
234
234
|
const debugMode = process.env[env_namespaceObject.MIDSCENE_DEBUG_MODE];
|
package/dist/types/index.d.ts
CHANGED
|
@@ -20,8 +20,6 @@ export { ReportGenerator, nullReportGenerator } from './report-generator';
|
|
|
20
20
|
export { collectDedupedExecutions, ReportMergingTool, TestRunReportAssembler, dedupeExecutionsKeepLatest, splitReportHtmlByExecution, } from './report';
|
|
21
21
|
export type * from './test-run-report';
|
|
22
22
|
export { TEST_RUN_REPORT_SCRIPT_TYPE } from './test-run-report';
|
|
23
|
-
export type * from './test-run-health';
|
|
24
|
-
export { calculateTestRunHealth, classifyTestRunCase, } from './test-run-health';
|
|
25
23
|
export { createReportCliCommands, reportFileToMarkdown, splitReportFile, mergeReportFiles, type ConsumeReportFileAction, type ReportFileToMarkdownOptions, type ReportCliCommandDefinition, type ReportCliCommandEntry, type SplitReportFileOptions, type MergeReportFilesOptions, type MergeReportFilesResult, } from './report-cli';
|
|
26
24
|
export { ScreenshotItem } from './screenshot-item';
|
|
27
25
|
export type { ImageUrlRef, ScreenshotRef, StoredImageRef, } from './dump/image-reference';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,OAAO,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EACL,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,yBAAyB,EACzB,WAAW,EACX,UAAU,EACV,UAAU,EACV,uBAAuB,EACvB,iBAAiB,EACjB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,GAC5B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,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,sBAAsB,EACtB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,UAAU,CAAC;AAClB,mBAAmB,mBAAmB,CAAC;AACvC,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,GAC5B,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,YAAY,EACV,WAAW,EACX,aAAa,EACb,cAAc,GACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gBAAgB,EAChB,eAAe,GAChB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,GACxB,MAAM,mBAAmB,CAAC"}
|
package/dist/types/report.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { AssembleTestRunReportOptions } from './test-run-report';
|
|
2
2
|
import { type ExecutionDump, type IExecutionDump, ReportActionDump } from './types';
|
|
3
3
|
import type { ReportFileWithAttributes } from './types';
|
|
4
|
-
export { calculateTestRunHealth, classifyTestRunCase, } from './test-run-health';
|
|
5
4
|
/**
|
|
6
5
|
* Check if a report is in directory mode (html-and-external-assets).
|
|
7
6
|
* Directory mode reports: {name}/index.html + {name}/screenshots/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/report.ts"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EACV,4BAA4B,EAK7B,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,gBAAgB,EAEjB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/report.ts"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EACV,4BAA4B,EAK7B,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,gBAAgB,EAEjB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAoCxD;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAWrE;AAiBD;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAMjE;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,EAC5E,UAAU,EAAE,CAAC,EAAE,GACd,CAAC,EAAE,CAQL;AAwDD,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,WAAW,CAAkC;IAErD,OAAO,CAAC,qBAAqB;IAUtB,MAAM,CAAC,UAAU,EAAE,wBAAwB;IA2B3C,KAAK;IAIZ;;;;;OAKG;IACH,OAAO,CAAC,gBAAgB;IAoBjB,YAAY,CACjB,cAAc,GAAE,MAAM,GAAG,MAAe,EACxC,IAAI,CAAC,EAAE;QACL,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GACA,MAAM,GAAG,IAAI;CAwPjB;AA2MD;;;;;;GAMG;AACH,qBAAa,sBAAsB;IACjC,8FAA8F;IACjF,aAAa,CACxB,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,MAAM,CAAC;IAsIX,QAAQ,CAAC,OAAO,EAAE,4BAA4B,GAAG,MAAM;CA+I/D;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,UAAU,EAAE,cAAc,EAAE,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,MAAM,GACf,yBAAyB,CAyD3B;AAqDD;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,sBAAsB,GAC9B,qBAAqB,CAuCvB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/core",
|
|
3
3
|
"description": "Automate browser actions, extract data, and perform assertions using AI. It offers JavaScript SDK, Chrome extension, and support for scripting in YAML. See https://midscenejs.com/ for details.",
|
|
4
|
-
"version": "1.13.2
|
|
4
|
+
"version": "1.13.2",
|
|
5
5
|
"repository": "https://github.com/web-infra-dev/midscene",
|
|
6
6
|
"homepage": "https://midscenejs.com/",
|
|
7
7
|
"main": "./dist/lib/index.js",
|
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
"semver": "7.5.2",
|
|
188
188
|
"undici": "^6.0.0",
|
|
189
189
|
"zod": "^3.25.1",
|
|
190
|
-
"@midscene/shared": "1.13.2
|
|
190
|
+
"@midscene/shared": "1.13.2"
|
|
191
191
|
},
|
|
192
192
|
"devDependencies": {
|
|
193
193
|
"@rslib/core": "^0.18.3",
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
const classifyTestRunCase = (testCase)=>{
|
|
2
|
-
if ('not-run' === testCase.status) return 'not-run';
|
|
3
|
-
if ('failed' === testCase.status) return 'failed';
|
|
4
|
-
const attempts = testCase.attempts ?? (testCase.run ? [
|
|
5
|
-
testCase.run
|
|
6
|
-
] : []);
|
|
7
|
-
return (testCase.retryCount ?? 0) > 0 || (attempts.at(-1)?.attemptIndex ?? 0) > 0 || attempts.length > 1 || attempts[0]?.status === 'failed' ? 'retry-passed' : 'passed';
|
|
8
|
-
};
|
|
9
|
-
const calculateTestRunHealth = (cases)=>{
|
|
10
|
-
let passed = 0;
|
|
11
|
-
let failed = 0;
|
|
12
|
-
let notRun = 0;
|
|
13
|
-
let firstPassed = 0;
|
|
14
|
-
let passedAfterRetry = 0;
|
|
15
|
-
for (const testCase of cases)switch(classifyTestRunCase(testCase)){
|
|
16
|
-
case 'passed':
|
|
17
|
-
passed += 1;
|
|
18
|
-
firstPassed += 1;
|
|
19
|
-
break;
|
|
20
|
-
case 'retry-passed':
|
|
21
|
-
passed += 1;
|
|
22
|
-
passedAfterRetry += 1;
|
|
23
|
-
break;
|
|
24
|
-
case 'failed':
|
|
25
|
-
failed += 1;
|
|
26
|
-
break;
|
|
27
|
-
case 'not-run':
|
|
28
|
-
notRun += 1;
|
|
29
|
-
break;
|
|
30
|
-
}
|
|
31
|
-
const total = cases.length;
|
|
32
|
-
const executed = total - notRun;
|
|
33
|
-
return {
|
|
34
|
-
total,
|
|
35
|
-
executed,
|
|
36
|
-
passed,
|
|
37
|
-
failed,
|
|
38
|
-
notRun,
|
|
39
|
-
firstPassed,
|
|
40
|
-
passedAfterRetry,
|
|
41
|
-
finalPassRate: 0 === executed ? 0 : passed / executed,
|
|
42
|
-
firstPassRate: 0 === executed ? 0 : firstPassed / executed
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
export { calculateTestRunHealth, classifyTestRunCase };
|
|
46
|
-
|
|
47
|
-
//# sourceMappingURL=test-run-health.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-run-health.mjs","sources":["../../src/test-run-health.ts"],"sourcesContent":["export type TestRunCaseHealthStatus =\n | 'passed'\n | 'retry-passed'\n | 'failed'\n | 'not-run';\n\nexport interface TestRunHealthAttempt {\n attemptIndex: number;\n status: 'success' | 'failed';\n}\n\n/** Minimal Case shape accepted by the shared Test run health calculator. */\nexport interface TestRunHealthCase {\n status: 'success' | 'failed' | 'not-run';\n attempts?: readonly TestRunHealthAttempt[];\n /** The legacy single-attempt representation used by execution outcomes. */\n run?: TestRunHealthAttempt;\n /** Retry evidence owned by a surrounding scope, such as a document retry. */\n retryCount?: number;\n}\n\nexport interface TestRunHealth {\n total: number;\n executed: number;\n passed: number;\n failed: number;\n notRun: number;\n firstPassed: number;\n passedAfterRetry: number;\n finalPassRate: number;\n firstPassRate: number;\n}\n\n/** Classify one logical Case using the retry evidence available to its caller. */\nexport const classifyTestRunCase = (\n testCase: TestRunHealthCase,\n): TestRunCaseHealthStatus => {\n if (testCase.status === 'not-run') return 'not-run';\n if (testCase.status === 'failed') return 'failed';\n const attempts =\n testCase.attempts ?? (testCase.run ? [testCase.run] : ([] as const));\n return (testCase.retryCount ?? 0) > 0 ||\n (attempts.at(-1)?.attemptIndex ?? 0) > 0 ||\n attempts.length > 1 ||\n attempts[0]?.status === 'failed'\n ? 'retry-passed'\n : 'passed';\n};\n\nexport const calculateTestRunHealth = (\n cases: readonly TestRunHealthCase[],\n): TestRunHealth => {\n let passed = 0;\n let failed = 0;\n let notRun = 0;\n let firstPassed = 0;\n let passedAfterRetry = 0;\n\n for (const testCase of cases) {\n switch (classifyTestRunCase(testCase)) {\n case 'passed':\n passed += 1;\n firstPassed += 1;\n break;\n case 'retry-passed':\n passed += 1;\n passedAfterRetry += 1;\n break;\n case 'failed':\n failed += 1;\n break;\n case 'not-run':\n notRun += 1;\n break;\n }\n }\n\n const total = cases.length;\n const executed = total - notRun;\n return {\n total,\n executed,\n passed,\n failed,\n notRun,\n firstPassed,\n passedAfterRetry,\n finalPassRate: executed === 0 ? 0 : passed / executed,\n firstPassRate: executed === 0 ? 0 : firstPassed / executed,\n };\n};\n"],"names":["classifyTestRunCase","testCase","attempts","calculateTestRunHealth","cases","passed","failed","notRun","firstPassed","passedAfterRetry","total","executed"],"mappings":"AAkCO,MAAMA,sBAAsB,CACjCC;IAEA,IAAIA,AAAoB,cAApBA,SAAS,MAAM,EAAgB,OAAO;IAC1C,IAAIA,AAAoB,aAApBA,SAAS,MAAM,EAAe,OAAO;IACzC,MAAMC,WACJD,SAAS,QAAQ,IAAKA,CAAAA,SAAS,GAAG,GAAG;QAACA,SAAS,GAAG;KAAC,GAAI,EAAW,AAAV;IAC1D,OAAQA,AAAAA,CAAAA,SAAS,UAAU,IAAI,KAAK,KACjCC,AAAAA,CAAAA,SAAS,EAAE,CAAC,KAAK,gBAAgB,KAAK,KACvCA,SAAS,MAAM,GAAG,KAClBA,QAAQ,CAAC,EAAE,EAAE,WAAW,WACtB,iBACA;AACN;AAEO,MAAMC,yBAAyB,CACpCC;IAEA,IAAIC,SAAS;IACb,IAAIC,SAAS;IACb,IAAIC,SAAS;IACb,IAAIC,cAAc;IAClB,IAAIC,mBAAmB;IAEvB,KAAK,MAAMR,YAAYG,MACrB,OAAQJ,oBAAoBC;QAC1B,KAAK;YACHI,UAAU;YACVG,eAAe;YACf;QACF,KAAK;YACHH,UAAU;YACVI,oBAAoB;YACpB;QACF,KAAK;YACHH,UAAU;YACV;QACF,KAAK;YACHC,UAAU;YACV;IACJ;IAGF,MAAMG,QAAQN,MAAM,MAAM;IAC1B,MAAMO,WAAWD,QAAQH;IACzB,OAAO;QACLG;QACAC;QACAN;QACAC;QACAC;QACAC;QACAC;QACA,eAAeE,AAAa,MAAbA,WAAiB,IAAIN,SAASM;QAC7C,eAAeA,AAAa,MAAbA,WAAiB,IAAIH,cAAcG;IACpD;AACF"}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
calculateTestRunHealth: ()=>calculateTestRunHealth,
|
|
28
|
-
classifyTestRunCase: ()=>classifyTestRunCase
|
|
29
|
-
});
|
|
30
|
-
const classifyTestRunCase = (testCase)=>{
|
|
31
|
-
if ('not-run' === testCase.status) return 'not-run';
|
|
32
|
-
if ('failed' === testCase.status) return 'failed';
|
|
33
|
-
const attempts = testCase.attempts ?? (testCase.run ? [
|
|
34
|
-
testCase.run
|
|
35
|
-
] : []);
|
|
36
|
-
return (testCase.retryCount ?? 0) > 0 || (attempts.at(-1)?.attemptIndex ?? 0) > 0 || attempts.length > 1 || attempts[0]?.status === 'failed' ? 'retry-passed' : 'passed';
|
|
37
|
-
};
|
|
38
|
-
const calculateTestRunHealth = (cases)=>{
|
|
39
|
-
let passed = 0;
|
|
40
|
-
let failed = 0;
|
|
41
|
-
let notRun = 0;
|
|
42
|
-
let firstPassed = 0;
|
|
43
|
-
let passedAfterRetry = 0;
|
|
44
|
-
for (const testCase of cases)switch(classifyTestRunCase(testCase)){
|
|
45
|
-
case 'passed':
|
|
46
|
-
passed += 1;
|
|
47
|
-
firstPassed += 1;
|
|
48
|
-
break;
|
|
49
|
-
case 'retry-passed':
|
|
50
|
-
passed += 1;
|
|
51
|
-
passedAfterRetry += 1;
|
|
52
|
-
break;
|
|
53
|
-
case 'failed':
|
|
54
|
-
failed += 1;
|
|
55
|
-
break;
|
|
56
|
-
case 'not-run':
|
|
57
|
-
notRun += 1;
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
const total = cases.length;
|
|
61
|
-
const executed = total - notRun;
|
|
62
|
-
return {
|
|
63
|
-
total,
|
|
64
|
-
executed,
|
|
65
|
-
passed,
|
|
66
|
-
failed,
|
|
67
|
-
notRun,
|
|
68
|
-
firstPassed,
|
|
69
|
-
passedAfterRetry,
|
|
70
|
-
finalPassRate: 0 === executed ? 0 : passed / executed,
|
|
71
|
-
firstPassRate: 0 === executed ? 0 : firstPassed / executed
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
exports.calculateTestRunHealth = __webpack_exports__.calculateTestRunHealth;
|
|
75
|
-
exports.classifyTestRunCase = __webpack_exports__.classifyTestRunCase;
|
|
76
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
77
|
-
"calculateTestRunHealth",
|
|
78
|
-
"classifyTestRunCase"
|
|
79
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
80
|
-
Object.defineProperty(exports, '__esModule', {
|
|
81
|
-
value: true
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
//# sourceMappingURL=test-run-health.js.map
|