@midscene/web 1.3.4 → 1.3.5-beta-20260130032421.0
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/bin.mjs +1 -3
- package/dist/es/bin.mjs.map +1 -1
- package/dist/es/bridge-mode/io-client.mjs +1 -1
- package/dist/es/bridge-mode/io-server.mjs +2 -2
- package/dist/es/bridge-mode/io-server.mjs.map +1 -1
- package/dist/es/bridge-mode/page-browser-side.mjs +1 -1
- package/dist/es/bridge-mode/page-browser-side.mjs.map +1 -1
- package/dist/es/mcp-server.mjs +1 -1
- package/dist/es/mcp-tools.mjs +2 -3
- package/dist/es/mcp-tools.mjs.map +1 -1
- package/dist/es/playwright/ai-fixture.mjs +21 -3
- package/dist/es/playwright/ai-fixture.mjs.map +1 -1
- package/dist/es/playwright/reporter/index.mjs +45 -9
- package/dist/es/playwright/reporter/index.mjs.map +1 -1
- package/dist/es/static/static-page.mjs +6 -2
- package/dist/es/static/static-page.mjs.map +1 -1
- package/dist/lib/bin.js +1 -3
- package/dist/lib/bin.js.map +1 -1
- package/dist/lib/bridge-mode/io-client.js +1 -1
- package/dist/lib/bridge-mode/io-server.js +2 -2
- package/dist/lib/bridge-mode/io-server.js.map +1 -1
- package/dist/lib/bridge-mode/page-browser-side.js +1 -1
- package/dist/lib/bridge-mode/page-browser-side.js.map +1 -1
- package/dist/lib/mcp-server.js +1 -1
- package/dist/lib/mcp-tools.js +1 -2
- package/dist/lib/mcp-tools.js.map +1 -1
- package/dist/lib/playwright/ai-fixture.js +21 -3
- package/dist/lib/playwright/ai-fixture.js.map +1 -1
- package/dist/lib/playwright/reporter/index.js +42 -6
- package/dist/lib/playwright/reporter/index.js.map +1 -1
- package/dist/lib/static/static-page.js +6 -2
- package/dist/lib/static/static-page.js.map +1 -1
- package/dist/types/playwright/reporter/index.d.ts +4 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwright/reporter/index.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../src/playwright/reporter/index.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 { readFileSync, rmSync } from 'node:fs';\nimport type { ReportDumpWithAttributes } from '@midscene/core';\nimport { getReportFileName, printReportMsg } from '@midscene/core/agent';\nimport { writeDumpReport } from '@midscene/core/utils';\nimport { replaceIllegalPathCharsAndSpace } from '@midscene/shared/utils';\nimport type {\n FullConfig,\n Reporter,\n Suite,\n TestCase,\n TestResult,\n} from '@playwright/test/reporter';\n\ninterface MidsceneReporterOptions {\n type?: 'merged' | 'separate';\n}\n\nclass MidsceneReporter implements Reporter {\n private mergedFilename?: string;\n private testTitleToFilename = new Map<string, string>();\n mode?: 'merged' | 'separate';\n\n // Track all temp files created during this test run for cleanup\n private tempFiles = new Set<string>();\n\n // Track whether we have multiple projects (browsers)\n private hasMultipleProjects = false;\n\n constructor(options: MidsceneReporterOptions = {}) {\n // Set mode from constructor options (official Playwright way)\n this.mode = MidsceneReporter.getMode(options.type ?? 'merged');\n }\n\n private static getMode(reporterType: string): 'merged' | 'separate' {\n if (!reporterType) {\n return 'merged';\n }\n if (reporterType !== 'merged' && reporterType !== 'separate') {\n throw new Error(\n `Unknown reporter type in playwright config: ${reporterType}, only support 'merged' or 'separate'`,\n );\n }\n return reporterType;\n }\n\n private getSeparatedFilename(testTitle: string): string {\n if (!this.testTitleToFilename.has(testTitle)) {\n const baseTag = `playwright-${replaceIllegalPathCharsAndSpace(testTitle)}`;\n const generatedFilename = getReportFileName(baseTag);\n this.testTitleToFilename.set(testTitle, generatedFilename);\n }\n return this.testTitleToFilename.get(testTitle)!;\n }\n\n private getReportFilename(testTitle?: string): string {\n if (this.mode === 'merged') {\n if (!this.mergedFilename) {\n this.mergedFilename = getReportFileName('playwright-merged');\n }\n return this.mergedFilename;\n } else if (this.mode === 'separate') {\n if (!testTitle) throw new Error('testTitle is required in separate mode');\n return this.getSeparatedFilename(testTitle);\n }\n throw new Error(`Unknown mode: ${this.mode}`);\n }\n\n private updateReport(testData: ReportDumpWithAttributes) {\n if (!testData || !this.mode) return;\n const fileName = this.getReportFilename(\n testData.attributes?.playwright_test_title,\n );\n const reportPath = writeDumpReport(\n fileName,\n testData,\n this.mode === 'merged',\n );\n reportPath && printReportMsg(reportPath);\n }\n\n async onBegin(config: FullConfig, suite: Suite) {\n // Check if we have multiple projects to determine if we need browser labels\n this.hasMultipleProjects = (config.projects?.length || 0) > 1;\n }\n\n onTestBegin(_test: TestCase, _result: TestResult) {\n // logger(`Starting test ${test.title}`);\n }\n\n onTestEnd(test: TestCase, result: TestResult) {\n const dumpAnnotation = test.annotations.find((annotation) => {\n return annotation.type === 'MIDSCENE_DUMP_ANNOTATION';\n });\n if (!dumpAnnotation?.description) return;\n\n const tempFilePath = dumpAnnotation.description;\n\n // Track this temp file for potential cleanup in onEnd\n this.tempFiles.add(tempFilePath);\n\n let dumpString: string | undefined;\n\n try {\n dumpString = readFileSync(tempFilePath, 'utf-8');\n } catch (error) {\n console.error(\n `Failed to read Midscene dump file: ${tempFilePath}`,\n error,\n );\n // Don't return here - we still need to clean up the temp file\n }\n\n // Only update report if we successfully read the dump\n if (dumpString) {\n const retry = result.retry ? `(retry #${result.retry})` : '';\n const testId = `${test.id}${retry}`;\n\n // Get the project name (browser name) only if we have multiple projects\n const projectName = this.hasMultipleProjects\n ? test.parent?.project()?.name\n : undefined;\n const projectSuffix = projectName ? ` [${projectName}]` : '';\n\n const testData: ReportDumpWithAttributes = {\n dumpString,\n attributes: {\n playwright_test_id: testId,\n playwright_test_title: `${test.title}${projectSuffix}${retry}`,\n playwright_test_status: result.status,\n playwright_test_duration: result.duration,\n },\n };\n\n this.updateReport(testData);\n }\n\n // Always try to clean up temp file\n try {\n rmSync(tempFilePath, { force: true });\n // If successfully deleted, remove from tracking\n this.tempFiles.delete(tempFilePath);\n } catch (error) {\n console.warn(\n `Failed to delete Midscene temp file: ${tempFilePath}`,\n error,\n );\n // Keep in tempFiles for cleanup in onEnd\n }\n }\n\n onEnd() {\n // Clean up any remaining temp files that weren't deleted in onTestEnd\n if (this.tempFiles.size > 0) {\n console.log(\n `Midscene: Cleaning up ${this.tempFiles.size} remaining temp file(s)...`,\n );\n\n for (const filePath of this.tempFiles) {\n try {\n rmSync(filePath, { force: true });\n } catch (error) {\n // Silently ignore - file may have been deleted already\n }\n }\n\n this.tempFiles.clear();\n }\n }\n}\n\nexport default MidsceneReporter;\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","MidsceneReporter","reporterType","Error","testTitle","baseTag","replaceIllegalPathCharsAndSpace","generatedFilename","getReportFileName","testData","fileName","reportPath","writeDumpReport","printReportMsg","config","suite","_test","_result","test","result","dumpAnnotation","annotation","tempFilePath","dumpString","readFileSync","error","console","retry","testId","projectName","undefined","projectSuffix","rmSync","filePath","options","Map","Set"],"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;;;IC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Ac,CAAC,EAAE,EAAEA,YAAY,CAAC,CAAC,GAAG;YAE1D,MAAMpB,WAAqC;gBACzCc;gBACA,YAAY;oBACV,oBAAoBK;oBACpB,uBAAuB,GAAGV,KAAK,KAAK,GAAGa,gBAAgBJ,OAAO;oBAC9D,wBAAwBR,OAAO,MAAM;oBACrC,0BAA0BA,OAAO,QAAQ;gBAC3C;YACF;YAEA,IAAI,CAAC,YAAY,CAACV;QACpB;QAGA,IAAI;YACFuB,IAAAA,iCAAAA,MAAAA,AAAAA,EAAOV,cAAc;gBAAE,OAAO;YAAK;YAEnC,IAAI,CAAC,SAAS,CAAC,MAAM,CAACA;QACxB,EAAE,OAAOG,OAAO;YACdC,QAAQ,IAAI,CACV,CAAC,qCAAqC,EAAEJ,cAAc,EACtDG;QAGJ;IACF;IAEA,QAAQ;QAEN,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,GAAG;YAC3BC,QAAQ,GAAG,CACT,CAAC,sBAAsB,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,0BAA0B,CAAC;YAG1E,KAAK,MAAMO,YAAY,IAAI,CAAC,SAAS,CACnC,IAAI;gBACFD,IAAAA,iCAAAA,MAAAA,AAAAA,EAAOC,UAAU;oBAAE,OAAO;gBAAK;YACjC,EAAE,OAAOR,OAAO,CAEhB;YAGF,IAAI,CAAC,SAAS,CAAC,KAAK;QACtB;IACF;IA3IA,YAAYS,UAAmC,CAAC,CAAC,CAAE;QAVnD,uBAAQ,kBAAR;QACA,uBAAQ,uBAAsB,IAAIC;QAClC;QAGA,uBAAQ,aAAY,IAAIC;QAGxB,uBAAQ,uBAAsB;QAI5B,IAAI,CAAC,IAAI,GAAGnC,iBAAiB,OAAO,CAACiC,QAAQ,IAAI,IAAI;IACvD;AAyIF;AAEA,iBAAejC"}
|
|
1
|
+
{"version":3,"file":"playwright/reporter/index.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../src/playwright/reporter/index.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 { readFileSync, rmSync, writeFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport type { ReportDumpWithAttributes } from '@midscene/core';\nimport { getReportFileName, printReportMsg } from '@midscene/core/agent';\nimport { getReportTpl } from '@midscene/core/utils';\nimport { getMidsceneRunSubDir } from '@midscene/shared/common';\nimport {\n escapeScriptTag,\n replaceIllegalPathCharsAndSpace,\n} from '@midscene/shared/utils';\nimport type {\n FullConfig,\n Reporter,\n Suite,\n TestCase,\n TestResult,\n} from '@playwright/test/reporter';\n\ninterface MidsceneReporterOptions {\n type?: 'merged' | 'separate';\n}\n\nclass MidsceneReporter implements Reporter {\n private mergedFilename?: string;\n private testTitleToFilename = new Map<string, string>();\n mode?: 'merged' | 'separate';\n\n // Track all temp files created during this test run for cleanup\n private tempFiles = new Set<string>();\n\n // Track pending report updates\n private pendingReports = new Set<Promise<void>>();\n\n // Track whether the merged report file has been initialized\n private mergedReportInitialized = false;\n\n // Write queue to serialize file writes and prevent concurrent write conflicts\n private writeQueue: Promise<void> = Promise.resolve();\n\n // Track whether we have multiple projects (browsers)\n private hasMultipleProjects = false;\n\n constructor(options: MidsceneReporterOptions = {}) {\n // Set mode from constructor options (official Playwright way)\n this.mode = MidsceneReporter.getMode(options.type ?? 'merged');\n }\n\n private static getMode(reporterType: string): 'merged' | 'separate' {\n if (!reporterType) {\n return 'merged';\n }\n if (reporterType !== 'merged' && reporterType !== 'separate') {\n throw new Error(\n `Unknown reporter type in playwright config: ${reporterType}, only support 'merged' or 'separate'`,\n );\n }\n return reporterType;\n }\n\n private getSeparatedFilename(testTitle: string): string {\n if (!this.testTitleToFilename.has(testTitle)) {\n const baseTag = `playwright-${replaceIllegalPathCharsAndSpace(testTitle)}`;\n const generatedFilename = getReportFileName(baseTag);\n this.testTitleToFilename.set(testTitle, generatedFilename);\n }\n return this.testTitleToFilename.get(testTitle)!;\n }\n\n private getReportFilename(testTitle?: string): string {\n if (this.mode === 'merged') {\n if (!this.mergedFilename) {\n this.mergedFilename = getReportFileName('playwright-merged');\n }\n return this.mergedFilename;\n } else if (this.mode === 'separate') {\n if (!testTitle) throw new Error('testTitle is required in separate mode');\n return this.getSeparatedFilename(testTitle);\n }\n throw new Error(`Unknown mode: ${this.mode}`);\n }\n\n private async updateReport(testData: ReportDumpWithAttributes) {\n if (!testData || !this.mode) return;\n\n // Queue the write operation to prevent concurrent writes to the same file\n this.writeQueue = this.writeQueue.then(async () => {\n const fileName = this.getReportFilename(\n testData.attributes?.playwright_test_title,\n );\n\n const reportPath = join(\n getMidsceneRunSubDir('report'),\n `${fileName}.html`,\n );\n\n // Get report template\n const tpl = getReportTpl();\n if (!tpl) {\n console.warn('reportTpl is not set, will not write report');\n return;\n }\n\n // Parse the dump string (which already contains inline screenshots)\n // and generate dump script tag\n let dumpScript = `<script type=\"midscene_web_dump\">\\n${escapeScriptTag(testData.dumpString)}\\n</script>`;\n\n // Add attributes to the dump script if this is merged report\n if (this.mode === 'merged' && testData.attributes) {\n const attributesArr = Object.keys(testData.attributes).map((key) => {\n return `${key}=\"${encodeURIComponent(testData.attributes![key])}\"`;\n });\n // Add attributes to the script tag\n dumpScript = dumpScript.replace(\n '<script type=\"midscene_web_dump\"',\n `<script type=\"midscene_web_dump\" ${attributesArr.join(' ')}`,\n );\n }\n\n // Write or append to file\n if (this.mode === 'merged') {\n // For merged report, write template + dump on first write, then only append dumps\n if (!this.mergedReportInitialized) {\n writeFileSync(reportPath, tpl + dumpScript, { flag: 'w' });\n this.mergedReportInitialized = true;\n } else {\n // Append only the dump scripts for subsequent tests\n writeFileSync(reportPath, dumpScript, { flag: 'a' });\n }\n } else {\n // For separate reports, write each test to its own file with template\n writeFileSync(reportPath, tpl + dumpScript, { flag: 'w' });\n }\n\n printReportMsg(reportPath);\n });\n\n await this.writeQueue;\n }\n\n async onBegin(config: FullConfig, suite: Suite) {\n // Check if we have multiple projects to determine if we need browser labels\n this.hasMultipleProjects = (config.projects?.length || 0) > 1;\n }\n\n onTestBegin(_test: TestCase, _result: TestResult) {\n // logger(`Starting test ${test.title}`);\n }\n\n onTestEnd(test: TestCase, result: TestResult) {\n const dumpAnnotation = test.annotations.find((annotation) => {\n return annotation.type === 'MIDSCENE_DUMP_ANNOTATION';\n });\n if (!dumpAnnotation?.description) return;\n\n const tempFilePath = dumpAnnotation.description;\n\n // Track this temp file for potential cleanup in onEnd\n this.tempFiles.add(tempFilePath);\n\n let dumpString: string | undefined;\n\n try {\n dumpString = readFileSync(tempFilePath, 'utf-8');\n } catch (error) {\n console.error(\n `Failed to read Midscene dump file: ${tempFilePath}`,\n error,\n );\n // Don't return here - we still need to clean up the temp file\n }\n\n // Only update report if we successfully read the dump\n if (dumpString) {\n const retry = result.retry ? `(retry #${result.retry})` : '';\n const testId = `${test.id}${retry}`;\n\n // Get the project name (browser name) only if we have multiple projects\n const projectName = this.hasMultipleProjects\n ? test.parent?.project()?.name\n : undefined;\n const projectSuffix = projectName ? ` [${projectName}]` : '';\n\n const testData: ReportDumpWithAttributes = {\n dumpString,\n attributes: {\n playwright_test_id: testId,\n playwright_test_title: `${test.title}${projectSuffix}${retry}`,\n playwright_test_status: result.status,\n playwright_test_duration: result.duration,\n },\n };\n\n // Start async report update and track it\n const reportPromise = this.updateReport(testData)\n .catch((error) => {\n console.error('Error updating report:', error);\n })\n .finally(() => {\n this.pendingReports.delete(reportPromise);\n });\n this.pendingReports.add(reportPromise);\n }\n\n // Always try to clean up temp file\n try {\n rmSync(tempFilePath, { force: true });\n // If successfully deleted, remove from tracking\n this.tempFiles.delete(tempFilePath);\n } catch (error) {\n console.warn(\n `Failed to delete Midscene temp file: ${tempFilePath}`,\n error,\n );\n // Keep in tempFiles for cleanup in onEnd\n }\n }\n\n async onEnd() {\n // Wait for all pending report updates to complete\n if (this.pendingReports.size > 0) {\n console.log(\n `Midscene: Waiting for ${this.pendingReports.size} pending report(s) to complete...`,\n );\n await Promise.all(Array.from(this.pendingReports));\n }\n\n // Clean up any remaining temp files that weren't deleted in onTestEnd\n if (this.tempFiles.size > 0) {\n console.log(\n `Midscene: Cleaning up ${this.tempFiles.size} remaining temp file(s)...`,\n );\n\n for (const filePath of this.tempFiles) {\n try {\n rmSync(filePath, { force: true });\n } catch (error) {\n // Silently ignore - file may have been deleted already\n }\n }\n\n this.tempFiles.clear();\n }\n }\n}\n\nexport default MidsceneReporter;\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","MidsceneReporter","reporterType","Error","testTitle","baseTag","replaceIllegalPathCharsAndSpace","generatedFilename","getReportFileName","testData","fileName","reportPath","join","getMidsceneRunSubDir","tpl","getReportTpl","console","dumpScript","escapeScriptTag","attributesArr","encodeURIComponent","writeFileSync","printReportMsg","config","suite","_test","_result","test","result","dumpAnnotation","annotation","tempFilePath","dumpString","readFileSync","error","retry","testId","projectName","undefined","projectSuffix","reportPromise","rmSync","Promise","Array","filePath","options","Map","Set"],"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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BAAR;QACA,uBAAQ,uBAAsB,IAAIC;QAClC;QAGA,uBAAQ,aAAY,IAAIC;QAGxB,uBAAQ,kBAAiB,IAAIA;QAG7B,uBAAQ,2BAA0B;QAGlC,uBAAQ,cAA4BL,QAAQ,OAAO;QAGnD,uBAAQ,uBAAsB;QAI5B,IAAI,CAAC,IAAI,GAAGzC,iBAAiB,OAAO,CAAC4C,QAAQ,IAAI,IAAI;IACvD;AAsMF;AAEA,iBAAe5C"}
|
|
@@ -90,9 +90,13 @@ class StaticPage {
|
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
92
|
async screenshotBase64() {
|
|
93
|
-
if ('screenshot' in this.uiContext && this.uiContext.screenshot)
|
|
93
|
+
if ('screenshot' in this.uiContext && this.uiContext.screenshot) {
|
|
94
|
+
const screenshot = this.uiContext.screenshot;
|
|
95
|
+
if ('object' == typeof screenshot && 'base64' in screenshot) return screenshot.base64;
|
|
96
|
+
return screenshot;
|
|
97
|
+
}
|
|
94
98
|
const legacyContext = this.uiContext;
|
|
95
|
-
|
|
99
|
+
const base64 = legacyContext.screenshotBase64;
|
|
96
100
|
if (!base64) throw new Error('screenshot base64 is empty');
|
|
97
101
|
return base64;
|
|
98
102
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static/static-page.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../src/static/static-page.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 type { DeviceAction, Point, UIContext } from '@midscene/core';\nimport type { AbstractInterface } from '@midscene/core/device';\nimport { ScreenshotItem } from '@midscene/core';\nimport {\n defineActionDragAndDrop,\n defineActionHover,\n defineActionInput,\n defineActionKeyboardPress,\n defineActionRightClick,\n defineActionScroll,\n defineActionTap,\n} from '@midscene/core/device';\nimport { ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED } from '@midscene/shared/common';\n\ntype WebUIContext = UIContext | {\n screenshotBase64?: string;\n size: { width: number; height: number; dpr?: number };\n};\n\nconst ThrowNotImplemented = (methodName: string) => {\n throw new Error(\n `The method \"${methodName}\" is not implemented as designed since this is a static UI context. (${ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED})`,\n );\n};\n\nexport default class StaticPage implements AbstractInterface {\n interfaceType = 'static';\n\n private uiContext: WebUIContext;\n\n constructor(uiContext: WebUIContext) {\n this.uiContext = uiContext;\n }\n\n actionSpace(): DeviceAction[] {\n // Return available actions for static page - they will throw \"not implemented\" errors when executed\n // but need to be available for planning phase\n return [\n defineActionTap(async (param) => {\n ThrowNotImplemented('Tap');\n }),\n defineActionRightClick(async (param) => {\n ThrowNotImplemented('RightClick');\n }),\n defineActionHover(async (param) => {\n ThrowNotImplemented('Hover');\n }),\n defineActionInput(async (param) => {\n ThrowNotImplemented('Input');\n }),\n defineActionKeyboardPress(async (param) => {\n ThrowNotImplemented('KeyboardPress');\n }),\n defineActionScroll(async (param) => {\n ThrowNotImplemented('Scroll');\n }),\n defineActionDragAndDrop(async (param) => {\n ThrowNotImplemented('DragAndDrop');\n }),\n ];\n }\n\n async evaluateJavaScript<T = unknown>(script: string): Promise<T> {\n return ThrowNotImplemented('evaluateJavaScript');\n }\n\n // @deprecated\n async getElementsInfo() {\n return ThrowNotImplemented('getElementsInfo');\n }\n\n async getElementsNodeTree() {\n return ThrowNotImplemented('getElementsNodeTree');\n }\n\n async getXpathsByPoint(point: Point) {\n return ThrowNotImplemented('getXpathsByPoint');\n }\n\n async getElementInfoByXpath(xpath: string) {\n return ThrowNotImplemented('getElementInfoByXpath');\n }\n\n async size() {\n return {\n ...this.uiContext.size,\n dpr: this.uiContext.size.dpr || 1,\n };\n }\n\n async screenshotBase64() {\n // Check if this is a UIContext with screenshot property\n if ('screenshot' in this.uiContext && this.uiContext.screenshot) {\n
|
|
1
|
+
{"version":3,"file":"static/static-page.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../src/static/static-page.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 type { DeviceAction, Point, UIContext } from '@midscene/core';\nimport type { AbstractInterface } from '@midscene/core/device';\nimport { ScreenshotItem } from '@midscene/core';\nimport {\n defineActionDragAndDrop,\n defineActionHover,\n defineActionInput,\n defineActionKeyboardPress,\n defineActionRightClick,\n defineActionScroll,\n defineActionTap,\n} from '@midscene/core/device';\nimport { ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED } from '@midscene/shared/common';\n\ntype WebUIContext = UIContext | {\n screenshotBase64?: string;\n size: { width: number; height: number; dpr?: number };\n};\n\nconst ThrowNotImplemented = (methodName: string) => {\n throw new Error(\n `The method \"${methodName}\" is not implemented as designed since this is a static UI context. (${ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED})`,\n );\n};\n\nexport default class StaticPage implements AbstractInterface {\n interfaceType = 'static';\n\n private uiContext: WebUIContext;\n\n constructor(uiContext: WebUIContext) {\n this.uiContext = uiContext;\n }\n\n actionSpace(): DeviceAction[] {\n // Return available actions for static page - they will throw \"not implemented\" errors when executed\n // but need to be available for planning phase\n return [\n defineActionTap(async (param) => {\n ThrowNotImplemented('Tap');\n }),\n defineActionRightClick(async (param) => {\n ThrowNotImplemented('RightClick');\n }),\n defineActionHover(async (param) => {\n ThrowNotImplemented('Hover');\n }),\n defineActionInput(async (param) => {\n ThrowNotImplemented('Input');\n }),\n defineActionKeyboardPress(async (param) => {\n ThrowNotImplemented('KeyboardPress');\n }),\n defineActionScroll(async (param) => {\n ThrowNotImplemented('Scroll');\n }),\n defineActionDragAndDrop(async (param) => {\n ThrowNotImplemented('DragAndDrop');\n }),\n ];\n }\n\n async evaluateJavaScript<T = unknown>(script: string): Promise<T> {\n return ThrowNotImplemented('evaluateJavaScript');\n }\n\n // @deprecated\n async getElementsInfo() {\n return ThrowNotImplemented('getElementsInfo');\n }\n\n async getElementsNodeTree() {\n return ThrowNotImplemented('getElementsNodeTree');\n }\n\n async getXpathsByPoint(point: Point) {\n return ThrowNotImplemented('getXpathsByPoint');\n }\n\n async getElementInfoByXpath(xpath: string) {\n return ThrowNotImplemented('getElementInfoByXpath');\n }\n\n async size() {\n return {\n ...this.uiContext.size,\n dpr: this.uiContext.size.dpr || 1,\n };\n }\n\n async screenshotBase64() {\n // Check if this is a UIContext with screenshot property\n if ('screenshot' in this.uiContext && this.uiContext.screenshot) {\n const screenshot = this.uiContext.screenshot;\n if (typeof screenshot === 'object' && 'base64' in screenshot) {\n return (screenshot as { base64: string }).base64;\n }\n return screenshot as unknown as string;\n }\n\n // Check legacy screenshotBase64 field\n const legacyContext = this.uiContext as { screenshotBase64?: string };\n const base64 = legacyContext.screenshotBase64;\n\n if (!base64) {\n throw new Error('screenshot base64 is empty');\n }\n return base64;\n }\n\n async url() {\n return Promise.resolve('https://static_page_without_url');\n }\n\n async scrollUntilTop(startingPoint?: Point) {\n return ThrowNotImplemented('scrollUntilTop');\n }\n\n async scrollUntilBottom(startingPoint?: Point) {\n return ThrowNotImplemented('scrollUntilBottom');\n }\n\n async scrollUntilLeft(startingPoint?: Point) {\n return ThrowNotImplemented('scrollUntilLeft');\n }\n\n async scrollUntilRight(startingPoint?: Point) {\n return ThrowNotImplemented('scrollUntilRight');\n }\n\n async scrollUp(distance?: number, startingPoint?: Point) {\n return ThrowNotImplemented('scrollUp');\n }\n\n async scrollDown(distance?: number, startingPoint?: Point) {\n return ThrowNotImplemented('scrollDown');\n }\n\n async scrollLeft(distance?: number, startingPoint?: Point) {\n return ThrowNotImplemented('scrollLeft');\n }\n\n async scrollRight(distance?: number, startingPoint?: Point) {\n return ThrowNotImplemented('scrollRight');\n }\n\n async clearInput() {\n return ThrowNotImplemented('clearInput');\n }\n\n mouse = {\n click: ThrowNotImplemented.bind(null, 'mouse.click'),\n wheel: ThrowNotImplemented.bind(null, 'mouse.wheel'),\n move: ThrowNotImplemented.bind(null, 'mouse.move'),\n drag: ThrowNotImplemented.bind(null, 'mouse.drag'),\n };\n\n keyboard = {\n type: ThrowNotImplemented.bind(null, 'keyboard.type'),\n press: ThrowNotImplemented.bind(null, 'keyboard.press'),\n };\n\n async destroy(): Promise<void> {\n //\n }\n\n async getContext(): Promise<UIContext> {\n // If the context already has a screenshot property, return it as-is\n if ('screenshot' in this.uiContext && this.uiContext.screenshot) {\n return this.uiContext as UIContext;\n }\n\n // Otherwise, create a proper UIContext from the legacy format\n const screenshotBase64 = await this.screenshotBase64();\n const screenshot = ScreenshotItem.create(screenshotBase64);\n const size = await this.size();\n\n return {\n screenshot,\n size,\n };\n }\n\n updateContext(newContext: WebUIContext): void {\n this.uiContext = newContext;\n }\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","ThrowNotImplemented","methodName","Error","ERROR_CODE_NOT_IMPLEMENTED_AS_DESIGNED","StaticPage","defineActionTap","param","defineActionRightClick","defineActionHover","defineActionInput","defineActionKeyboardPress","defineActionScroll","defineActionDragAndDrop","script","point","xpath","screenshot","legacyContext","base64","Promise","startingPoint","distance","screenshotBase64","ScreenshotItem","size","newContext","uiContext"],"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;;;;;;;;;;;;;;;;;;;;ACaA,MAAMI,sBAAsB,CAACC;IAC3B,MAAM,IAAIC,MACR,CAAC,YAAY,EAAED,WAAW,qEAAqE,EAAEE,uBAAAA,sCAAsCA,CAAC,CAAC,CAAC;AAE9I;AAEe,MAAMC;IASnB,cAA8B;QAG5B,OAAO;YACLC,IAAAA,uBAAAA,eAAAA,AAAAA,EAAgB,OAAOC;gBACrBN,oBAAoB;YACtB;YACAO,IAAAA,uBAAAA,sBAAAA,AAAAA,EAAuB,OAAOD;gBAC5BN,oBAAoB;YACtB;YACAQ,IAAAA,uBAAAA,iBAAAA,AAAAA,EAAkB,OAAOF;gBACvBN,oBAAoB;YACtB;YACAS,IAAAA,uBAAAA,iBAAAA,AAAAA,EAAkB,OAAOH;gBACvBN,oBAAoB;YACtB;YACAU,IAAAA,uBAAAA,yBAAAA,AAAAA,EAA0B,OAAOJ;gBAC/BN,oBAAoB;YACtB;YACAW,IAAAA,uBAAAA,kBAA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|
|
|
7
7
|
private testTitleToFilename;
|
|
8
8
|
mode?: 'merged' | 'separate';
|
|
9
9
|
private tempFiles;
|
|
10
|
+
private pendingReports;
|
|
11
|
+
private mergedReportInitialized;
|
|
12
|
+
private writeQueue;
|
|
10
13
|
private hasMultipleProjects;
|
|
11
14
|
constructor(options?: MidsceneReporterOptions);
|
|
12
15
|
private static getMode;
|
|
@@ -16,6 +19,6 @@ declare class MidsceneReporter implements Reporter {
|
|
|
16
19
|
onBegin(config: FullConfig, suite: Suite): Promise<void>;
|
|
17
20
|
onTestBegin(_test: TestCase, _result: TestResult): void;
|
|
18
21
|
onTestEnd(test: TestCase, result: TestResult): void;
|
|
19
|
-
onEnd(): void
|
|
22
|
+
onEnd(): Promise<void>;
|
|
20
23
|
}
|
|
21
24
|
export default MidsceneReporter;
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"Browser use",
|
|
9
9
|
"Android use"
|
|
10
10
|
],
|
|
11
|
-
"version": "1.3.
|
|
11
|
+
"version": "1.3.5-beta-20260130032421.0",
|
|
12
12
|
"repository": "https://github.com/web-infra-dev/midscene",
|
|
13
13
|
"homepage": "https://midscenejs.com/",
|
|
14
14
|
"main": "./dist/lib/index.js",
|
|
@@ -108,9 +108,9 @@
|
|
|
108
108
|
"http-server": "14.1.1",
|
|
109
109
|
"socket.io": "^4.8.1",
|
|
110
110
|
"socket.io-client": "4.8.1",
|
|
111
|
-
"@midscene/core": "1.3.
|
|
112
|
-
"@midscene/shared": "1.3.
|
|
113
|
-
"@midscene/playground": "1.3.
|
|
111
|
+
"@midscene/core": "1.3.5-beta-20260130032421.0",
|
|
112
|
+
"@midscene/shared": "1.3.5-beta-20260130032421.0",
|
|
113
|
+
"@midscene/playground": "1.3.5-beta-20260130032421.0"
|
|
114
114
|
},
|
|
115
115
|
"devDependencies": {
|
|
116
116
|
"@playwright/test": "^1.44.1",
|