@midscene/web 1.12.6-beta-20260910093036.0 → 1.12.6
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/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/cli.mjs +1 -1
- package/dist/es/playwright/browser-agent.mjs +9 -1
- package/dist/es/playwright/browser-agent.mjs.map +1 -1
- package/dist/es/playwright/page-agent.mjs +19 -1
- package/dist/es/playwright/page-agent.mjs.map +1 -1
- package/dist/es/playwright/test-runner/agent-nodes.mjs +13 -0
- package/dist/es/playwright/test-runner/agent-nodes.mjs.map +1 -0
- package/dist/es/playwright/test-runner/clear-cookies.mjs +45 -0
- package/dist/es/playwright/test-runner/clear-cookies.mjs.map +1 -0
- package/dist/es/playwright/test-runner/cookies.mjs +162 -0
- package/dist/es/playwright/test-runner/cookies.mjs.map +1 -0
- package/dist/es/playwright/test-runner/goto-url.mjs +60 -0
- package/dist/es/playwright/test-runner/goto-url.mjs.map +1 -0
- package/dist/es/playwright/test-runner/index.mjs +6 -0
- package/dist/es/playwright/test-runner/types.mjs +0 -0
- package/dist/es/playwright/test-runner/utils.mjs +28 -0
- package/dist/es/playwright/test-runner/utils.mjs.map +1 -0
- package/dist/es/playwright/test-runner/viewport.mjs +35 -0
- package/dist/es/playwright/test-runner/viewport.mjs.map +1 -0
- 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/cli.js +1 -1
- package/dist/lib/playwright/browser-agent.js +9 -1
- package/dist/lib/playwright/browser-agent.js.map +1 -1
- package/dist/lib/playwright/page-agent.js +19 -1
- package/dist/lib/playwright/page-agent.js.map +1 -1
- package/dist/lib/playwright/test-runner/agent-nodes.js +47 -0
- package/dist/lib/playwright/test-runner/agent-nodes.js.map +1 -0
- package/dist/lib/playwright/test-runner/clear-cookies.js +82 -0
- package/dist/lib/playwright/test-runner/clear-cookies.js.map +1 -0
- package/dist/lib/playwright/test-runner/cookies.js +199 -0
- package/dist/lib/playwright/test-runner/cookies.js.map +1 -0
- package/dist/lib/playwright/test-runner/goto-url.js +97 -0
- package/dist/lib/playwright/test-runner/goto-url.js.map +1 -0
- package/dist/lib/playwright/test-runner/index.js +54 -0
- package/dist/lib/playwright/test-runner/index.js.map +1 -0
- package/dist/lib/playwright/test-runner/types.js +20 -0
- package/dist/lib/playwright/test-runner/types.js.map +1 -0
- package/dist/lib/playwright/test-runner/utils.js +68 -0
- package/dist/lib/playwright/test-runner/utils.js.map +1 -0
- package/dist/lib/playwright/test-runner/viewport.js +72 -0
- package/dist/lib/playwright/test-runner/viewport.js.map +1 -0
- package/dist/types/playwright/agent.d.ts +2 -0
- package/dist/types/playwright/browser-agent.d.ts +5 -0
- package/dist/types/playwright/page-agent.d.ts +8 -1
- package/dist/types/playwright/test-runner/agent-nodes.d.ts +2 -0
- package/dist/types/playwright/test-runner/clear-cookies.d.ts +16 -0
- package/dist/types/playwright/test-runner/cookies.d.ts +32 -0
- package/dist/types/playwright/test-runner/goto-url.d.ts +25 -0
- package/dist/types/playwright/test-runner/index.d.ts +10 -0
- package/dist/types/playwright/test-runner/types.d.ts +41 -0
- package/dist/types/playwright/test-runner/utils.d.ts +4 -0
- package/dist/types/playwright/test-runner/viewport.d.ts +13 -0
- package/package.json +10 -4
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
playwrightAgentTestRunnerNodeDefinitions: ()=>playwrightAgentTestRunnerNodeDefinitions
|
|
28
|
+
});
|
|
29
|
+
const external_clear_cookies_js_namespaceObject = require("./clear-cookies.js");
|
|
30
|
+
const external_cookies_js_namespaceObject = require("./cookies.js");
|
|
31
|
+
const external_goto_url_js_namespaceObject = require("./goto-url.js");
|
|
32
|
+
const external_viewport_js_namespaceObject = require("./viewport.js");
|
|
33
|
+
const playwrightAgentTestRunnerNodeDefinitions = [
|
|
34
|
+
external_goto_url_js_namespaceObject.gotoUrlNode,
|
|
35
|
+
external_cookies_js_namespaceObject.setCookiesNode,
|
|
36
|
+
external_clear_cookies_js_namespaceObject.clearCookiesNode,
|
|
37
|
+
external_viewport_js_namespaceObject.setViewportSizeNode
|
|
38
|
+
];
|
|
39
|
+
exports.playwrightAgentTestRunnerNodeDefinitions = __webpack_exports__.playwrightAgentTestRunnerNodeDefinitions;
|
|
40
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
41
|
+
"playwrightAgentTestRunnerNodeDefinitions"
|
|
42
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
43
|
+
Object.defineProperty(exports, '__esModule', {
|
|
44
|
+
value: true
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=agent-nodes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwright/test-runner/agent-nodes.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../src/playwright/test-runner/agent-nodes.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 { AgentTestRunnerNodeDefinition } from '@midscene/core/agent';\nimport { clearCookiesNode } from './clear-cookies';\nimport { setCookiesNode } from './cookies';\nimport { gotoUrlNode } from './goto-url';\nimport { setViewportSizeNode } from './viewport';\n\nexport const playwrightAgentTestRunnerNodeDefinitions: readonly AgentTestRunnerNodeDefinition[] =\n [gotoUrlNode, setCookiesNode, clearCookiesNode, setViewportSizeNode];\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","playwrightAgentTestRunnerNodeDefinitions","gotoUrlNode","setCookiesNode","clearCookiesNode","setViewportSizeNode"],"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;;;;;;;;;;;ACAO,MAAMI,2CACX;IAACC,qCAAAA,WAAWA;IAAEC,oCAAAA,cAAcA;IAAEC,0CAAAA,gBAAgBA;IAAEC,qCAAAA,mBAAmBA;CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
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
|
+
clearCookiesInputSchema: ()=>clearCookiesInputSchema,
|
|
28
|
+
clearCookiesNode: ()=>clearCookiesNode
|
|
29
|
+
});
|
|
30
|
+
const v4_namespaceObject = require("zod/v4");
|
|
31
|
+
const external_utils_js_namespaceObject = require("./utils.js");
|
|
32
|
+
const clearCookiesInputSchema = v4_namespaceObject.z.strictObject({
|
|
33
|
+
name: v4_namespaceObject.z.string().regex(/\S/).optional().describe('Cookie name to clear.'),
|
|
34
|
+
domain: v4_namespaceObject.z.string().regex(/\S/).optional().describe('Cookie domain to clear.'),
|
|
35
|
+
path: v4_namespaceObject.z.string().regex(/\S/).optional().describe('Cookie path to clear.')
|
|
36
|
+
});
|
|
37
|
+
const clearCookiesNode = {
|
|
38
|
+
name: 'clearCookies',
|
|
39
|
+
title: 'Clear browser cookies',
|
|
40
|
+
description: 'Clear all cookies from the current Playwright BrowserContext, or only cookies matching name, domain, or path.',
|
|
41
|
+
stringInputKey: false,
|
|
42
|
+
inputSchema: clearCookiesInputSchema,
|
|
43
|
+
async execute (agent, input, executionContext) {
|
|
44
|
+
const ctx = {
|
|
45
|
+
...executionContext,
|
|
46
|
+
input,
|
|
47
|
+
context: (0, external_utils_js_namespaceObject.requirePlaywrightAgent)(agent)
|
|
48
|
+
};
|
|
49
|
+
(0, external_utils_js_namespaceObject.throwIfAborted)(ctx.signal, 'clearCookies');
|
|
50
|
+
const page = ctx.context.interface.underlyingPage;
|
|
51
|
+
const filters = {
|
|
52
|
+
...void 0 === ctx.input.name ? {} : {
|
|
53
|
+
name: ctx.input.name
|
|
54
|
+
},
|
|
55
|
+
...void 0 === ctx.input.domain ? {} : {
|
|
56
|
+
domain: ctx.input.domain
|
|
57
|
+
},
|
|
58
|
+
...void 0 === ctx.input.path ? {} : {
|
|
59
|
+
path: ctx.input.path
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
await page.context().clearCookies(filters);
|
|
63
|
+
const filterNames = Object.keys(filters);
|
|
64
|
+
return {
|
|
65
|
+
summary: 0 === filterNames.length ? 'Cleared all browser cookies' : `Cleared browser cookies matching ${filterNames.join(', ')}`,
|
|
66
|
+
data: {
|
|
67
|
+
filters
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
exports.clearCookiesInputSchema = __webpack_exports__.clearCookiesInputSchema;
|
|
73
|
+
exports.clearCookiesNode = __webpack_exports__.clearCookiesNode;
|
|
74
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
75
|
+
"clearCookiesInputSchema",
|
|
76
|
+
"clearCookiesNode"
|
|
77
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
78
|
+
Object.defineProperty(exports, '__esModule', {
|
|
79
|
+
value: true
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=clear-cookies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwright/test-runner/clear-cookies.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../src/playwright/test-runner/clear-cookies.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 { AgentTestRunnerNodeDefinition } from '@midscene/core/agent';\nimport type { BrowserContext } from 'playwright';\nimport { z } from 'zod/v4';\nimport { requirePlaywrightAgent, throwIfAborted } from './utils';\n\ntype CookieClearOptions = NonNullable<\n Parameters<BrowserContext['clearCookies']>[0]\n>;\n\n/** Input schema for the Playwright clearCookies Node. */\nexport const clearCookiesInputSchema = z.strictObject({\n name: z.string().regex(/\\S/).optional().describe('Cookie name to clear.'),\n domain: z.string().regex(/\\S/).optional().describe('Cookie domain to clear.'),\n path: z.string().regex(/\\S/).optional().describe('Cookie path to clear.'),\n});\n\n/** Validated input accepted by the Playwright clearCookies Node. */\nexport type ClearCookiesNodeInput = z.infer<typeof clearCookiesInputSchema>;\n\nexport const clearCookiesNode: AgentTestRunnerNodeDefinition<\n z.output<typeof clearCookiesInputSchema>,\n { filters: CookieClearOptions }\n> = {\n name: 'clearCookies',\n title: 'Clear browser cookies',\n description:\n 'Clear all cookies from the current Playwright BrowserContext, or only cookies matching name, domain, or path.',\n stringInputKey: false,\n inputSchema: clearCookiesInputSchema,\n async execute(agent, input, executionContext) {\n const ctx = {\n ...executionContext,\n input,\n context: requirePlaywrightAgent(agent),\n };\n throwIfAborted(ctx.signal, 'clearCookies');\n const page = ctx.context.interface.underlyingPage;\n const filters: CookieClearOptions = {\n ...(ctx.input.name === undefined ? {} : { name: ctx.input.name }),\n ...(ctx.input.domain === undefined ? {} : { domain: ctx.input.domain }),\n ...(ctx.input.path === undefined ? {} : { path: ctx.input.path }),\n };\n await page.context().clearCookies(filters);\n const filterNames = Object.keys(filters);\n return {\n summary:\n filterNames.length === 0\n ? 'Cleared all browser cookies'\n : `Cleared browser cookies matching ${filterNames.join(', ')}`,\n data: { filters },\n };\n },\n};\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","clearCookiesInputSchema","z","clearCookiesNode","agent","input","executionContext","ctx","requirePlaywrightAgent","throwIfAborted","page","filters","undefined","filterNames"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAO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A8B;YAClC,GAAIJ,AAAmBK,WAAnBL,IAAI,KAAK,CAAC,IAAI,GAAiB,CAAC,IAAI;gBAAE,MAAMA,IAAI,KAAK,CAAC,IAAI;YAAC,CAAC;YAChE,GAAIA,AAAqBK,WAArBL,IAAI,KAAK,CAAC,MAAM,GAAiB,CAAC,IAAI;gBAAE,QAAQA,IAAI,KAAK,CAAC,MAAM;YAAC,CAAC;YACtE,GAAIA,AAAmBK,WAAnBL,IAAI,KAAK,CAAC,IAAI,GAAiB,CAAC,IAAI;gBAAE,MAAMA,IAAI,KAAK,CAAC,IAAI;YAAC,CAAC;QAClE;QACA,MAAMG,KAAK,OAAO,GAAG,YAAY,CAACC;QAClC,MAAME,cAAchB,OAAO,IAAI,CAACc;QAChC,OAAO;YACL,SACEE,AAAuB,MAAvBA,YAAY,MAAM,GACd,gCACA,CAAC,iCAAiC,EAAEA,YAAY,IAAI,CAAC,OAAO;YAClE,MAAM;gBAAEF;YAAQ;QAClB;IACF;AACF"}
|
|
@@ -0,0 +1,199 @@
|
|
|
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
|
+
setCookiesNode: ()=>setCookiesNode,
|
|
28
|
+
setCookiesInputSchema: ()=>setCookiesInputSchema
|
|
29
|
+
});
|
|
30
|
+
const promises_namespaceObject = require("node:fs/promises");
|
|
31
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
32
|
+
const v4_namespaceObject = require("zod/v4");
|
|
33
|
+
const external_utils_js_namespaceObject = require("./utils.js");
|
|
34
|
+
const setCookiesInputSchema = v4_namespaceObject.z.strictObject({
|
|
35
|
+
cookiesEnv: v4_namespaceObject.z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).optional().describe('The environment variable containing a Cookie header, cookie array JSON, or Playwright storage-state JSON.'),
|
|
36
|
+
profile: v4_namespaceObject.z.string().regex(/\S/).optional().describe('A cookie profile resolved by getCookieProfile().'),
|
|
37
|
+
storageStatePath: v4_namespaceObject.z.string().regex(/\S/).optional().describe('A path to a Playwright storage-state JSON file.'),
|
|
38
|
+
url: v4_namespaceObject.z.string().url().optional().describe('The HTTP(S) URL used to scope Cookie-header values or cookies without domain/path.')
|
|
39
|
+
}).superRefine((input, ctx)=>{
|
|
40
|
+
const sourceCount = [
|
|
41
|
+
input.cookiesEnv,
|
|
42
|
+
input.profile,
|
|
43
|
+
input.storageStatePath
|
|
44
|
+
].filter((value)=>void 0 !== value).length;
|
|
45
|
+
if (1 !== sourceCount) ctx.addIssue({
|
|
46
|
+
code: 'custom',
|
|
47
|
+
message: 'exactly one of cookiesEnv, profile, and storageStatePath is required'
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
const toCookieSourceReference = (input)=>{
|
|
51
|
+
if (void 0 !== input.cookiesEnv) return {
|
|
52
|
+
kind: 'env',
|
|
53
|
+
name: input.cookiesEnv
|
|
54
|
+
};
|
|
55
|
+
if (void 0 !== input.profile) return {
|
|
56
|
+
kind: 'profile',
|
|
57
|
+
name: input.profile
|
|
58
|
+
};
|
|
59
|
+
if (void 0 !== input.storageStatePath) return {
|
|
60
|
+
kind: 'storage-state',
|
|
61
|
+
name: input.storageStatePath
|
|
62
|
+
};
|
|
63
|
+
throw new TypeError('setCookies requires one cookie source.');
|
|
64
|
+
};
|
|
65
|
+
const parseCookieHeader = (raw, url)=>{
|
|
66
|
+
if (void 0 === url) throw new TypeError('setCookies.url is required when cookiesEnv contains a Cookie header.');
|
|
67
|
+
const segments = raw.split(';').map((segment)=>segment.trim()).filter(Boolean);
|
|
68
|
+
if (0 === segments.length) throw new TypeError('setCookies Cookie header contains no cookies.');
|
|
69
|
+
return segments.map((segment)=>{
|
|
70
|
+
const separator = segment.indexOf('=');
|
|
71
|
+
if (separator <= 0) throw new TypeError('setCookies Cookie header contains an invalid name/value pair.');
|
|
72
|
+
const name = segment.slice(0, separator).trim();
|
|
73
|
+
const value = segment.slice(separator + 1).trim();
|
|
74
|
+
if (!name) throw new TypeError('setCookies Cookie header contains an empty name.');
|
|
75
|
+
return {
|
|
76
|
+
name,
|
|
77
|
+
value,
|
|
78
|
+
url
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
const parseCookieJson = (raw)=>{
|
|
83
|
+
try {
|
|
84
|
+
return JSON.parse(raw);
|
|
85
|
+
} catch {
|
|
86
|
+
throw new TypeError('setCookies source must contain valid JSON or a Cookie header.');
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const resolveCookieSource = async (reference, defaultUrl, ctx, options)=>{
|
|
90
|
+
switch(reference.kind){
|
|
91
|
+
case 'env':
|
|
92
|
+
{
|
|
93
|
+
let env;
|
|
94
|
+
try {
|
|
95
|
+
env = await options.getEnv?.(ctx) ?? process.env;
|
|
96
|
+
} catch {
|
|
97
|
+
throw new Error(`Failed to resolve cookie environment ${reference.name}; the original error was redacted because it may contain cookie values.`);
|
|
98
|
+
}
|
|
99
|
+
const raw = env[reference.name];
|
|
100
|
+
if (!raw?.trim()) throw new Error(`Environment variable ${reference.name} is missing or blank.`);
|
|
101
|
+
const trimmed = raw.trim();
|
|
102
|
+
return {
|
|
103
|
+
reference,
|
|
104
|
+
cookies: /^[\[{]/.test(trimmed) ? parseCookieJson(trimmed) : parseCookieHeader(trimmed, defaultUrl)
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
case 'profile':
|
|
108
|
+
if (!options.getCookieProfile) throw new Error('setCookies.profile requires a configured getCookieProfile callback.');
|
|
109
|
+
try {
|
|
110
|
+
return {
|
|
111
|
+
reference,
|
|
112
|
+
cookies: await options.getCookieProfile({
|
|
113
|
+
profile: reference.name,
|
|
114
|
+
context: ctx.context,
|
|
115
|
+
signal: ctx.signal
|
|
116
|
+
})
|
|
117
|
+
};
|
|
118
|
+
} catch {
|
|
119
|
+
throw new Error(`Failed to resolve cookie profile ${reference.name}; the original error was redacted because it may contain cookie values.`);
|
|
120
|
+
}
|
|
121
|
+
case 'storage-state':
|
|
122
|
+
{
|
|
123
|
+
const path = options.resolveStorageStatePath ? await options.resolveStorageStatePath(reference.name, ctx) : (0, external_node_path_namespaceObject.resolve)(process.cwd(), reference.name);
|
|
124
|
+
return {
|
|
125
|
+
reference,
|
|
126
|
+
cookies: parseCookieJson(await (0, promises_namespaceObject.readFile)(path, 'utf8'))
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
const normalizeCookie = (candidate, defaultUrl, index)=>{
|
|
132
|
+
if (!candidate || 'object' != typeof candidate || Array.isArray(candidate)) throw new TypeError(`setCookies cookie at index ${index} must be an object.`);
|
|
133
|
+
const cookie = candidate;
|
|
134
|
+
if ('string' != typeof cookie.name || !cookie.name.trim()) throw new TypeError(`setCookies cookie at index ${index} requires a non-blank name.`);
|
|
135
|
+
if ('string' != typeof cookie.value) throw new TypeError(`setCookies cookie at index ${index} requires a string value.`);
|
|
136
|
+
const normalized = {
|
|
137
|
+
...cookie
|
|
138
|
+
};
|
|
139
|
+
const hasUrl = 'string' == typeof cookie.url && cookie.url.length > 0;
|
|
140
|
+
const hasDomain = 'string' == typeof cookie.domain && cookie.domain.length > 0;
|
|
141
|
+
if (!hasUrl && !hasDomain) {
|
|
142
|
+
if (void 0 === defaultUrl) throw new TypeError(`setCookies cookie at index ${index} requires url or domain, or setCookies.url must be provided.`);
|
|
143
|
+
normalized.url = defaultUrl;
|
|
144
|
+
}
|
|
145
|
+
if (hasDomain && 'string' != typeof cookie.path) normalized.path = '/';
|
|
146
|
+
return normalized;
|
|
147
|
+
};
|
|
148
|
+
const normalizeCookies = (source, defaultUrl)=>{
|
|
149
|
+
const candidates = Array.isArray(source) ? source : source && 'object' == typeof source && Array.isArray(source.cookies) ? source.cookies : void 0;
|
|
150
|
+
if (!candidates) throw new TypeError('setCookies JSON must be a cookie array or an object with a cookies array.');
|
|
151
|
+
if (0 === candidates.length) throw new TypeError('setCookies source contains no cookies.');
|
|
152
|
+
return candidates.map((cookie, index)=>normalizeCookie(cookie, defaultUrl, index));
|
|
153
|
+
};
|
|
154
|
+
const setCookiesNode = {
|
|
155
|
+
name: 'setCookies',
|
|
156
|
+
title: 'Set browser cookies',
|
|
157
|
+
description: 'Load cookies from an environment variable, configured profile, or Playwright storage-state file without persisting cookie values in workflow input or output.',
|
|
158
|
+
stringInputKey: false,
|
|
159
|
+
inputSchema: setCookiesInputSchema,
|
|
160
|
+
async execute (agent, input, executionContext) {
|
|
161
|
+
const ctx = {
|
|
162
|
+
...executionContext,
|
|
163
|
+
input,
|
|
164
|
+
context: (0, external_utils_js_namespaceObject.requirePlaywrightAgent)(agent)
|
|
165
|
+
};
|
|
166
|
+
(0, external_utils_js_namespaceObject.throwIfAborted)(ctx.signal, 'setCookies');
|
|
167
|
+
const page = ctx.context.interface.underlyingPage;
|
|
168
|
+
const defaultUrl = void 0 === ctx.input.url ? void 0 : (0, external_utils_js_namespaceObject.resolveWebUrl)(ctx.input.url, void 0, 'setCookies.url');
|
|
169
|
+
const reference = toCookieSourceReference(ctx.input);
|
|
170
|
+
const resolved = await resolveCookieSource(reference, defaultUrl, ctx, ctx.context.testRunner ?? {});
|
|
171
|
+
const cookies = normalizeCookies(resolved.cookies, defaultUrl);
|
|
172
|
+
(0, external_utils_js_namespaceObject.throwIfAborted)(ctx.signal, 'setCookies');
|
|
173
|
+
try {
|
|
174
|
+
await page.context().addCookies(cookies);
|
|
175
|
+
} catch {
|
|
176
|
+
throw new Error(`Failed to set ${cookies.length} browser cookie(s); the browser error was redacted because it may contain cookie values.`);
|
|
177
|
+
}
|
|
178
|
+
const result = {
|
|
179
|
+
source: resolved.reference.kind,
|
|
180
|
+
sourceName: resolved.reference.name,
|
|
181
|
+
count: cookies.length
|
|
182
|
+
};
|
|
183
|
+
return {
|
|
184
|
+
summary: `Set ${result.count} browser cookie(s) from ${result.source} source ${result.sourceName}`,
|
|
185
|
+
data: result
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
exports.setCookiesInputSchema = __webpack_exports__.setCookiesInputSchema;
|
|
190
|
+
exports.setCookiesNode = __webpack_exports__.setCookiesNode;
|
|
191
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
192
|
+
"setCookiesInputSchema",
|
|
193
|
+
"setCookiesNode"
|
|
194
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
195
|
+
Object.defineProperty(exports, '__esModule', {
|
|
196
|
+
value: true
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
//# sourceMappingURL=cookies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwright/test-runner/cookies.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../src/playwright/test-runner/cookies.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 { readFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport type { AgentTestRunnerNodeDefinition } from '@midscene/core/agent';\nimport { z } from 'zod/v4';\nimport type {\n PlaywrightCookie,\n PlaywrightNodeContext,\n PlaywrightTestRunnerAgent,\n PlaywrightTestRunnerOptions,\n} from './types';\nimport { requirePlaywrightAgent, resolveWebUrl, throwIfAborted } from './utils';\n\ntype CookieSourceReference =\n | { kind: 'env'; name: string }\n | { kind: 'profile'; name: string }\n | { kind: 'storage-state'; name: string };\n\ninterface ResolvedCookieSource {\n reference: CookieSourceReference;\n cookies: unknown;\n}\n\n/** Input schema for the Playwright setCookies Node. */\nexport const setCookiesInputSchema = z\n .strictObject({\n cookiesEnv: z\n .string()\n .regex(/^[A-Za-z_][A-Za-z0-9_]*$/)\n .optional()\n .describe(\n 'The environment variable containing a Cookie header, cookie array JSON, or Playwright storage-state JSON.',\n ),\n profile: z\n .string()\n .regex(/\\S/)\n .optional()\n .describe('A cookie profile resolved by getCookieProfile().'),\n storageStatePath: z\n .string()\n .regex(/\\S/)\n .optional()\n .describe('A path to a Playwright storage-state JSON file.'),\n url: z\n .string()\n .url()\n .optional()\n .describe(\n 'The HTTP(S) URL used to scope Cookie-header values or cookies without domain/path.',\n ),\n })\n .superRefine((input, ctx) => {\n const sourceCount = [\n input.cookiesEnv,\n input.profile,\n input.storageStatePath,\n ].filter((value) => value !== undefined).length;\n if (sourceCount !== 1) {\n ctx.addIssue({\n code: 'custom',\n message:\n 'exactly one of cookiesEnv, profile, and storageStatePath is required',\n });\n }\n });\n\n/** Validated input accepted by the Playwright setCookies Node. */\nexport type SetCookiesNodeInput = z.infer<typeof setCookiesInputSchema>;\n\n/** Secret-free metadata returned by the Playwright setCookies Node. */\nexport interface SetCookiesNodeResult {\n /** Kind of configured reference used to resolve the cookies. */\n source: CookieSourceReference['kind'];\n /** Environment variable, profile, or storage-state reference name. */\n sourceName: string;\n /** Number of cookies passed to the BrowserContext. */\n count: number;\n}\n\nconst toCookieSourceReference = (\n input: SetCookiesNodeInput,\n): CookieSourceReference => {\n if (input.cookiesEnv !== undefined) {\n return { kind: 'env', name: input.cookiesEnv };\n }\n if (input.profile !== undefined) {\n return { kind: 'profile', name: input.profile };\n }\n if (input.storageStatePath !== undefined) {\n return { kind: 'storage-state', name: input.storageStatePath };\n }\n throw new TypeError('setCookies requires one cookie source.');\n};\n\nconst parseCookieHeader = (raw: string, url: string | undefined) => {\n if (url === undefined) {\n throw new TypeError(\n 'setCookies.url is required when cookiesEnv contains a Cookie header.',\n );\n }\n const segments = raw\n .split(';')\n .map((segment) => segment.trim())\n .filter(Boolean);\n if (segments.length === 0) {\n throw new TypeError('setCookies Cookie header contains no cookies.');\n }\n return segments.map((segment) => {\n const separator = segment.indexOf('=');\n if (separator <= 0) {\n throw new TypeError(\n 'setCookies Cookie header contains an invalid name/value pair.',\n );\n }\n const name = segment.slice(0, separator).trim();\n const value = segment.slice(separator + 1).trim();\n if (!name) {\n throw new TypeError('setCookies Cookie header contains an empty name.');\n }\n return { name, value, url } satisfies PlaywrightCookie;\n });\n};\n\nconst parseCookieJson = (raw: string): unknown => {\n try {\n return JSON.parse(raw);\n } catch {\n throw new TypeError(\n 'setCookies source must contain valid JSON or a Cookie header.',\n );\n }\n};\n\nconst resolveCookieSource = async (\n reference: CookieSourceReference,\n defaultUrl: string | undefined,\n ctx: PlaywrightNodeContext<PlaywrightTestRunnerAgent>,\n options: PlaywrightTestRunnerOptions,\n): Promise<ResolvedCookieSource> => {\n switch (reference.kind) {\n case 'env': {\n let env: Readonly<Record<string, string | undefined>>;\n try {\n env = (await options.getEnv?.(ctx)) ?? process.env;\n } catch {\n throw new Error(\n `Failed to resolve cookie environment ${reference.name}; the original error was redacted because it may contain cookie values.`,\n );\n }\n const raw = env[reference.name];\n if (!raw?.trim()) {\n throw new Error(\n `Environment variable ${reference.name} is missing or blank.`,\n );\n }\n const trimmed = raw.trim();\n return {\n reference,\n cookies: /^[\\[{]/.test(trimmed)\n ? parseCookieJson(trimmed)\n : parseCookieHeader(trimmed, defaultUrl),\n };\n }\n case 'profile': {\n if (!options.getCookieProfile) {\n throw new Error(\n 'setCookies.profile requires a configured getCookieProfile callback.',\n );\n }\n try {\n return {\n reference,\n cookies: await options.getCookieProfile({\n profile: reference.name,\n context: ctx.context,\n signal: ctx.signal,\n }),\n };\n } catch {\n throw new Error(\n `Failed to resolve cookie profile ${reference.name}; the original error was redacted because it may contain cookie values.`,\n );\n }\n }\n case 'storage-state': {\n const path = options.resolveStorageStatePath\n ? await options.resolveStorageStatePath(reference.name, ctx)\n : resolve(process.cwd(), reference.name);\n return {\n reference,\n cookies: parseCookieJson(await readFile(path, 'utf8')),\n };\n }\n }\n};\n\nconst normalizeCookie = (\n candidate: unknown,\n defaultUrl: string | undefined,\n index: number,\n): PlaywrightCookie => {\n if (!candidate || typeof candidate !== 'object' || Array.isArray(candidate)) {\n throw new TypeError(\n `setCookies cookie at index ${index} must be an object.`,\n );\n }\n const cookie = candidate as Record<string, unknown>;\n if (typeof cookie.name !== 'string' || !cookie.name.trim()) {\n throw new TypeError(\n `setCookies cookie at index ${index} requires a non-blank name.`,\n );\n }\n if (typeof cookie.value !== 'string') {\n throw new TypeError(\n `setCookies cookie at index ${index} requires a string value.`,\n );\n }\n\n const normalized = { ...cookie } as unknown as PlaywrightCookie;\n const hasUrl = typeof cookie.url === 'string' && cookie.url.length > 0;\n const hasDomain =\n typeof cookie.domain === 'string' && cookie.domain.length > 0;\n if (!hasUrl && !hasDomain) {\n if (defaultUrl === undefined) {\n throw new TypeError(\n `setCookies cookie at index ${index} requires url or domain, or setCookies.url must be provided.`,\n );\n }\n normalized.url = defaultUrl;\n }\n if (hasDomain && typeof cookie.path !== 'string') {\n normalized.path = '/';\n }\n return normalized;\n};\n\nconst normalizeCookies = (\n source: unknown,\n defaultUrl: string | undefined,\n): PlaywrightCookie[] => {\n const candidates = Array.isArray(source)\n ? source\n : source &&\n typeof source === 'object' &&\n Array.isArray((source as { cookies?: unknown }).cookies)\n ? (source as { cookies: unknown[] }).cookies\n : undefined;\n if (!candidates) {\n throw new TypeError(\n 'setCookies JSON must be a cookie array or an object with a cookies array.',\n );\n }\n if (candidates.length === 0) {\n throw new TypeError('setCookies source contains no cookies.');\n }\n return candidates.map((cookie, index) =>\n normalizeCookie(cookie, defaultUrl, index),\n );\n};\n\nexport const setCookiesNode: AgentTestRunnerNodeDefinition<\n z.output<typeof setCookiesInputSchema>,\n SetCookiesNodeResult\n> = {\n name: 'setCookies',\n title: 'Set browser cookies',\n description:\n 'Load cookies from an environment variable, configured profile, or Playwright storage-state file without persisting cookie values in workflow input or output.',\n stringInputKey: false,\n inputSchema: setCookiesInputSchema,\n async execute(agent, input, executionContext) {\n const ctx = {\n ...executionContext,\n input,\n context: requirePlaywrightAgent(agent),\n };\n throwIfAborted(ctx.signal, 'setCookies');\n const page = ctx.context.interface.underlyingPage;\n const defaultUrl =\n ctx.input.url === undefined\n ? undefined\n : resolveWebUrl(ctx.input.url, undefined, 'setCookies.url');\n const reference = toCookieSourceReference(ctx.input);\n const resolved = await resolveCookieSource(\n reference,\n defaultUrl,\n ctx,\n ctx.context.testRunner ?? {},\n );\n const cookies = normalizeCookies(resolved.cookies, defaultUrl);\n\n throwIfAborted(ctx.signal, 'setCookies');\n try {\n await page.context().addCookies(cookies);\n } catch {\n throw new Error(\n `Failed to set ${cookies.length} browser cookie(s); the browser error was redacted because it may contain cookie values.`,\n );\n }\n\n const result: SetCookiesNodeResult = {\n source: resolved.reference.kind,\n sourceName: resolved.reference.name,\n count: cookies.length,\n };\n return {\n summary: `Set ${result.count} browser cookie(s) from ${result.source} source ${result.sourceName}`,\n data: result,\n };\n },\n};\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","setCookiesInputSchema","z","input","ctx","sourceCount","value","undefined","toCookieSourceReference","TypeError","parseCookieHeader","raw","url","segments","segment","Boolean","separator","name","parseCookieJson","JSON","resolveCookieSource","reference","defaultUrl","options","env","process","Error","trimmed","path","resolve","readFile","normalizeCookie","candidate","index","Array","cookie","normalized","hasUrl","hasDomain","normalizeCookies","source","candidates","setCookiesNode","agent","executionContext","requirePlaywrightAgent","throwIfAborted","page","resolveWebUrl","resolved","cookies","result"],"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;;;;;;;;;;;;ACiBO,MAAMI,wBAAwBC,mBAAAA,CAAAA,CAAAA,YACtB,CAAC;IACZ,YAAYA,mBAAAA,CAAAA,CAAAA,MACH,GACN,KAAK,CAAC,4BACN,QAAQ,GACR,QAAQ,CACP;IAEJ,SAASA,mBAAAA,CAAAA,CAAAA,MACA,GACN,KAAK,CAAC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YACF,MAAM2C,KAAK,OAAO,GAAG,UAAU,CAACG;QAClC,EAAE,OAAM;YACN,MAAM,IAAIxB,MACR,CAAC,cAAc,EAAEwB,QAAQ,MAAM,CAAC,wFAAwF,CAAC;QAE7H;QAEA,MAAMC,SAA+B;YACnC,QAAQF,SAAS,SAAS,CAAC,IAAI;YAC/B,YAAYA,SAAS,SAAS,CAAC,IAAI;YACnC,OAAOC,QAAQ,MAAM;QACvB;QACA,OAAO;YACL,SAAS,CAAC,IAAI,EAAEC,OAAO,KAAK,CAAC,wBAAwB,EAAEA,OAAO,MAAM,CAAC,QAAQ,EAAEA,OAAO,UAAU,EAAE;YAClG,MAAMA;QACR;IACF;AACF"}
|
|
@@ -0,0 +1,97 @@
|
|
|
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
|
+
gotoUrlInputSchema: ()=>gotoUrlInputSchema,
|
|
28
|
+
gotoUrlNode: ()=>gotoUrlNode
|
|
29
|
+
});
|
|
30
|
+
const v4_namespaceObject = require("zod/v4");
|
|
31
|
+
const external_utils_js_namespaceObject = require("./utils.js");
|
|
32
|
+
const DEFAULT_NAVIGATION_TIMEOUT_MS = 60000;
|
|
33
|
+
const DEFAULT_WAIT_UNTIL = 'domcontentloaded';
|
|
34
|
+
const gotoUrlInputSchema = v4_namespaceObject.z.strictObject({
|
|
35
|
+
url: v4_namespaceObject.z.string().min(1).describe('An absolute HTTP(S) URL or a path relative to Playwright baseURL or the current page URL.'),
|
|
36
|
+
waitUntil: v4_namespaceObject.z["enum"]([
|
|
37
|
+
'commit',
|
|
38
|
+
'domcontentloaded',
|
|
39
|
+
'load',
|
|
40
|
+
'networkidle'
|
|
41
|
+
]).default(DEFAULT_WAIT_UNTIL).describe('The Playwright navigation lifecycle event to wait for.'),
|
|
42
|
+
timeoutMs: v4_namespaceObject.z.number().positive().default(DEFAULT_NAVIGATION_TIMEOUT_MS).describe('The navigation timeout in milliseconds.')
|
|
43
|
+
});
|
|
44
|
+
const resolveNavigationUrl = (target, page)=>{
|
|
45
|
+
const trimmed = target.trim();
|
|
46
|
+
if (!trimmed) throw new TypeError('gotoUrl.url must not be blank.');
|
|
47
|
+
if (/^[a-z][a-z\d+.-]*:/i.test(trimmed)) return (0, external_utils_js_namespaceObject.resolveWebUrl)(trimmed, void 0, 'gotoUrl.url');
|
|
48
|
+
const context = page.context();
|
|
49
|
+
const configuredBase = context._options?.baseURL;
|
|
50
|
+
if (void 0 !== configuredBase) return (0, external_utils_js_namespaceObject.resolveWebUrl)(trimmed, configuredBase, 'gotoUrl.url');
|
|
51
|
+
const currentUrl = page.url();
|
|
52
|
+
if (!/^https?:\/\//i.test(currentUrl)) throw new TypeError(`gotoUrl.url cannot resolve a relative URL from ${JSON.stringify(currentUrl)}. Use an absolute HTTP(S) URL for the first navigation or configure Playwright baseURL.`);
|
|
53
|
+
return (0, external_utils_js_namespaceObject.resolveWebUrl)(trimmed, currentUrl, 'gotoUrl.url');
|
|
54
|
+
};
|
|
55
|
+
const gotoUrlNode = {
|
|
56
|
+
name: 'gotoUrl',
|
|
57
|
+
title: 'Open a Web URL',
|
|
58
|
+
description: 'Navigate the current Playwright Page to an absolute HTTP(S) URL or a path relative to Playwright baseURL or the current page URL.',
|
|
59
|
+
stringInputKey: 'url',
|
|
60
|
+
inputSchema: gotoUrlInputSchema,
|
|
61
|
+
async execute (agent, input, executionContext) {
|
|
62
|
+
const ctx = {
|
|
63
|
+
...executionContext,
|
|
64
|
+
input,
|
|
65
|
+
context: (0, external_utils_js_namespaceObject.requirePlaywrightAgent)(agent)
|
|
66
|
+
};
|
|
67
|
+
(0, external_utils_js_namespaceObject.throwIfAborted)(ctx.signal, 'gotoUrl');
|
|
68
|
+
const page = ctx.context.interface.underlyingPage;
|
|
69
|
+
const url = resolveNavigationUrl(ctx.input.url, page);
|
|
70
|
+
const response = await page.goto(url, {
|
|
71
|
+
waitUntil: ctx.input.waitUntil,
|
|
72
|
+
timeout: ctx.input.timeoutMs
|
|
73
|
+
});
|
|
74
|
+
(0, external_utils_js_namespaceObject.throwIfAborted)(ctx.signal, 'gotoUrl');
|
|
75
|
+
const status = response?.status() ?? null;
|
|
76
|
+
const result = {
|
|
77
|
+
url: page.url(),
|
|
78
|
+
status,
|
|
79
|
+
title: await page.title()
|
|
80
|
+
};
|
|
81
|
+
return {
|
|
82
|
+
summary: `Navigated to ${result.url}`,
|
|
83
|
+
data: result
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
exports.gotoUrlInputSchema = __webpack_exports__.gotoUrlInputSchema;
|
|
88
|
+
exports.gotoUrlNode = __webpack_exports__.gotoUrlNode;
|
|
89
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
90
|
+
"gotoUrlInputSchema",
|
|
91
|
+
"gotoUrlNode"
|
|
92
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
93
|
+
Object.defineProperty(exports, '__esModule', {
|
|
94
|
+
value: true
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
//# sourceMappingURL=goto-url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwright/test-runner/goto-url.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../src/playwright/test-runner/goto-url.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 { AgentTestRunnerNodeDefinition } from '@midscene/core/agent';\nimport type { BrowserContext, Page } from 'playwright';\nimport { z } from 'zod/v4';\nimport { requirePlaywrightAgent, resolveWebUrl, throwIfAborted } from './utils';\n\nconst DEFAULT_NAVIGATION_TIMEOUT_MS = 60_000;\nconst DEFAULT_WAIT_UNTIL = 'domcontentloaded' as const;\n\n/** Input schema for the Playwright gotoUrl Node. */\nexport const gotoUrlInputSchema = z.strictObject({\n url: z\n .string()\n .min(1)\n .describe(\n 'An absolute HTTP(S) URL or a path relative to Playwright baseURL or the current page URL.',\n ),\n waitUntil: z\n .enum(['commit', 'domcontentloaded', 'load', 'networkidle'])\n .default(DEFAULT_WAIT_UNTIL)\n .describe('The Playwright navigation lifecycle event to wait for.'),\n timeoutMs: z\n .number()\n .positive()\n .default(DEFAULT_NAVIGATION_TIMEOUT_MS)\n .describe('The navigation timeout in milliseconds.'),\n});\n\n/** Validated input accepted by the Playwright gotoUrl Node. */\nexport type GotoUrlNodeInput = z.infer<typeof gotoUrlInputSchema>;\n\n/** Structured navigation details returned by the Playwright gotoUrl Node. */\nexport interface GotoUrlNodeResult {\n /** Final Page URL after navigation and redirects. */\n url: string;\n /** Main-resource HTTP status, or null when Playwright returns no response. */\n status: number | null;\n /** Document title after navigation completes. */\n title: string;\n}\n\nconst resolveNavigationUrl = (target: string, page: Page): string => {\n const trimmed = target.trim();\n if (!trimmed) throw new TypeError('gotoUrl.url must not be blank.');\n // Absolute URLs do not depend on either configured or current-page bases.\n if (/^[a-z][a-z\\d+.-]*:/i.test(trimmed)) {\n return resolveWebUrl(trimmed, undefined, 'gotoUrl.url');\n }\n\n // Playwright has no public baseURL getter. Its BrowserContext stores the\n // configured value in _options; keep this internal access localized here.\n const context = page.context() as BrowserContext & {\n _options?: { baseURL?: string };\n };\n const configuredBase = context._options?.baseURL;\n if (configuredBase !== undefined) {\n return resolveWebUrl(trimmed, configuredBase, 'gotoUrl.url');\n }\n\n const currentUrl = page.url();\n if (!/^https?:\\/\\//i.test(currentUrl)) {\n throw new TypeError(\n `gotoUrl.url cannot resolve a relative URL from ${JSON.stringify(currentUrl)}. Use an absolute HTTP(S) URL for the first navigation or configure Playwright baseURL.`,\n );\n }\n return resolveWebUrl(trimmed, currentUrl, 'gotoUrl.url');\n};\n\nexport const gotoUrlNode: AgentTestRunnerNodeDefinition<\n z.output<typeof gotoUrlInputSchema>,\n GotoUrlNodeResult\n> = {\n name: 'gotoUrl',\n title: 'Open a Web URL',\n description:\n 'Navigate the current Playwright Page to an absolute HTTP(S) URL or a path relative to Playwright baseURL or the current page URL.',\n stringInputKey: 'url',\n inputSchema: gotoUrlInputSchema,\n async execute(agent, input, executionContext) {\n const ctx = {\n ...executionContext,\n input,\n context: requirePlaywrightAgent(agent),\n };\n throwIfAborted(ctx.signal, 'gotoUrl');\n const page = ctx.context.interface.underlyingPage;\n const url = resolveNavigationUrl(ctx.input.url, page);\n const response = await page.goto(url, {\n waitUntil: ctx.input.waitUntil,\n timeout: ctx.input.timeoutMs,\n });\n throwIfAborted(ctx.signal, 'gotoUrl');\n const status = response?.status() ?? null;\n const result = {\n url: page.url(),\n status,\n title: await page.title(),\n };\n return { summary: `Navigated to ${result.url}`, data: result };\n },\n};\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","DEFAULT_NAVIGATION_TIMEOUT_MS","DEFAULT_WAIT_UNTIL","gotoUrlInputSchema","z","resolveNavigationUrl","target","page","trimmed","TypeError","resolveWebUrl","undefined","context","configuredBase","currentUrl","JSON","gotoUrlNode","agent","input","executionContext","ctx","requirePlaywrightAgent","throwIfAborted","url","response","status","result"],"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;;;;;;;;;;ACDA,MAAMI,gCAAgC;AACtC,MAAMC,qBAAqB;AAGpB,MAAMC,qBAAqBC,mBAAAA,CAAAA,CAAAA,YAAc,CAAC;IAC/C,KAAKA,mBAAAA,CAAAA,CAAAA,MACI,GACN,GAAG,CAAC,GACJ,QAAQ,CACP;IAEJ,WAAWA,mBAAAA,CAAAA,CAAAA,OACJ,CAAC;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MiB,WAAW,MAAMjB,KAAK,IAAI,CAACgB,KAAK;YACpC,WAAWH,IAAI,KAAK,CAAC,SAAS;YAC9B,SAASA,IAAI,KAAK,CAAC,SAAS;QAC9B;QACAE,IAAAA,kCAAAA,cAAAA,AAAAA,EAAeF,IAAI,MAAM,EAAE;QAC3B,MAAMK,SAASD,UAAU,YAAY;QACrC,MAAME,SAAS;YACb,KAAKnB,KAAK,GAAG;YACbkB;YACA,OAAO,MAAMlB,KAAK,KAAK;QACzB;QACA,OAAO;YAAE,SAAS,CAAC,aAAa,EAAEmB,OAAO,GAAG,EAAE;YAAE,MAAMA;QAAO;IAC/D;AACF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
gotoUrlInputSchema: ()=>external_goto_url_js_namespaceObject.gotoUrlInputSchema,
|
|
28
|
+
setCookiesInputSchema: ()=>external_cookies_js_namespaceObject.setCookiesInputSchema,
|
|
29
|
+
setViewportSizeInputSchema: ()=>external_viewport_js_namespaceObject.setViewportSizeInputSchema,
|
|
30
|
+
clearCookiesInputSchema: ()=>external_clear_cookies_js_namespaceObject.clearCookiesInputSchema,
|
|
31
|
+
playwrightAgentTestRunnerNodeDefinitions: ()=>external_agent_nodes_js_namespaceObject.playwrightAgentTestRunnerNodeDefinitions
|
|
32
|
+
});
|
|
33
|
+
const external_clear_cookies_js_namespaceObject = require("./clear-cookies.js");
|
|
34
|
+
const external_cookies_js_namespaceObject = require("./cookies.js");
|
|
35
|
+
const external_goto_url_js_namespaceObject = require("./goto-url.js");
|
|
36
|
+
const external_viewport_js_namespaceObject = require("./viewport.js");
|
|
37
|
+
const external_agent_nodes_js_namespaceObject = require("./agent-nodes.js");
|
|
38
|
+
exports.clearCookiesInputSchema = __webpack_exports__.clearCookiesInputSchema;
|
|
39
|
+
exports.gotoUrlInputSchema = __webpack_exports__.gotoUrlInputSchema;
|
|
40
|
+
exports.playwrightAgentTestRunnerNodeDefinitions = __webpack_exports__.playwrightAgentTestRunnerNodeDefinitions;
|
|
41
|
+
exports.setCookiesInputSchema = __webpack_exports__.setCookiesInputSchema;
|
|
42
|
+
exports.setViewportSizeInputSchema = __webpack_exports__.setViewportSizeInputSchema;
|
|
43
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
44
|
+
"clearCookiesInputSchema",
|
|
45
|
+
"gotoUrlInputSchema",
|
|
46
|
+
"playwrightAgentTestRunnerNodeDefinitions",
|
|
47
|
+
"setCookiesInputSchema",
|
|
48
|
+
"setViewportSizeInputSchema"
|
|
49
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
50
|
+
Object.defineProperty(exports, '__esModule', {
|
|
51
|
+
value: true
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwright/test-runner/index.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object"],"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};"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol"],"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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.r = (exports1)=>{
|
|
5
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
6
|
+
value: 'Module'
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
9
|
+
value: true
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
})();
|
|
13
|
+
var __webpack_exports__ = {};
|
|
14
|
+
__webpack_require__.r(__webpack_exports__);
|
|
15
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
16
|
+
Object.defineProperty(exports, '__esModule', {
|
|
17
|
+
value: true
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwright/test-runner/types.js","sources":["webpack/runtime/make_namespace_object"],"sourcesContent":["// 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};"],"names":["__webpack_require__","Symbol","Object"],"mappings":";;;IACAA,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOC,UAA0BA,OAAO,WAAW,EACrDC,OAAO,cAAc,CAAC,UAASD,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEC,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D"}
|