@donggui/web 1.5.5-donggui.3
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/README.md +9 -0
- package/bin/midscene-playground +3 -0
- package/bin/midscene-web +2 -0
- package/dist/es/bin.mjs +23 -0
- package/dist/es/bin.mjs.map +1 -0
- package/dist/es/bridge-mode/agent-cli-side.mjs +137 -0
- package/dist/es/bridge-mode/agent-cli-side.mjs.map +1 -0
- package/dist/es/bridge-mode/browser.mjs +2 -0
- package/dist/es/bridge-mode/common.mjs +43 -0
- package/dist/es/bridge-mode/common.mjs.map +1 -0
- package/dist/es/bridge-mode/index.mjs +4 -0
- package/dist/es/bridge-mode/io-client.mjs +101 -0
- package/dist/es/bridge-mode/io-client.mjs.map +1 -0
- package/dist/es/bridge-mode/io-server.mjs +210 -0
- package/dist/es/bridge-mode/io-server.mjs.map +1 -0
- package/dist/es/bridge-mode/page-browser-side.mjs +118 -0
- package/dist/es/bridge-mode/page-browser-side.mjs.map +1 -0
- package/dist/es/chrome-extension/agent.mjs +9 -0
- package/dist/es/chrome-extension/agent.mjs.map +1 -0
- package/dist/es/chrome-extension/cdpInput.mjs +174 -0
- package/dist/es/chrome-extension/cdpInput.mjs.LICENSE.txt +5 -0
- package/dist/es/chrome-extension/cdpInput.mjs.map +1 -0
- package/dist/es/chrome-extension/dynamic-scripts.mjs +38 -0
- package/dist/es/chrome-extension/dynamic-scripts.mjs.map +1 -0
- package/dist/es/chrome-extension/index.mjs +5 -0
- package/dist/es/chrome-extension/page.mjs +651 -0
- package/dist/es/chrome-extension/page.mjs.map +1 -0
- package/dist/es/cli.mjs +16 -0
- package/dist/es/cli.mjs.map +1 -0
- package/dist/es/common/cache-helper.mjs +28 -0
- package/dist/es/common/cache-helper.mjs.map +1 -0
- package/dist/es/index.mjs +6 -0
- package/dist/es/mcp-server.mjs +35 -0
- package/dist/es/mcp-server.mjs.map +1 -0
- package/dist/es/mcp-tools-puppeteer.mjs +215 -0
- package/dist/es/mcp-tools-puppeteer.mjs.map +1 -0
- package/dist/es/mcp-tools.mjs +78 -0
- package/dist/es/mcp-tools.mjs.map +1 -0
- package/dist/es/playwright/ai-fixture.mjs +367 -0
- package/dist/es/playwright/ai-fixture.mjs.map +1 -0
- package/dist/es/playwright/index.mjs +40 -0
- package/dist/es/playwright/index.mjs.map +1 -0
- package/dist/es/playwright/page.mjs +44 -0
- package/dist/es/playwright/page.mjs.map +1 -0
- package/dist/es/playwright/reporter/index.mjs +216 -0
- package/dist/es/playwright/reporter/index.mjs.map +1 -0
- package/dist/es/puppeteer/agent-launcher.mjs +185 -0
- package/dist/es/puppeteer/agent-launcher.mjs.map +1 -0
- package/dist/es/puppeteer/base-page.mjs +564 -0
- package/dist/es/puppeteer/base-page.mjs.map +1 -0
- package/dist/es/puppeteer/index.mjs +34 -0
- package/dist/es/puppeteer/index.mjs.map +1 -0
- package/dist/es/puppeteer/page.mjs +9 -0
- package/dist/es/puppeteer/page.mjs.map +1 -0
- package/dist/es/static/index.mjs +3 -0
- package/dist/es/static/static-agent.mjs +12 -0
- package/dist/es/static/static-agent.mjs.map +1 -0
- package/dist/es/static/static-page.mjs +122 -0
- package/dist/es/static/static-page.mjs.map +1 -0
- package/dist/es/utils.mjs +8 -0
- package/dist/es/utils.mjs.map +1 -0
- package/dist/es/web-element.mjs +59 -0
- package/dist/es/web-element.mjs.map +1 -0
- package/dist/es/web-page.mjs +260 -0
- package/dist/es/web-page.mjs.map +1 -0
- package/dist/lib/bin.js +29 -0
- package/dist/lib/bin.js.map +1 -0
- package/dist/lib/bridge-mode/agent-cli-side.js +174 -0
- package/dist/lib/bridge-mode/agent-cli-side.js.map +1 -0
- package/dist/lib/bridge-mode/browser.js +38 -0
- package/dist/lib/bridge-mode/browser.js.map +1 -0
- package/dist/lib/bridge-mode/common.js +107 -0
- package/dist/lib/bridge-mode/common.js.map +1 -0
- package/dist/lib/bridge-mode/index.js +46 -0
- package/dist/lib/bridge-mode/index.js.map +1 -0
- package/dist/lib/bridge-mode/io-client.js +135 -0
- package/dist/lib/bridge-mode/io-client.js.map +1 -0
- package/dist/lib/bridge-mode/io-server.js +247 -0
- package/dist/lib/bridge-mode/io-server.js.map +1 -0
- package/dist/lib/bridge-mode/page-browser-side.js +162 -0
- package/dist/lib/bridge-mode/page-browser-side.js.map +1 -0
- package/dist/lib/chrome-extension/agent.js +43 -0
- package/dist/lib/chrome-extension/agent.js.map +1 -0
- package/dist/lib/chrome-extension/cdpInput.js +208 -0
- package/dist/lib/chrome-extension/cdpInput.js.LICENSE.txt +5 -0
- package/dist/lib/chrome-extension/cdpInput.js.map +1 -0
- package/dist/lib/chrome-extension/dynamic-scripts.js +88 -0
- package/dist/lib/chrome-extension/dynamic-scripts.js.map +1 -0
- package/dist/lib/chrome-extension/index.js +60 -0
- package/dist/lib/chrome-extension/index.js.map +1 -0
- package/dist/lib/chrome-extension/page.js +685 -0
- package/dist/lib/chrome-extension/page.js.map +1 -0
- package/dist/lib/cli.js +22 -0
- package/dist/lib/cli.js.map +1 -0
- package/dist/lib/common/cache-helper.js +68 -0
- package/dist/lib/common/cache-helper.js.map +1 -0
- package/dist/lib/index.js +60 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/mcp-server.js +75 -0
- package/dist/lib/mcp-server.js.map +1 -0
- package/dist/lib/mcp-tools-puppeteer.js +259 -0
- package/dist/lib/mcp-tools-puppeteer.js.map +1 -0
- package/dist/lib/mcp-tools.js +112 -0
- package/dist/lib/mcp-tools.js.map +1 -0
- package/dist/lib/playwright/ai-fixture.js +404 -0
- package/dist/lib/playwright/ai-fixture.js.map +1 -0
- package/dist/lib/playwright/index.js +93 -0
- package/dist/lib/playwright/index.js.map +1 -0
- package/dist/lib/playwright/page.js +78 -0
- package/dist/lib/playwright/page.js.map +1 -0
- package/dist/lib/playwright/reporter/index.js +250 -0
- package/dist/lib/playwright/reporter/index.js.map +1 -0
- package/dist/lib/puppeteer/agent-launcher.js +253 -0
- package/dist/lib/puppeteer/agent-launcher.js.map +1 -0
- package/dist/lib/puppeteer/base-page.js +607 -0
- package/dist/lib/puppeteer/base-page.js.map +1 -0
- package/dist/lib/puppeteer/index.js +84 -0
- package/dist/lib/puppeteer/index.js.map +1 -0
- package/dist/lib/puppeteer/page.js +43 -0
- package/dist/lib/puppeteer/page.js.map +1 -0
- package/dist/lib/static/index.js +52 -0
- package/dist/lib/static/index.js.map +1 -0
- package/dist/lib/static/static-agent.js +46 -0
- package/dist/lib/static/static-agent.js.map +1 -0
- package/dist/lib/static/static-page.js +156 -0
- package/dist/lib/static/static-page.js.map +1 -0
- package/dist/lib/utils.js +40 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/web-element.js +96 -0
- package/dist/lib/web-element.js.map +1 -0
- package/dist/lib/web-page.js +310 -0
- package/dist/lib/web-page.js.map +1 -0
- package/dist/types/bin.d.ts +1 -0
- package/dist/types/bridge-mode/agent-cli-side.d.ts +49 -0
- package/dist/types/bridge-mode/browser.d.ts +2 -0
- package/dist/types/bridge-mode/common.d.ts +74 -0
- package/dist/types/bridge-mode/index.d.ts +4 -0
- package/dist/types/bridge-mode/io-client.d.ts +10 -0
- package/dist/types/bridge-mode/io-server.d.ts +27 -0
- package/dist/types/bridge-mode/page-browser-side.d.ts +21 -0
- package/dist/types/chrome-extension/agent.d.ts +5 -0
- package/dist/types/chrome-extension/cdpInput.d.ts +52 -0
- package/dist/types/chrome-extension/dynamic-scripts.d.ts +3 -0
- package/dist/types/chrome-extension/index.d.ts +5 -0
- package/dist/types/chrome-extension/page.d.ts +110 -0
- package/dist/types/cli.d.ts +1 -0
- package/dist/types/common/cache-helper.d.ts +20 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/mcp-server.d.ts +26 -0
- package/dist/types/mcp-tools-puppeteer.d.ts +13 -0
- package/dist/types/mcp-tools.d.ts +12 -0
- package/dist/types/playwright/ai-fixture.d.ts +131 -0
- package/dist/types/playwright/index.d.ts +13 -0
- package/dist/types/playwright/page.d.ts +11 -0
- package/dist/types/playwright/reporter/index.d.ts +42 -0
- package/dist/types/puppeteer/agent-launcher.d.ts +61 -0
- package/dist/types/puppeteer/base-page.d.ts +106 -0
- package/dist/types/puppeteer/index.d.ts +10 -0
- package/dist/types/puppeteer/page.d.ts +6 -0
- package/dist/types/static/index.d.ts +2 -0
- package/dist/types/static/static-agent.d.ts +5 -0
- package/dist/types/static/static-page.d.ts +42 -0
- package/dist/types/utils.d.ts +6 -0
- package/dist/types/web-element.d.ts +48 -0
- package/dist/types/web-page.d.ts +62 -0
- package/package.json +166 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
14
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: definition[key]
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
})();
|
|
20
|
+
(()=>{
|
|
21
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
22
|
+
})();
|
|
23
|
+
(()=>{
|
|
24
|
+
__webpack_require__.r = (exports1)=>{
|
|
25
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
|
+
value: 'Module'
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
29
|
+
value: true
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
})();
|
|
33
|
+
var __webpack_exports__ = {};
|
|
34
|
+
__webpack_require__.r(__webpack_exports__);
|
|
35
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
+
PlaywrightAiFixture: ()=>external_ai_fixture_js_namespaceObject.PlaywrightAiFixture,
|
|
37
|
+
PlaywrightWebPage: ()=>external_page_js_namespaceObject.WebPage,
|
|
38
|
+
overrideAIConfig: ()=>env_namespaceObject.overrideAIConfig,
|
|
39
|
+
PlaywrightAgent: ()=>PlaywrightAgent
|
|
40
|
+
});
|
|
41
|
+
const agent_namespaceObject = require("@midscene/core/agent");
|
|
42
|
+
const external_page_js_namespaceObject = require("./page.js");
|
|
43
|
+
const external_ai_fixture_js_namespaceObject = require("./ai-fixture.js");
|
|
44
|
+
const env_namespaceObject = require("@midscene/shared/env");
|
|
45
|
+
const logger_namespaceObject = require("@midscene/shared/logger");
|
|
46
|
+
const external_semver_namespaceObject = require("semver");
|
|
47
|
+
var external_semver_default = /*#__PURE__*/ __webpack_require__.n(external_semver_namespaceObject);
|
|
48
|
+
const base_page_js_namespaceObject = require("../puppeteer/base-page.js");
|
|
49
|
+
const external_utils_js_namespaceObject = require("../utils.js");
|
|
50
|
+
const debug = (0, logger_namespaceObject.getDebug)('playwright:agent');
|
|
51
|
+
function getPlaywrightVersion() {
|
|
52
|
+
try {
|
|
53
|
+
const playwrightPkg = (0, external_utils_js_namespaceObject.getWebpackRequire)()('playwright/package.json');
|
|
54
|
+
return playwrightPkg.version || null;
|
|
55
|
+
} catch (error) {
|
|
56
|
+
console.error('[midscene:error] Failed to get Playwright version', error);
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
class PlaywrightAgent extends agent_namespaceObject.Agent {
|
|
61
|
+
async waitForNetworkIdle(timeout = 1000) {
|
|
62
|
+
await this.page.underlyingPage.waitForLoadState('networkidle', {
|
|
63
|
+
timeout
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
constructor(page, opts){
|
|
67
|
+
if (!page) throw new Error('[midscene] PlaywrightAgent requires a valid Playwright page instance. Please make sure to pass a valid page object.');
|
|
68
|
+
const webPage = new external_page_js_namespaceObject.WebPage(page, opts);
|
|
69
|
+
super(webPage, opts);
|
|
70
|
+
const { forceSameTabNavigation = true, forceChromeSelectRendering } = opts ?? {};
|
|
71
|
+
if (forceSameTabNavigation) (0, base_page_js_namespaceObject.forceClosePopup)(page, debug);
|
|
72
|
+
if (forceChromeSelectRendering) {
|
|
73
|
+
const playwrightVersion = getPlaywrightVersion();
|
|
74
|
+
if (playwrightVersion && !external_semver_default().gte(playwrightVersion, '1.52.0')) console.warn(`[midscene:error] forceChromeSelectRendering requires Playwright >= 1.52.0, but current version is ${playwrightVersion}. This feature may not work correctly.`);
|
|
75
|
+
(0, base_page_js_namespaceObject.forceChromeSelectRendering)(page);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.PlaywrightAgent = __webpack_exports__.PlaywrightAgent;
|
|
80
|
+
exports.PlaywrightAiFixture = __webpack_exports__.PlaywrightAiFixture;
|
|
81
|
+
exports.PlaywrightWebPage = __webpack_exports__.PlaywrightWebPage;
|
|
82
|
+
exports.overrideAIConfig = __webpack_exports__.overrideAIConfig;
|
|
83
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
84
|
+
"PlaywrightAgent",
|
|
85
|
+
"PlaywrightAiFixture",
|
|
86
|
+
"PlaywrightWebPage",
|
|
87
|
+
"overrideAIConfig"
|
|
88
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
89
|
+
Object.defineProperty(exports, '__esModule', {
|
|
90
|
+
value: true
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwright/index.js","sources":["webpack/runtime/compat_get_default_export","webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../src/playwright/index.ts"],"sourcesContent":["// getDefaultExport function for compatibility with non-ESM modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};\n","__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 { Agent as PageAgent } from '@midscene/core/agent';\nimport type { Page as PlaywrightPage } from 'playwright';\nimport { WebPage as PlaywrightWebPage } from './page';\n\nexport type { PlayWrightAiFixtureType } from './ai-fixture';\nexport { PlaywrightAiFixture } from './ai-fixture';\nexport { overrideAIConfig } from '@midscene/shared/env';\nexport { WebPage as PlaywrightWebPage } from './page';\nexport type { WebPageAgentOpt } from '@/web-element';\nimport type { WebPageAgentOpt } from '@/web-element';\nimport { getDebug } from '@midscene/shared/logger';\nimport semver from 'semver';\nimport {\n forceChromeSelectRendering as applyChromeSelectRendering,\n forceClosePopup,\n} from '../puppeteer/base-page';\nimport { getWebpackRequire } from '../utils';\n\nconst debug = getDebug('playwright:agent');\n\n/**\n * Get Playwright version from package.json\n */\nfunction getPlaywrightVersion(): string | null {\n try {\n const playwrightPkg = getWebpackRequire()('playwright/package.json');\n return playwrightPkg.version || null;\n } catch (error) {\n console.error('[midscene:error] Failed to get Playwright version', error);\n return null;\n }\n}\n\nexport class PlaywrightAgent extends PageAgent<PlaywrightWebPage> {\n constructor(page: PlaywrightPage, opts?: WebPageAgentOpt) {\n if (!page) {\n throw new Error(\n '[midscene] PlaywrightAgent requires a valid Playwright page instance. Please make sure to pass a valid page object.',\n );\n }\n const webPage = new PlaywrightWebPage(page, opts);\n super(webPage, opts);\n\n const { forceSameTabNavigation = true, forceChromeSelectRendering } =\n opts ?? {};\n\n if (forceSameTabNavigation) {\n forceClosePopup(page, debug);\n }\n\n if (forceChromeSelectRendering) {\n // Check Playwright version requirement (>= 1.52)\n const playwrightVersion = getPlaywrightVersion();\n if (playwrightVersion && !semver.gte(playwrightVersion, '1.52.0')) {\n console.warn(\n `[midscene:error] forceChromeSelectRendering requires Playwright >= 1.52.0, but current version is ${playwrightVersion}. This feature may not work correctly.`,\n );\n }\n applyChromeSelectRendering(page);\n }\n }\n\n async waitForNetworkIdle(timeout = 1000) {\n await this.page.underlyingPage.waitForLoadState('networkidle', { timeout });\n }\n}\n"],"names":["__webpack_require__","module","getter","definition","key","Object","obj","prop","Symbol","debug","getDebug","getPlaywrightVersion","playwrightPkg","getWebpackRequire","error","console","PlaywrightAgent","PageAgent","timeout","page","opts","Error","webPage","PlaywrightWebPage","forceSameTabNavigation","forceChromeSelectRendering","forceClosePopup","playwrightVersion","semver","applyChromeSelectRendering"],"mappings":";;;IACAA,oBAAoB,CAAC,GAAG,CAACC;QACxB,IAAIC,SAASD,UAAUA,OAAO,UAAU,GACvC,IAAOA,MAAM,CAAC,UAAU,GACxB,IAAOA;QACRD,oBAAoB,CAAC,CAACE,QAAQ;YAAE,GAAGA;QAAO;QAC1C,OAAOA;IACR;;;ICPAF,oBAAoB,CAAC,GAAG,CAAC,UAASG;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGH,oBAAoB,CAAC,CAACG,YAAYC,QAAQ,CAACJ,oBAAoB,CAAC,CAAC,UAASI,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAJ,oBAAoB,CAAC,GAAG,CAACM,KAAKC,OAAUF,OAAO,SAAS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AAAA,0BAAAA,AAAAA,EAA2BV;QAC7B;IACF;AAKF"}
|
|
@@ -0,0 +1,78 @@
|
|
|
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
|
+
WebPage: ()=>WebPage
|
|
28
|
+
});
|
|
29
|
+
const base_page_js_namespaceObject = require("../puppeteer/base-page.js");
|
|
30
|
+
function _define_property(obj, key, value) {
|
|
31
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
32
|
+
value: value,
|
|
33
|
+
enumerable: true,
|
|
34
|
+
configurable: true,
|
|
35
|
+
writable: true
|
|
36
|
+
});
|
|
37
|
+
else obj[key] = value;
|
|
38
|
+
return obj;
|
|
39
|
+
}
|
|
40
|
+
class WebPage extends base_page_js_namespaceObject.Page {
|
|
41
|
+
async registerFileChooserListener(handler) {
|
|
42
|
+
const page = this.underlyingPage;
|
|
43
|
+
let capturedError;
|
|
44
|
+
this.playwrightFileChooserHandler = async (chooser)=>{
|
|
45
|
+
try {
|
|
46
|
+
await handler({
|
|
47
|
+
accept: async (files)=>{
|
|
48
|
+
await chooser.setFiles(files);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
} catch (error) {
|
|
52
|
+
capturedError = error;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
page.on('filechooser', this.playwrightFileChooserHandler);
|
|
56
|
+
return {
|
|
57
|
+
dispose: ()=>{
|
|
58
|
+
if (this.playwrightFileChooserHandler) {
|
|
59
|
+
page.off('filechooser', this.playwrightFileChooserHandler);
|
|
60
|
+
this.playwrightFileChooserHandler = void 0;
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
getError: ()=>capturedError
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
constructor(page, opts){
|
|
67
|
+
super(page, 'playwright', opts), _define_property(this, "playwrightFileChooserHandler", void 0);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.WebPage = __webpack_exports__.WebPage;
|
|
71
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
72
|
+
"WebPage"
|
|
73
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
74
|
+
Object.defineProperty(exports, '__esModule', {
|
|
75
|
+
value: true
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
//# sourceMappingURL=page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwright/page.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../src/playwright/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 { FileChooser, Page as PlaywrightPageType } from 'playwright';\nimport { Page as BasePage } from '../puppeteer/base-page';\nimport type { WebPageOpt } from '../web-element';\n\nexport class WebPage extends BasePage<'playwright', PlaywrightPageType> {\n private playwrightFileChooserHandler?: (\n chooser: FileChooser,\n ) => Promise<void>;\n\n constructor(page: PlaywrightPageType, opts?: WebPageOpt) {\n super(page, 'playwright', opts);\n }\n\n async registerFileChooserListener(\n handler: (\n chooser: import('@midscene/core/device').FileChooserHandler,\n ) => Promise<void>,\n ): Promise<{ dispose: () => void; getError: () => Error | undefined }> {\n const page = this.underlyingPage as PlaywrightPageType;\n\n let capturedError: Error | undefined;\n\n this.playwrightFileChooserHandler = async (chooser: FileChooser) => {\n try {\n await handler({\n accept: async (files: string[]) => {\n await chooser.setFiles(files);\n },\n });\n } catch (error) {\n capturedError = error as Error;\n }\n };\n\n page.on('filechooser', this.playwrightFileChooserHandler);\n\n return {\n dispose: () => {\n if (this.playwrightFileChooserHandler) {\n page.off('filechooser', this.playwrightFileChooserHandler);\n this.playwrightFileChooserHandler = undefined;\n }\n },\n getError: () => capturedError,\n };\n }\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","WebPage","BasePage","handler","page","capturedError","chooser","files","error","undefined","opts"],"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;;;;;;;;;;;;;;;;;;ACFO,MAAMI,gBAAgBC,6BAAAA,IAAQA;IASnC,MAAM,4BACJC,OAEkB,EACmD;QACrE,MAAMC,OAAO,IAAI,CAAC,cAAc;QAEhC,IAAIC;QAEJ,IAAI,CAAC,4BAA4B,GAAG,OAAOC;YACzC,IAAI;gBACF,MAAMH,QAAQ;oBACZ,QAAQ,OAAOI;wBACb,MAAMD,QAAQ,QAAQ,CAACC;oBACzB;gBACF;YACF,EAAE,OAAOC,OAAO;gBACdH,gBAAgBG;YAClB;QACF;QAEAJ,KAAK,EAAE,CAAC,eAAe,IAAI,CAAC,4BAA4B;QAExD,OAAO;YACL,SAAS;gBACP,IAAI,IAAI,CAAC,4BAA4B,EAAE;oBACrCA,KAAK,GAAG,CAAC,eAAe,IAAI,CAAC,4BAA4B;oBACzD,IAAI,CAAC,4BAA4B,GAAGK;gBACtC;YACF;YACA,UAAU,IAAMJ;QAClB;IACF;IApCA,YAAYD,IAAwB,EAAEM,IAAiB,CAAE;QACvD,KAAK,CAACN,MAAM,cAAcM,OAL5B,uBAAQ,gCAAR;IAMA;AAmCF"}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_modules__ = {
|
|
3
|
+
"node:fs" (module) {
|
|
4
|
+
module.exports = require("node:fs");
|
|
5
|
+
}
|
|
6
|
+
};
|
|
7
|
+
var __webpack_module_cache__ = {};
|
|
8
|
+
function __webpack_require__(moduleId) {
|
|
9
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
10
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
11
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
12
|
+
exports: {}
|
|
13
|
+
};
|
|
14
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
15
|
+
return module.exports;
|
|
16
|
+
}
|
|
17
|
+
(()=>{
|
|
18
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
19
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: definition[key]
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
})();
|
|
25
|
+
(()=>{
|
|
26
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
27
|
+
})();
|
|
28
|
+
(()=>{
|
|
29
|
+
__webpack_require__.r = (exports1)=>{
|
|
30
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
31
|
+
value: 'Module'
|
|
32
|
+
});
|
|
33
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
34
|
+
value: true
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
var __webpack_exports__ = {};
|
|
39
|
+
(()=>{
|
|
40
|
+
__webpack_require__.r(__webpack_exports__);
|
|
41
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
42
|
+
default: ()=>reporter
|
|
43
|
+
});
|
|
44
|
+
var external_node_fs_ = __webpack_require__("node:fs");
|
|
45
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
46
|
+
const core_namespaceObject = require("@midscene/core");
|
|
47
|
+
const agent_namespaceObject = require("@midscene/core/agent");
|
|
48
|
+
const utils_namespaceObject = require("@midscene/core/utils");
|
|
49
|
+
const common_namespaceObject = require("@midscene/shared/common");
|
|
50
|
+
const shared_utils_namespaceObject = require("@midscene/shared/utils");
|
|
51
|
+
function _define_property(obj, key, value) {
|
|
52
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
53
|
+
value: value,
|
|
54
|
+
enumerable: true,
|
|
55
|
+
configurable: true,
|
|
56
|
+
writable: true
|
|
57
|
+
});
|
|
58
|
+
else obj[key] = value;
|
|
59
|
+
return obj;
|
|
60
|
+
}
|
|
61
|
+
class MidsceneReporter {
|
|
62
|
+
static getMode(reporterType) {
|
|
63
|
+
if (!reporterType) return 'merged';
|
|
64
|
+
if ('merged' !== reporterType && 'separate' !== reporterType) throw new Error(`Unknown reporter type in playwright config: ${reporterType}, only support 'merged' or 'separate'`);
|
|
65
|
+
return reporterType;
|
|
66
|
+
}
|
|
67
|
+
getSeparatedFilename(testTitle) {
|
|
68
|
+
if (!this.testTitleToFilename.has(testTitle)) {
|
|
69
|
+
const baseTag = `playwright-${(0, shared_utils_namespaceObject.replaceIllegalPathCharsAndSpace)(testTitle)}`;
|
|
70
|
+
const generatedFilename = (0, agent_namespaceObject.getReportFileName)(baseTag);
|
|
71
|
+
this.testTitleToFilename.set(testTitle, generatedFilename);
|
|
72
|
+
}
|
|
73
|
+
return this.testTitleToFilename.get(testTitle);
|
|
74
|
+
}
|
|
75
|
+
getReportFilename(testTitle) {
|
|
76
|
+
if ('merged' === this.mode) {
|
|
77
|
+
if (!this.mergedFilename) this.mergedFilename = (0, agent_namespaceObject.getReportFileName)('playwright-merged');
|
|
78
|
+
return this.mergedFilename;
|
|
79
|
+
}
|
|
80
|
+
if ('separate' === this.mode) {
|
|
81
|
+
if (!testTitle) throw new Error('testTitle is required in separate mode');
|
|
82
|
+
return this.getSeparatedFilename(testTitle);
|
|
83
|
+
}
|
|
84
|
+
throw new Error(`Unknown mode: ${this.mode}`);
|
|
85
|
+
}
|
|
86
|
+
getReportPath(testTitle) {
|
|
87
|
+
const fileName = this.getReportFilename(testTitle);
|
|
88
|
+
if ('html-and-external-assets' === this.outputFormat) return (0, external_node_path_namespaceObject.join)((0, common_namespaceObject.getMidsceneRunSubDir)('report'), fileName, 'index.html');
|
|
89
|
+
return (0, external_node_path_namespaceObject.join)((0, common_namespaceObject.getMidsceneRunSubDir)('report'), `${fileName}.html`);
|
|
90
|
+
}
|
|
91
|
+
copyScreenshotsToReport(tempFilePath, reportPath) {
|
|
92
|
+
const screenshotsDir = (0, external_node_path_namespaceObject.join)((0, external_node_path_namespaceObject.dirname)(reportPath), 'screenshots');
|
|
93
|
+
const tempScreenshotsDir = `${tempFilePath}.screenshots`;
|
|
94
|
+
if (!(0, external_node_fs_.existsSync)(tempScreenshotsDir)) return;
|
|
95
|
+
if (!(0, external_node_fs_.existsSync)(screenshotsDir)) (0, external_node_fs_.mkdirSync)(screenshotsDir, {
|
|
96
|
+
recursive: true
|
|
97
|
+
});
|
|
98
|
+
const screenshotMapPath = `${tempFilePath}.screenshots.json`;
|
|
99
|
+
if (!(0, external_node_fs_.existsSync)(screenshotMapPath)) return;
|
|
100
|
+
try {
|
|
101
|
+
const { readFileSync } = __webpack_require__("node:fs");
|
|
102
|
+
const screenshotMap = JSON.parse(readFileSync(screenshotMapPath, 'utf-8'));
|
|
103
|
+
for (const [id, srcPath] of Object.entries(screenshotMap)){
|
|
104
|
+
if ('merged' === this.mode && this.writtenScreenshots.has(id)) continue;
|
|
105
|
+
const destPath = (0, external_node_path_namespaceObject.join)(screenshotsDir, `${id}.png`);
|
|
106
|
+
if ((0, external_node_fs_.existsSync)(srcPath)) {
|
|
107
|
+
(0, external_node_fs_.copyFileSync)(srcPath, destPath);
|
|
108
|
+
if ('merged' === this.mode) this.writtenScreenshots.add(id);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
} catch (error) {
|
|
112
|
+
console.error('Error copying screenshots:', error);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
async updateReport(testData) {
|
|
116
|
+
if (!testData || !this.mode) return;
|
|
117
|
+
this.writeQueue = this.writeQueue.then(async ()=>{
|
|
118
|
+
const reportPath = this.getReportPath(testData.attributes?.playwright_test_title);
|
|
119
|
+
if ('html-and-external-assets' === this.outputFormat) {
|
|
120
|
+
const reportDir = (0, external_node_path_namespaceObject.dirname)(reportPath);
|
|
121
|
+
if (!(0, external_node_fs_.existsSync)(reportDir)) (0, external_node_fs_.mkdirSync)(reportDir, {
|
|
122
|
+
recursive: true
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
const tpl = (0, utils_namespaceObject.getReportTpl)();
|
|
126
|
+
if (!tpl) throw new Error('Report template not found. Ensure @midscene/core is built correctly.');
|
|
127
|
+
let dumpScript = `<script type="midscene_web_dump">\n${(0, shared_utils_namespaceObject.escapeScriptTag)(testData.dumpString)}\n</script>`;
|
|
128
|
+
if ('merged' === this.mode && testData.attributes) {
|
|
129
|
+
const attributesArr = Object.keys(testData.attributes).map((key)=>`${key}="${encodeURIComponent(testData.attributes[key])}"`);
|
|
130
|
+
dumpScript = dumpScript.replace('<script type="midscene_web_dump"', `<script type="midscene_web_dump" ${attributesArr.join(' ')}`);
|
|
131
|
+
}
|
|
132
|
+
if ('merged' === this.mode) if (this.mergedReportInitialized) (0, external_node_fs_.writeFileSync)(reportPath, dumpScript, {
|
|
133
|
+
flag: 'a'
|
|
134
|
+
});
|
|
135
|
+
else {
|
|
136
|
+
(0, external_node_fs_.writeFileSync)(reportPath, tpl + dumpScript, {
|
|
137
|
+
flag: 'w'
|
|
138
|
+
});
|
|
139
|
+
this.mergedReportInitialized = true;
|
|
140
|
+
}
|
|
141
|
+
else (0, external_node_fs_.writeFileSync)(reportPath, tpl + dumpScript, {
|
|
142
|
+
flag: 'w'
|
|
143
|
+
});
|
|
144
|
+
(0, agent_namespaceObject.printReportMsg)(reportPath);
|
|
145
|
+
});
|
|
146
|
+
await this.writeQueue;
|
|
147
|
+
}
|
|
148
|
+
async onBegin(config, suite) {
|
|
149
|
+
this.hasMultipleProjects = (config.projects?.length || 0) > 1;
|
|
150
|
+
}
|
|
151
|
+
onTestBegin(_test, _result) {}
|
|
152
|
+
onTestEnd(test, result) {
|
|
153
|
+
const dumpAnnotation = test.annotations.find((annotation)=>'MIDSCENE_DUMP_ANNOTATION' === annotation.type);
|
|
154
|
+
if (!dumpAnnotation?.description) return;
|
|
155
|
+
const tempFilePath = dumpAnnotation.description;
|
|
156
|
+
for (const filePath of core_namespaceObject.GroupedActionDump.getFilePaths(tempFilePath))this.tempFiles.add(filePath);
|
|
157
|
+
let dumpString;
|
|
158
|
+
try {
|
|
159
|
+
if ('html-and-external-assets' === this.outputFormat) {
|
|
160
|
+
const { readFileSync } = __webpack_require__("node:fs");
|
|
161
|
+
dumpString = readFileSync(tempFilePath, 'utf-8');
|
|
162
|
+
const retry = result.retry ? `(retry #${result.retry})` : '';
|
|
163
|
+
const projectName = this.hasMultipleProjects ? test.parent?.project()?.name : void 0;
|
|
164
|
+
const projectSuffix = projectName ? ` [${projectName}]` : '';
|
|
165
|
+
const testTitle = `${test.title}${projectSuffix}${retry}`;
|
|
166
|
+
const reportPath = this.getReportPath(testTitle);
|
|
167
|
+
this.copyScreenshotsToReport(tempFilePath, reportPath);
|
|
168
|
+
} else dumpString = core_namespaceObject.GroupedActionDump.fromFilesAsInlineJson(tempFilePath);
|
|
169
|
+
} catch (error) {
|
|
170
|
+
console.error(`Failed to read Midscene dump file: ${tempFilePath}`, error);
|
|
171
|
+
}
|
|
172
|
+
if (dumpString) {
|
|
173
|
+
const retry = result.retry ? `(retry #${result.retry})` : '';
|
|
174
|
+
const testId = `${test.id}${retry}`;
|
|
175
|
+
const projectName = this.hasMultipleProjects ? test.parent?.project()?.name : void 0;
|
|
176
|
+
const projectSuffix = projectName ? ` [${projectName}]` : '';
|
|
177
|
+
const testData = {
|
|
178
|
+
dumpString,
|
|
179
|
+
attributes: {
|
|
180
|
+
playwright_test_id: testId,
|
|
181
|
+
playwright_test_title: `${test.title}${projectSuffix}${retry}`,
|
|
182
|
+
playwright_test_status: result.status,
|
|
183
|
+
playwright_test_duration: result.duration
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
const reportPromise = this.updateReport(testData).catch((error)=>{
|
|
187
|
+
console.error('Error updating report:', error);
|
|
188
|
+
}).finally(()=>{
|
|
189
|
+
this.pendingReports.delete(reportPromise);
|
|
190
|
+
});
|
|
191
|
+
this.pendingReports.add(reportPromise);
|
|
192
|
+
}
|
|
193
|
+
try {
|
|
194
|
+
core_namespaceObject.GroupedActionDump.cleanupFiles(tempFilePath);
|
|
195
|
+
for (const filePath of core_namespaceObject.GroupedActionDump.getFilePaths(tempFilePath))this.tempFiles.delete(filePath);
|
|
196
|
+
} catch {}
|
|
197
|
+
}
|
|
198
|
+
async onEnd() {
|
|
199
|
+
if (this.pendingReports.size > 0) {
|
|
200
|
+
console.log(`Midscene: Waiting for ${this.pendingReports.size} pending report(s) to complete...`);
|
|
201
|
+
await Promise.all(Array.from(this.pendingReports));
|
|
202
|
+
}
|
|
203
|
+
if ('html-and-external-assets' === this.outputFormat && 'merged' === this.mode) {
|
|
204
|
+
const reportPath = this.getReportPath();
|
|
205
|
+
const reportDir = (0, external_node_path_namespaceObject.dirname)(reportPath);
|
|
206
|
+
console.log('[Midscene] Directory report generated.');
|
|
207
|
+
console.log('[Midscene] Note: This report must be served via HTTP server due to CORS restrictions.');
|
|
208
|
+
console.log(`[Midscene] Example: npx serve ${reportDir}`);
|
|
209
|
+
} else if ('html-and-external-assets' === this.outputFormat && 'separate' === this.mode) {
|
|
210
|
+
const reportBaseDir = (0, common_namespaceObject.getMidsceneRunSubDir)('report');
|
|
211
|
+
console.log('[Midscene] Directory reports generated.');
|
|
212
|
+
console.log('[Midscene] Note: Reports must be served via HTTP server due to CORS restrictions.');
|
|
213
|
+
console.log(`[Midscene] Example: npx serve ${reportBaseDir}`);
|
|
214
|
+
}
|
|
215
|
+
if (this.tempFiles.size > 0) {
|
|
216
|
+
console.log(`Midscene: Cleaning up ${this.tempFiles.size} remaining temp file(s)...`);
|
|
217
|
+
for (const filePath of this.tempFiles)try {
|
|
218
|
+
(0, external_node_fs_.rmSync)(filePath, {
|
|
219
|
+
force: true
|
|
220
|
+
});
|
|
221
|
+
} catch (error) {}
|
|
222
|
+
this.tempFiles.clear();
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
constructor(options = {}){
|
|
226
|
+
_define_property(this, "mergedFilename", void 0);
|
|
227
|
+
_define_property(this, "testTitleToFilename", new Map());
|
|
228
|
+
_define_property(this, "mode", void 0);
|
|
229
|
+
_define_property(this, "outputFormat", void 0);
|
|
230
|
+
_define_property(this, "tempFiles", new Set());
|
|
231
|
+
_define_property(this, "pendingReports", new Set());
|
|
232
|
+
_define_property(this, "mergedReportInitialized", false);
|
|
233
|
+
_define_property(this, "writeQueue", Promise.resolve());
|
|
234
|
+
_define_property(this, "hasMultipleProjects", false);
|
|
235
|
+
_define_property(this, "writtenScreenshots", new Set());
|
|
236
|
+
this.mode = MidsceneReporter.getMode(options.type ?? 'merged');
|
|
237
|
+
this.outputFormat = options.outputFormat ?? 'single-html';
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
const reporter = MidsceneReporter;
|
|
241
|
+
})();
|
|
242
|
+
exports["default"] = __webpack_exports__["default"];
|
|
243
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
244
|
+
"default"
|
|
245
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
246
|
+
Object.defineProperty(exports, '__esModule', {
|
|
247
|
+
value: true
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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 {\n copyFileSync,\n existsSync,\n mkdirSync,\n rmSync,\n writeFileSync,\n} from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport {\n GroupedActionDump,\n type ReportDumpWithAttributes,\n} 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 * Output format for the report.\n * - 'single-html': All screenshots embedded as base64 in a single HTML file (default)\n * - 'html-and-external-assets': Screenshots saved as separate PNG files in a screenshots/ subdirectory\n *\n * Note: 'html-and-external-assets' reports must be served via HTTP server due to CORS restrictions.\n */\n outputFormat?: 'single-html' | 'html-and-external-assets';\n}\n\nclass MidsceneReporter implements Reporter {\n private mergedFilename?: string;\n private testTitleToFilename = new Map<string, string>();\n mode?: 'merged' | 'separate';\n outputFormat: 'single-html' | 'html-and-external-assets';\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 // Track written screenshots to avoid duplicates (for directory mode)\n private writtenScreenshots = new Set<string>();\n\n constructor(options: MidsceneReporterOptions = {}) {\n // Set mode from constructor options (official Playwright way)\n this.mode = MidsceneReporter.getMode(options.type ?? 'merged');\n this.outputFormat = options.outputFormat ?? 'single-html';\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 /**\n * Get the report path - for directory mode, returns a directory path with index.html\n */\n private getReportPath(testTitle?: string): string {\n const fileName = this.getReportFilename(testTitle);\n if (this.outputFormat === 'html-and-external-assets') {\n // Directory mode: report-name/index.html\n return join(getMidsceneRunSubDir('report'), fileName, 'index.html');\n }\n // Inline mode: report-name.html\n return join(getMidsceneRunSubDir('report'), `${fileName}.html`);\n }\n\n /**\n * Copy screenshots from temp location to report screenshots directory\n */\n private copyScreenshotsToReport(\n tempFilePath: string,\n reportPath: string,\n ): void {\n const screenshotsDir = join(dirname(reportPath), 'screenshots');\n const tempScreenshotsDir = `${tempFilePath}.screenshots`;\n\n if (!existsSync(tempScreenshotsDir)) {\n return;\n }\n\n // Ensure screenshots directory exists\n if (!existsSync(screenshotsDir)) {\n mkdirSync(screenshotsDir, { recursive: true });\n }\n\n // Read screenshot map to get all screenshot IDs\n const screenshotMapPath = `${tempFilePath}.screenshots.json`;\n if (!existsSync(screenshotMapPath)) {\n return;\n }\n\n try {\n const { readFileSync } = require('node:fs');\n const screenshotMap: Record<string, string> = JSON.parse(\n readFileSync(screenshotMapPath, 'utf-8'),\n );\n\n for (const [id, srcPath] of Object.entries(screenshotMap)) {\n // In merged mode, skip if already written to avoid duplicates\n // In separate mode, each test has its own screenshots directory\n if (this.mode === 'merged' && this.writtenScreenshots.has(id)) {\n continue;\n }\n\n const destPath = join(screenshotsDir, `${id}.png`);\n\n if (existsSync(srcPath)) {\n copyFileSync(srcPath, destPath);\n if (this.mode === 'merged') {\n this.writtenScreenshots.add(id);\n }\n }\n }\n } catch (error) {\n console.error('Error copying screenshots:', error);\n }\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 reportPath = this.getReportPath(\n testData.attributes?.playwright_test_title,\n );\n\n // Ensure report directory exists for directory mode\n if (this.outputFormat === 'html-and-external-assets') {\n const reportDir = dirname(reportPath);\n if (!existsSync(reportDir)) {\n mkdirSync(reportDir, { recursive: true });\n }\n }\n\n // Get report template\n const tpl = getReportTpl();\n if (!tpl) {\n throw new Error(\n 'Report template not found. Ensure @midscene/core is built correctly.',\n );\n }\n\n // Parse the dump string 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 temp files for potential cleanup in onEnd\n for (const filePath of GroupedActionDump.getFilePaths(tempFilePath)) {\n this.tempFiles.add(filePath);\n }\n\n let dumpString: string | undefined;\n\n try {\n if (this.outputFormat === 'html-and-external-assets') {\n // Directory mode: keep { $screenshot: id } format, copy screenshots to report dir\n const { readFileSync } = require('node:fs');\n dumpString = readFileSync(tempFilePath, 'utf-8');\n\n // Get report path and copy screenshots\n const retry = result.retry ? `(retry #${result.retry})` : '';\n const projectName = this.hasMultipleProjects\n ? test.parent?.project()?.name\n : undefined;\n const projectSuffix = projectName ? ` [${projectName}]` : '';\n const testTitle = `${test.title}${projectSuffix}${retry}`;\n const reportPath = this.getReportPath(testTitle);\n\n this.copyScreenshotsToReport(tempFilePath, reportPath);\n } else {\n // Inline mode: convert screenshots to base64\n dumpString = GroupedActionDump.fromFilesAsInlineJson(tempFilePath);\n }\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 files\n try {\n GroupedActionDump.cleanupFiles(tempFilePath);\n for (const filePath of GroupedActionDump.getFilePaths(tempFilePath)) {\n this.tempFiles.delete(filePath);\n }\n } catch {\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 // Print directory mode notice (only for merged mode)\n if (\n this.outputFormat === 'html-and-external-assets' &&\n this.mode === 'merged'\n ) {\n const reportPath = this.getReportPath();\n const reportDir = dirname(reportPath);\n console.log('[Midscene] Directory report generated.');\n console.log(\n '[Midscene] Note: This report must be served via HTTP server due to CORS restrictions.',\n );\n console.log(`[Midscene] Example: npx serve ${reportDir}`);\n } else if (\n this.outputFormat === 'html-and-external-assets' &&\n this.mode === 'separate'\n ) {\n const reportBaseDir = getMidsceneRunSubDir('report');\n console.log('[Midscene] Directory reports generated.');\n console.log(\n '[Midscene] Note: Reports must be served via HTTP server due to CORS restrictions.',\n );\n console.log(`[Midscene] Example: npx serve ${reportBaseDir}`);\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","fileName","join","getMidsceneRunSubDir","tempFilePath","reportPath","screenshotsDir","dirname","tempScreenshotsDir","existsSync","mkdirSync","screenshotMapPath","readFileSync","require","screenshotMap","JSON","id","srcPath","destPath","copyFileSync","error","console","testData","reportDir","tpl","getReportTpl","dumpScript","escapeScriptTag","attributesArr","encodeURIComponent","writeFileSync","printReportMsg","config","suite","_test","_result","test","result","dumpAnnotation","annotation","filePath","GroupedActionDump","dumpString","retry","projectName","undefined","projectSuffix","testId","reportPromise","Promise","Array","reportBaseDir","rmSync","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;;;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,OAA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