@unotest/web 0.6.2 → 0.9.1
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/.claude/skills/write-e2e-test/SKILL.md +37 -22
- package/CHANGELOG.md +63 -0
- package/README.md +12 -12
- package/dist/config/schema.d.ts +81 -10
- package/dist/config/schema.js +1 -1
- package/dist/driver/index.d.ts +7 -2
- package/dist/driver/index.js +1 -1
- package/dist/dsl/index.d.ts +33 -107
- package/dist/dsl/index.js +1 -1
- package/dist/dsl/web-dsl-language-service.d.ts +18 -0
- package/dist/dsl/web-dsl-language-service.js +1 -0
- package/dist/inspection/page-inject.d.ts +45 -1
- package/dist/inspection/page-inject.js +253 -4
- package/dist/{interfaces-iTfjd1zT.d.ts → interfaces-dbZG10RS.d.ts} +40 -1
- package/dist/{linter-DzAzJpab.d.ts → linter-CM2CpIyW.d.ts} +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/runner/cli.d.ts +8 -14
- package/dist/runner/cli.js +1 -1
- package/dist/runner/init/chrome-probe.d.ts +15 -0
- package/dist/runner/init/chrome-probe.js +1 -0
- package/dist/runner/init.js +1 -1
- package/dist/runner/install-chromium.js +1 -1
- package/dist/runner/prepare-fix.js +1 -1
- package/dist/runner/scaffold-workspace.d.ts +24 -0
- package/dist/runner/scaffold-workspace.js +1 -0
- package/dist/runner/serve-fixture.js +1 -1
- package/dist/runner/web-runner-adapter.d.ts +1 -1
- package/dist/runner/web-runner-adapter.js +1 -1
- package/examples/fixtures/break-fix-app/serve.mjs +6 -2
- package/guides/dsl-reference.md +7 -7
- package/package.json +21 -4
- package/src/mcp/prompts/agent-test-author.md +17 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
function _0x1303(){var _0x28eaf4=['C2vYDMuTzML4DhvYztOGy2fUBM90igXVy2f0zsbMAxH0DxjLihnLCNzLCIbLBNrYEs4GvhjPzwq6cG','rgLKihLVDsbWDwjSAxnOihDPDgHVDxqGzxHHBxbSzxmVzML4DhvYzxmVpWO','m01tuNfNAq','D3jPDgu','mtq2nJi3mffRwgXkrG','mJu3nJqZmKLxCwfMwG','mZC3ntu2AePmuwfi','zxHLy1bHDgG','lI4VlI4VzxHHBxbSzxmVzML4DhvYzxmVyNjLywSTzML4lwfWCc9Zzxj2zs5TANm','mtroCNf2u1i','zMLUza','C3rKzxjY','ode5odzmruTIy3i','BwfW','mtC3nZKZnJbyvw5fwKC','zxHPDa','nM9qvufiDq','AM9PBG','odaYodC2nufSA3bkqG','mJGWmdeXmerWtLrLEG','C2XPy2u'];_0x1303=function(){return _0x28eaf4;};return _0x1303();}var _0x58651e=_0x3d94;(function(_0x431d6b,_0x6d1318){var _0x5b2c86={_0x1cdd31:0x208,_0x476103:0x201,_0xb41d2f:0x1f7,_0x82f54b:0x1f5,_0x1b2bd5:0x204,_0x3928f0:0x1fa,_0x43684c:0x1f6,_0x1251cc:0x203,_0x34c995:0x1ff},_0x73ba99=_0x3d94,_0x2bcd7d=_0x431d6b();while(!![]){try{var _0x104839=-parseInt(_0x73ba99(_0x5b2c86._0x1cdd31))/0x1*(-parseInt(_0x73ba99(0x1fd))/0x2)+-parseInt(_0x73ba99(_0x5b2c86._0x476103))/0x3*(parseInt(_0x73ba99(_0x5b2c86._0xb41d2f))/0x4)+parseInt(_0x73ba99(_0x5b2c86._0x82f54b))/0x5+-parseInt(_0x73ba99(_0x5b2c86._0x1b2bd5))/0x6*(parseInt(_0x73ba99(_0x5b2c86._0x3928f0))/0x7)+parseInt(_0x73ba99(_0x5b2c86._0x43684c))/0x8+-parseInt(_0x73ba99(_0x5b2c86._0x1251cc))/0x9+parseInt(_0x73ba99(_0x5b2c86._0x34c995))/0xa;if(_0x104839===_0x6d1318)break;else _0x2bcd7d['push'](_0x2bcd7d['shift']());}catch(_0x11c3c0){_0x2bcd7d['push'](_0x2bcd7d['shift']());}}}(_0x1303,0x7a8e6));import{fileURLToPath}from'url';import{dirname,resolve}from'path';import{spawn}from'child_process';import{existsSync}from'fs';var here=dirname(fileURLToPath(import.meta.url)),candidates=[resolve(here,_0x58651e(0x1f9)),resolve(here,'../../../examples/fixtures/break-fix-app/serve.mjs')],serverEntry=candidates[_0x58651e(0x1fb)](_0xbe0779=>existsSync(_0xbe0779));!serverEntry&&(process[_0x58651e(0x1fc)][_0x58651e(0x1f4)](_0x58651e(0x206)+candidates[_0x58651e(0x1fe)](_0x2cb00a=>'\x20\x20'+_0x2cb00a+'\x0a')[_0x58651e(0x202)]('')+_0x58651e(0x207)),process[_0x58651e(0x200)](0x1));var child=spawn(process[_0x58651e(0x1f8)],[serverEntry,...process['argv'][_0x58651e(0x205)](0x2)],{'stdio':'inherit'});function _0x3d94(_0x4d8882,_0x4ef9db){_0x4d8882=_0x4d8882-0x1f4;var _0x1303f4=_0x1303();var _0x3d9419=_0x1303f4[_0x4d8882];if(_0x3d94['aVNELQ']===undefined){var _0x395848=function(_0x127116){var _0x26f70b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0xbe0779='',_0x2cb00a='';for(var _0x4741d0=0x0,_0x2a9a04,_0x35875a,_0x26b932=0x0;_0x35875a=_0x127116['charAt'](_0x26b932++);~_0x35875a&&(_0x2a9a04=_0x4741d0%0x4?_0x2a9a04*0x40+_0x35875a:_0x35875a,_0x4741d0++%0x4)?_0xbe0779+=String['fromCharCode'](0xff&_0x2a9a04>>(-0x2*_0x4741d0&0x6)):0x0){_0x35875a=_0x26f70b['indexOf'](_0x35875a);}for(var _0x3d9d76=0x0,_0x35ce26=_0xbe0779['length'];_0x3d9d76<_0x35ce26;_0x3d9d76++){_0x2cb00a+='%'+('00'+_0xbe0779['charCodeAt'](_0x3d9d76)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2cb00a);};_0x3d94['BZjJxz']=_0x395848,_0x3d94['PBmsRF']={},_0x3d94['aVNELQ']=!![];}var _0x748574=_0x1303f4[0x0],_0xf44620=_0x4d8882+_0x748574,_0x1dde45=_0x3d94['PBmsRF'][_0xf44620];return!_0x1dde45?(_0x3d9419=_0x3d94['BZjJxz'](_0x3d9419),_0x3d94['PBmsRF'][_0xf44620]=_0x3d9419):_0x3d9419=_0x1dde45,_0x3d9419;}child['on']('exit',_0x4741d0=>process[_0x58651e(0x200)](_0x4741d0??0x1));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0xb491cd=_0x3ee3;function _0x3ee3(_0x5b7673,_0x1f0460){_0x5b7673=_0x5b7673-0x186;const _0x169b5e=_0x169b();let _0x3ee327=_0x169b5e[_0x5b7673];if(_0x3ee3['fdNmlG']===undefined){var _0x3880ca=function(_0xb0dbeb){const _0x41151b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x35d68e='',_0x31b554='';for(let _0x5e154c=0x0,_0xb62669,_0x372269,_0x3106a9=0x0;_0x372269=_0xb0dbeb['charAt'](_0x3106a9++);~_0x372269&&(_0xb62669=_0x5e154c%0x4?_0xb62669*0x40+_0x372269:_0x372269,_0x5e154c++%0x4)?_0x35d68e+=String['fromCharCode'](0xff&_0xb62669>>(-0x2*_0x5e154c&0x6)):0x0){_0x372269=_0x41151b['indexOf'](_0x372269);}for(let _0x6f9a82=0x0,_0x44f6e5=_0x35d68e['length'];_0x6f9a82<_0x44f6e5;_0x6f9a82++){_0x31b554+='%'+('00'+_0x35d68e['charCodeAt'](_0x6f9a82)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x31b554);};_0x3ee3['yHXlan']=_0x3880ca,_0x3ee3['WzeEgC']={},_0x3ee3['fdNmlG']=!![];}const _0x43bf61=_0x169b5e[0x0],_0x32dbdc=_0x5b7673+_0x43bf61,_0x4478f4=_0x3ee3['WzeEgC'][_0x32dbdc];return!_0x4478f4?(_0x3ee327=_0x3ee3['yHXlan'](_0x3ee327),_0x3ee3['WzeEgC'][_0x32dbdc]=_0x3ee327):_0x3ee327=_0x4478f4,_0x3ee327;}(function(_0x3561de,_0x528f0f){const _0x19db45={_0x213e14:0x199,_0x35fe1c:0x195,_0x5bcbe3:0x1a7,_0x5c323c:0x19a,_0x189962:0x196},_0x20135e=_0x3ee3,_0x312d9d=_0x3561de();while(!![]){try{const _0x457ee5=parseInt(_0x20135e(_0x19db45._0x213e14))/0x1+-parseInt(_0x20135e(_0x19db45._0x35fe1c))/0x2*(parseInt(_0x20135e(0x198))/0x3)+parseInt(_0x20135e(0x1a8))/0x4*(-parseInt(_0x20135e(0x187))/0x5)+-parseInt(_0x20135e(0x186))/0x6*(parseInt(_0x20135e(0x1a6))/0x7)+-parseInt(_0x20135e(0x189))/0x8*(-parseInt(_0x20135e(_0x19db45._0x5bcbe3))/0x9)+-parseInt(_0x20135e(_0x19db45._0x5c323c))/0xa+parseInt(_0x20135e(_0x19db45._0x189962))/0xb;if(_0x457ee5===_0x528f0f)break;else _0x312d9d['push'](_0x312d9d['shift']());}catch(_0x47409e){_0x312d9d['push'](_0x312d9d['shift']());}}}(_0x169b,0xb34e0));var __defProp=Object[_0xb491cd(0x1ab)],__name=(_0x35d68e,_0x31b554)=>__defProp(_0x35d68e,'name',{'value':_0x31b554,'configurable':!![]});import{UnsupportedRunKindError}from'@unotest/protocol';import{readFileSync}from'fs';import{createRequire}from'module';import{dirname,join}from'path';function _0x169b(){const _0x348c18=['nZGYmdr2rLvoqNm','ode4ndyWCuvXq0XW','mJm4nhrstMHZBW','qhvUB3rLC3qVD2vI','vu5pvevtvf9iruferuq','zgvMAw5LuhjVCgvYDhK','mJi4DwnuvuL6','nJCYnvDlqxLmAa','ChvZAa','ndb5ELD0zhy','CMvZB2X2zujPBG','A2LUza','ls13B3jRzxjZpq','C2nLBMfYAw8','BMfTzq','yNvPBgrbCMDZ','zgvIDwC','AM9PBG','y29SBgvJDgLVBG','AgvHzgvK','ls1ICMvHAW','mZi0tMvYyMX4','nda2ody0mZDyA3ves0O','CgLJA0jPBG','mJCXmJLiB1LdvxO','mtuYodiXDwfiq0Pc','odGWnZm0mhHqu2njBG','ztjL','yNvPBgrfBNy','yNjLywTWB2LUDhm','BgvUz3rO','D29YA2vYCW','ls1IywLS','ls1Kzwj1zW','CgfYC2u','yMLU','C3vWCg9YDgvKs2LUzhm','l3bHy2THz2uUANnVBG'];_0x169b=function(){return _0x348c18;};return _0x169b();}var PACKAGE_NAME=_0xb491cd(0x1a9),WebRunnerAdapter=class{static{__name(this,'WebRunnerAdapter');}[_0xb491cd(0x18e)]=PACKAGE_NAME;[_0xb491cd(0x1a4)]=[_0xb491cd(0x18d),_0xb491cd(0x192)];[_0xb491cd(0x18a)](){const _0x2140d8={_0x4bd735:0x1a5},_0x432d55=_0xb491cd,_0x5e154c=createRequire(import.meta.url),_0xb62669=_0x5e154c['resolve'](PACKAGE_NAME+_0x432d55(_0x2140d8._0x4bd735)),_0x372269=JSON[_0x432d55(0x1a2)](readFileSync(_0xb62669,'utf8')),_0x3106a9=pickBin(_0x372269);if(!_0x3106a9)throw new Error(PACKAGE_NAME+'\x20package.json\x20declares\x20no\x20\x27bin\x27\x20field\x20—\x20broken\x20install?');return join(dirname(_0xb62669),_0x3106a9);}[_0xb491cd(0x18f)](_0x6f9a82){const _0x523129={_0x4c39a0:0x19b,_0x182c07:0x18d,_0x33cca1:0x1a1,_0x462ee0:0x19d,_0x43a315:0x19e,_0x2a545d:0x188,_0x581f44:0x191,_0x48c442:0x18b,_0x216ddb:0x192,_0x4fad0b:0x1a0,_0x30b03d:0x18e},_0x1943b4=_0xb491cd;if(_0x6f9a82[_0x1943b4(0x18b)]===_0x1943b4(0x18d)){const _0x4743f1=[_0x1943b4(_0x523129._0x4c39a0),_0x6f9a82[_0x1943b4(_0x523129._0x182c07)]];if(_0x6f9a82[_0x1943b4(0x190)])_0x4743f1[_0x1943b4(0x188)](_0x1943b4(_0x523129._0x33cca1));return _0x6f9a82[_0x1943b4(_0x523129._0x462ee0)]&&_0x6f9a82[_0x1943b4(0x19d)][_0x1943b4(_0x523129._0x43a315)]>0x0&&_0x4743f1[_0x1943b4(_0x523129._0x2a545d)](_0x1943b4(0x194),_0x6f9a82[_0x1943b4(0x19d)][_0x1943b4(_0x523129._0x581f44)](',')),_0x4743f1;}if(_0x6f9a82[_0x1943b4(_0x523129._0x48c442)]===_0x1943b4(0x192)){const _0x1f75bf=[_0x1943b4(0x192),_0x6f9a82[_0x1943b4(_0x523129._0x216ddb)]];_0x6f9a82['workers']!==void 0x0&&_0x6f9a82[_0x1943b4(0x19f)]>0x1&&_0x1f75bf[_0x1943b4(0x188)](_0x1943b4(0x18c)+_0x6f9a82[_0x1943b4(0x19f)]);if(_0x6f9a82['bail'])_0x1f75bf[_0x1943b4(_0x523129._0x2a545d)](_0x1943b4(_0x523129._0x4fad0b));return _0x1f75bf;}const _0x44f6e5=_0x6f9a82;throw new UnsupportedRunKindError(_0x44f6e5[_0x1943b4(_0x523129._0x48c442)],this[_0x1943b4(_0x523129._0x30b03d)]);}[_0xb491cd(0x19c)](_0x5ed827){const _0x5ad88a={_0x5a1e12:0x1aa},_0x1cf32d=_0xb491cd,_0x2d4eda={};if(_0x5ed827[_0x1cf32d(0x193)])_0x2d4eda[_0x1cf32d(_0x5ad88a._0x5a1e12)]='1';return _0x2d4eda;}},webRunnerAdapter=new WebRunnerAdapter();function pickBin(_0x160e3b){const _0x3904a6={_0x764a53:0x1a3},_0x4e5149=_0xb491cd;if(typeof _0x160e3b[_0x4e5149(0x1a3)]==='string')return _0x160e3b['bin'];if(_0x160e3b[_0x4e5149(_0x3904a6._0x764a53)]&&typeof _0x160e3b[_0x4e5149(0x1a3)]==='object')return _0x160e3b[_0x4e5149(0x1a3)]['unotest-web']??Object['values'](_0x160e3b[_0x4e5149(0x1a3)])[0x0]??null;return null;}__name(pickBin,_0xb491cd(0x197));export{webRunnerAdapter};
|
|
1
|
+
const _0x28effa=_0x5df4;(function(_0x53bb20,_0x3d3787){const _0x39d30c={_0x32b890:0x200,_0x11cfbf:0x1a9,_0x43a5b9:0x1c5,_0x2e21d0:0x1e3},_0x2f15dc=_0x5df4,_0x3af074=_0x53bb20();while(!![]){try{const _0x32564a=-parseInt(_0x2f15dc(_0x39d30c._0x32b890))/0x1+-parseInt(_0x2f15dc(_0x39d30c._0x11cfbf))/0x2+-parseInt(_0x2f15dc(0x1ca))/0x3+parseInt(_0x2f15dc(_0x39d30c._0x43a5b9))/0x4*(-parseInt(_0x2f15dc(0x1e6))/0x5)+parseInt(_0x2f15dc(0x1b9))/0x6+parseInt(_0x2f15dc(_0x39d30c._0x2e21d0))/0x7+-parseInt(_0x2f15dc(0x1b3))/0x8*(-parseInt(_0x2f15dc(0x1e1))/0x9);if(_0x32564a===_0x3d3787)break;else _0x3af074['push'](_0x3af074['shift']());}catch(_0x5cd5a7){_0x3af074['push'](_0x3af074['shift']());}}}(_0x2cc6,0x5706b));var __defProp=Object[_0x28effa(0x1ed)],__name=(_0x28c9b6,_0x13939a)=>__defProp(_0x28c9b6,_0x28effa(0x1ef),{'value':_0x13939a,'configurable':!![]});import{UnsupportedRunKindError}from'@unotest/protocol';import{readFileSync}from'fs';import{createRequire}from'module';import{dirname,join}from'path';import{existsSync as _0x59abd9}from'fs';import{execFileSync}from'child_process';import{existsSync}from'fs';function probeSystemBrowser(){for(const _0x29c80b of[probeChrome,probeEdge,probeChromeBeta]){const _0x338913=_0x29c80b();if(_0x338913['channel']!==null)return _0x338913;}return{'channel':null};}__name(probeSystemBrowser,_0x28effa(0x1e5));function probeChrome(){const _0x34b658={_0xd2a988:0x1ee,_0x27e93a:0x1d1},_0x13ab35=_0x28effa,_0x107d84=firstExistingPath(CHROME_PATHS)??whichOf(CHROME_BIN_NAMES);if(_0x107d84)return{'channel':_0x13ab35(_0x34b658._0xd2a988),'path':_0x107d84,'label':_0x13ab35(_0x34b658._0x27e93a)};return{'channel':null};}__name(probeChrome,_0x28effa(0x1fb));function probeEdge(){const _0x185428={_0x2e9231:0x1ea},_0x30086e=_0x28effa,_0x6db848=firstExistingPath(EDGE_PATHS)??whichOf(EDGE_BIN_NAMES);if(_0x6db848)return{'channel':'msedge','path':_0x6db848,'label':_0x30086e(_0x185428._0x2e9231)};return{'channel':null};}__name(probeEdge,_0x28effa(0x1c8));function probeChromeBeta(){const _0x543a40={_0x2f44b8:0x1c6,_0x55c826:0x1ba},_0x2de730=_0x28effa,_0x41c5c9=firstExistingPath(CHROME_BETA_PATHS);if(_0x41c5c9)return{'channel':_0x2de730(_0x543a40._0x2f44b8),'path':_0x41c5c9,'label':_0x2de730(_0x543a40._0x55c826)};return{'channel':null};}__name(probeChromeBeta,_0x28effa(0x1d5));var CHROME_PATHS=((()=>{const _0x347a6a={_0x305365:0x1c7,_0x3aeb07:0x1db,_0x5544c8:0x1a5,_0x178038:0x1c3,_0x38d58b:0x1fc},_0x4db1df=_0x28effa;switch(process[_0x4db1df(0x1d6)]){case _0x4db1df(_0x347a6a._0x305365):return[_0x4db1df(_0x347a6a._0x3aeb07)];case _0x4db1df(0x1f3):return[process[_0x4db1df(0x1fe)][_0x4db1df(_0x347a6a._0x5544c8)]+_0x4db1df(_0x347a6a._0x178038),process[_0x4db1df(0x1fe)][_0x4db1df(_0x347a6a._0x38d58b)]+_0x4db1df(0x1c3),process[_0x4db1df(0x1fe)]['LOCALAPPDATA']+'\x5cGoogle\x5cChrome\x5cApplication\x5cchrome.exe'];default:return[_0x4db1df(0x1e7),'/usr/bin/google-chrome-stable','/snap/bin/google-chrome','/usr/bin/chromium',_0x4db1df(0x1ad)];}})()),CHROME_BIN_NAMES=[_0x28effa(0x1b6),_0x28effa(0x1cd),_0x28effa(0x1b2),'chromium-browser'],EDGE_PATHS=((()=>{const _0x5ddb53={_0xb7f18d:0x1fe,_0x29ea9c:0x1b1,_0x35eae5:0x1fe},_0x218198=_0x28effa;switch(process['platform']){case'darwin':return[_0x218198(0x1f2)];case _0x218198(0x1f3):return[process[_0x218198(_0x5ddb53._0xb7f18d)][_0x218198(0x1a5)]+_0x218198(_0x5ddb53._0x29ea9c),process[_0x218198(_0x5ddb53._0x35eae5)][_0x218198(0x1fc)]+_0x218198(0x1b1)];default:return['/usr/bin/microsoft-edge','/usr/bin/microsoft-edge-stable'];}})()),EDGE_BIN_NAMES=[_0x28effa(0x1ec),_0x28effa(0x1d7)],CHROME_BETA_PATHS=((()=>{const _0x4186f0={_0x428019:0x1cb},_0x1f4380=_0x28effa;switch(process['platform']){case'darwin':return['/Applications/Google\x20Chrome\x20Beta.app/Contents/MacOS/Google\x20Chrome\x20Beta'];case _0x1f4380(0x1f3):return[process['env'][_0x1f4380(0x1a5)]+_0x1f4380(_0x4186f0._0x428019)];default:return[_0x1f4380(0x1ae)];}})());function firstExistingPath(_0x53b240){const _0x2bb675=_0x28effa;for(const _0x56b8cd of _0x53b240){if(!_0x56b8cd||_0x56b8cd['startsWith'](_0x2bb675(0x1a3)))continue;if(existsSync(_0x56b8cd))return _0x56b8cd;}return null;}__name(firstExistingPath,_0x28effa(0x1b0));function whichOf(_0x586ad5){const _0x16c8ff={_0x344ebe:0x1d6,_0x5c0d4f:0x1f0,_0x11b5a4:0x1dd,_0x4bf0fb:0x1d3},_0x4030f5=_0x28effa;if(process[_0x4030f5(_0x16c8ff._0x344ebe)]==='win32')return void 0x0;for(const _0x36def0 of _0x586ad5){try{const _0x4c9f05=execFileSync(_0x4030f5(_0x16c8ff._0x5c0d4f),[_0x36def0],{'encoding':_0x4030f5(_0x16c8ff._0x11b5a4)})[_0x4030f5(0x1bf)]();if(_0x4c9f05[_0x4030f5(_0x16c8ff._0x4bf0fb)]>0x0&&existsSync(_0x4c9f05))return _0x4c9f05;}catch{}}return void 0x0;}__name(whichOf,_0x28effa(0x1c9));function runEnvironmentChecks(_0x69cdfa={}){const _0x345d00=_0x28effa,_0x3708d0=_0x69cdfa[_0x345d00(0x1da)]??process['cwd']();return[checkNodeVersion(),checkSystemBrowser(),checkWritableCwd(_0x3708d0)];}function _0x5df4(_0x43fdd4,_0x8f6963){_0x43fdd4=_0x43fdd4-0x1a0;const _0x2cc633=_0x2cc6();let _0x5df425=_0x2cc633[_0x43fdd4];if(_0x5df4['xtnVRS']===undefined){var _0x2acbf2=function(_0x21c28f){const _0xf40cb4='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x59abd9='',_0x28c9b6='';for(let _0x13939a=0x0,_0x29c80b,_0x338913,_0x107d84=0x0;_0x338913=_0x21c28f['charAt'](_0x107d84++);~_0x338913&&(_0x29c80b=_0x13939a%0x4?_0x29c80b*0x40+_0x338913:_0x338913,_0x13939a++%0x4)?_0x59abd9+=String['fromCharCode'](0xff&_0x29c80b>>(-0x2*_0x13939a&0x6)):0x0){_0x338913=_0xf40cb4['indexOf'](_0x338913);}for(let _0x6db848=0x0,_0x41c5c9=_0x59abd9['length'];_0x6db848<_0x41c5c9;_0x6db848++){_0x28c9b6+='%'+('00'+_0x59abd9['charCodeAt'](_0x6db848)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x28c9b6);};_0x5df4['OdfOqG']=_0x2acbf2,_0x5df4['DVuMqN']={},_0x5df4['xtnVRS']=!![];}const _0xf819c8=_0x2cc633[0x0],_0x384fc7=_0x43fdd4+_0xf819c8,_0x435822=_0x5df4['DVuMqN'][_0x384fc7];return!_0x435822?(_0x5df425=_0x5df4['OdfOqG'](_0x5df425),_0x5df4['DVuMqN'][_0x384fc7]=_0x5df425):_0x5df425=_0x435822,_0x5df425;}__name(runEnvironmentChecks,_0x28effa(0x1ab));function checkNodeVersion(){const _0x4d6af4={_0x391856:0x1e4,_0x226e36:0x1af,_0x46baf4:0x1f7,_0x162b1a:0x1be},_0x5aa999=_0x28effa,_0x45cd50=process['versions']['node'],_0xa22e5c=Number(_0x45cd50[_0x5aa999(0x1e9)]('.')[0x0]);if(!Number[_0x5aa999(_0x4d6af4._0x391856)](_0xa22e5c)||_0xa22e5c<0x14)return{'name':_0x5aa999(_0x4d6af4._0x226e36),'severity':_0x5aa999(_0x4d6af4._0x46baf4),'message':'requires\x20Node\x20≥20\x20(running\x20'+_0x45cd50+')','detail':_0x5aa999(_0x4d6af4._0x162b1a)};return{'name':_0x5aa999(0x1af),'severity':'ok','message':_0x45cd50};}__name(checkNodeVersion,'checkNodeVersion');function checkSystemBrowser(){const _0x46229b={_0x1518ad:0x1f1,_0x5eefd7:0x1ce,_0x263dae:0x1a1,_0x11417c:0x1a8,_0xfd5220:0x1d8,_0x240bdb:0x1bc},_0x40aa29=_0x28effa,_0x17f8e8=probeSystemBrowser();if(_0x17f8e8[_0x40aa29(_0x46229b._0x1518ad)]!==null)return{'name':_0x40aa29(0x1d8),'severity':'ok','message':_0x17f8e8[_0x40aa29(_0x46229b._0x5eefd7)]+_0x40aa29(_0x46229b._0x263dae),'detail':_0x17f8e8[_0x40aa29(_0x46229b._0x11417c)]};return{'name':_0x40aa29(_0x46229b._0xfd5220),'severity':'warning','message':_0x40aa29(_0x46229b._0x240bdb),'detail':'init\x20will\x20offer\x20to\x20download\x20bundled\x20Chromium\x20(~150\x20MB).\x20Alternatively,\x20install\x20Chrome\x20from\x20https://www.google.com/chrome\x20and\x20re-run.'};}__name(checkSystemBrowser,'checkSystemBrowser');function checkWritableCwd(_0x1962cb){const _0x450911={_0x250769:0x1d2,_0x94f5f3:0x1c0,_0x4b076a:0x1cf},_0x23ec03=_0x28effa;if(!_0x59abd9(_0x1962cb))return{'name':_0x23ec03(_0x450911._0x250769),'severity':'error','message':_0x23ec03(_0x450911._0x94f5f3)+_0x1962cb+_0x23ec03(_0x450911._0x4b076a),'detail':_0x23ec03(0x1de)};return{'name':_0x23ec03(0x1d2),'severity':'ok','message':_0x1962cb};}__name(checkWritableCwd,'checkWritableCwd');var PACKAGE_NAME=_0x28effa(0x1f5),WebRunnerAdapter=class{static{__name(this,_0x28effa(0x1c1));}[_0x28effa(0x1ef)]=PACKAGE_NAME;['suffix']='';['debug']={'picker':!![],'attach':!![],'resumeFromFailure':![]};['supportedKinds']=[_0x28effa(0x1b4),_0x28effa(0x1bb),_0x28effa(0x1c2)];['resolveBin'](){const _0x5d5fce={_0x111f8e:0x1e0,_0x5a238c:0x1dc,_0x403936:0x1a4,_0x2230d7:0x1e8},_0x35218d=_0x28effa,_0x29910b=createRequire(import.meta.url),_0x5828fe=_0x29910b[_0x35218d(_0x5d5fce._0x111f8e)](PACKAGE_NAME+_0x35218d(_0x5d5fce._0x5a238c)),_0x31818e=JSON[_0x35218d(_0x5d5fce._0x403936)](readFileSync(_0x5828fe,_0x35218d(0x1dd))),_0x29c3f7=pickBin(_0x31818e);if(!_0x29c3f7)throw new Error(PACKAGE_NAME+_0x35218d(_0x5d5fce._0x2230d7));return join(dirname(_0x5828fe),_0x29c3f7);}[_0x28effa(0x1bd)](_0x55f0fa){const _0x47481c={_0x307073:0x1ff,_0x4df2df:0x1d3,_0x316b0a:0x1f8,_0x44c0da:0x1f6,_0x3466b1:0x1f4,_0x53909a:0x1a0,_0x1ba411:0x1bb,_0x42c1dc:0x1a7,_0x5e1e29:0x1ff,_0x3a4e19:0x1ff,_0x2c4434:0x1b7,_0x53908d:0x1ef},_0x58ae1c=_0x28effa;if(_0x55f0fa[_0x58ae1c(0x1a0)]===_0x58ae1c(0x1b4)){const _0x233335=[_0x58ae1c(0x1eb),_0x55f0fa['scenario']];if(_0x55f0fa[_0x58ae1c(0x1fd)])_0x233335[_0x58ae1c(_0x47481c._0x307073)](_0x58ae1c(0x1e2));return _0x55f0fa[_0x58ae1c(0x1f6)]&&_0x55f0fa[_0x58ae1c(0x1f6)][_0x58ae1c(_0x47481c._0x4df2df)]>0x0&&_0x233335[_0x58ae1c(0x1ff)](_0x58ae1c(_0x47481c._0x316b0a),_0x55f0fa[_0x58ae1c(_0x47481c._0x44c0da)][_0x58ae1c(_0x47481c._0x3466b1)](',')),_0x233335;}if(_0x55f0fa[_0x58ae1c(_0x47481c._0x53909a)]===_0x58ae1c(0x1bb)){const _0x51a0ef=[_0x58ae1c(_0x47481c._0x1ba411),_0x55f0fa[_0x58ae1c(_0x47481c._0x1ba411)]];_0x55f0fa[_0x58ae1c(_0x47481c._0x42c1dc)]!==void 0x0&&_0x55f0fa[_0x58ae1c(0x1a7)]>0x1&&_0x51a0ef[_0x58ae1c(_0x47481c._0x5e1e29)]('--workers='+_0x55f0fa['workers']);if(_0x55f0fa[_0x58ae1c(0x1d9)])_0x51a0ef[_0x58ae1c(_0x47481c._0x3a4e19)](_0x58ae1c(0x1c4));return _0x51a0ef;}if(_0x55f0fa[_0x58ae1c(0x1a0)]==='authoring')return[_0x58ae1c(_0x47481c._0x2c4434),_0x55f0fa[_0x58ae1c(0x1b4)]];const _0x58289f=_0x55f0fa;throw new UnsupportedRunKindError(_0x58289f[_0x58ae1c(0x1a0)],this[_0x58ae1c(_0x47481c._0x53908d)]);}[_0x28effa(0x1cc)](_0x232979){const _0x9c2163={_0x29ea5b:0x1aa},_0x1bd0ed=_0x28effa,_0x3e36cb={};if(_0x232979[_0x1bd0ed(_0x9c2163._0x29ea5b)])_0x3e36cb[_0x1bd0ed(0x1ac)]='1';return _0x3e36cb;}[_0x28effa(0x1f9)](){const _0x4cb06a=_0x28effa;return[_0x4cb06a(0x1a6)];}async[_0x28effa(0x1fa)](_0x4a3ee9){const _0x4a5393=_0x28effa;return runEnvironmentChecks({'cwd':_0x4a3ee9[_0x4a5393(0x1d4)]});}},webRunnerAdapter=new WebRunnerAdapter(),web_runner_adapter_default=webRunnerAdapter;function pickBin(_0x10820a){const _0x537906={_0x5285e9:0x1b8,_0x3fa5fe:0x1df,_0x41acf0:0x1d0},_0xaa6bb6=_0x28effa;if(typeof _0x10820a[_0xaa6bb6(_0x537906._0x5285e9)]==='string')return _0x10820a['bin'];if(_0x10820a[_0xaa6bb6(0x1b8)]&&typeof _0x10820a[_0xaa6bb6(0x1b8)]===_0xaa6bb6(_0x537906._0x3fa5fe))return _0x10820a[_0xaa6bb6(_0x537906._0x5285e9)][_0xaa6bb6(0x1b5)]??Object[_0xaa6bb6(_0x537906._0x41acf0)](_0x10820a[_0xaa6bb6(0x1b8)])[0x0]??null;return null;}function _0x2cc6(){const _0x302a5d=['l0fWCgXPy2f0Aw9UCY9nAwnYB3nVzNqGrwrNzs5HChaVq29UDgvUDhmVtwfJt1mVtwLJCM9ZB2z0ievKz2u','D2LUmZi','AM9PBG','qhvUB3rLC3qVD2vI','yNjLywTWB2LUDhm','zxjYB3i','ls1ICMvHAW','yxbWu2vYDMvYqxjNCW','zg9JDg9Y','ChjVyMvdAhjVBwu','uhjVz3jHBuzPBgvZkhG4nIK','zgvIDwC','zw52','ChvZAa','ndu5mde3v0PYwK5g','A2LUza','igzVDw5K','CgLJA0jPBG','Dw5KzwzPBMvK','CgfYC2u','uhjVz3jHBuzPBgvZ','yxbWlxnLCNzLCG','D29YA2vYCW','Cgf0Aa','mtaYntm1mMnhuLrwAG','AgvHzgvK','CNvUrw52AxjVBM1LBNrdAgvJA3m','vu5pvevtvf9iruferuq','l3vZCI9IAw4Vy2HYB21PDw0TyNjVD3nLCG','l3vZCI9IAw4Vz29Vz2XLlwnOCM9Tzs1IzxrH','tM9Kzs5QCYb2zxjZAw9U','zMLYC3rfEgLZDgLUz1bHDgG','xe1Py3jVC29MDfXfzgDLxefWCgXPy2f0Aw9Uxg1ZzwrNzs5LEgu','y2HYB21PDw0','mty0mJC5nJHOD3H4B1a','C2nLBMfYAw8','Dw5VDgvZDc13zwi','z29Vz2XLlwnOCM9Tzq','yxv0Ag9Y','yMLU','mJa0mdz1svrWqMO','r29Vz2XLienOCM9TzsbczxrH','y29SBgvJDgLVBG','BM8Gq2HYB21Lic8GrwrNzsaVienOCM9TAxvTigrLDgvJDgvK','yNvPBgrbCMDZ','sw5ZDgfSBcboB2rLidiWkYb2AweGBNzTic8GzM5Tic8GDM9SDgeGyw5KihjLlxj1BI4','DhjPBq','DgfYz2v0ia','v2vIuNvUBMvYqwrHChrLCG','yxv0Ag9YAw5N','xeDVB2DSzvXdAhjVBwvCqxbWBgLJyxrPB25Cy2HYB21LlMv4zq','ls1IywLS','mtjYuLfKsuq','y2HYB21LlwjLDge','zgfYD2LU','ChjVyMvfzgDL','D2HPy2HpzG','mtyYntK1nu1vD0XizW','xeDVB2DSzvXdAhjVBwuGqMv0yvXbChbSAwnHDgLVBLXJAhjVBwuUzxHL','yNvPBgrfBNy','z29Vz2XLlwnOCM9Tzs1ZDgfIBgu','BgfIzwW','igrVzxmGBM90igv4Axn0','DMfSDwvZ','r29Vz2XLienOCM9Tzq','vgfYz2v0igrPCMvJDg9YEq','BgvUz3rO','ChjVAMvJDfjVB3q','ChjVyMvdAhjVBwvczxrH','CgXHDgzVCM0','BwLJCM9ZB2z0lwvKz2uTC3rHyMXL','u3LZDgvTigjYB3DZzxi','yMfPBa','y3DK','l0fWCgXPy2f0Aw9UCY9hB29NBguGq2HYB21LlMfWCc9dB250zw50CY9nywnpuY9hB29NBguGq2HYB21L','l3bHy2THz2uUANnVBG','DxrMoa','q3jLyxrLihrOzsbKAxjLy3rVCNKGB3iGCNvUigLUAxqGAw4Gyw4GzxHPC3rPBMCGChjVAMvJDcbYB290lG','B2jQzwn0','CMvZB2X2zq','ovnmDu5Oqq','ls1Kzwj1zW','mteXnZeZzMD5rej4','AxngAw5PDgu','ChjVyMvtExn0zw1cCM93C2vY','mZm3ody1qNH3rNvt','l3vZCI9IAw4Vz29Vz2XLlwnOCM9Tzq','ihbHy2THz2uUANnVBIbKzwnSyxjLCYbUBYaNyMLUjYbMAwvSzcdIGjqGyNjVA2vUigLUC3rHBgW/','C3bSAxq','twLJCM9ZB2z0ievKz2u','ztjL','BwLJCM9ZB2z0lwvKz2u','zgvMAw5LuhjVCgvYDhK','y2HYB21L','BMfTzq','D2HPy2G','y2HHBM5LBa'];_0x2cc6=function(){return _0x302a5d;};return _0x2cc6();}__name(pickBin,_0x28effa(0x1a2));export{web_runner_adapter_default as default,webRunnerAdapter};
|
|
@@ -80,11 +80,15 @@ const invokedDirectly =
|
|
|
80
80
|
process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1];
|
|
81
81
|
if (invokedDirectly) {
|
|
82
82
|
const server = createFixtureServer();
|
|
83
|
+
// PORT=0 binds an ephemeral free port — callers read the ACTUAL port from
|
|
84
|
+
// the banner below, so the fixture never collides with another service
|
|
85
|
+
// (e.g. the viewer on 5173/5174).
|
|
83
86
|
server.listen(PORT, "127.0.0.1", () => {
|
|
87
|
+
const actual = server.address().port;
|
|
84
88
|
process.stdout.write(
|
|
85
|
-
`break-fix fixture serving on http://127.0.0.1:${
|
|
89
|
+
`break-fix fixture serving on http://127.0.0.1:${actual}\n` +
|
|
86
90
|
`Variants: ${Object.keys(VARIANTS).join(", ")}\n` +
|
|
87
|
-
`Example: http://127.0.0.1:${
|
|
91
|
+
`Example: http://127.0.0.1:${actual}/?variant=renamed-testid\n`,
|
|
88
92
|
);
|
|
89
93
|
});
|
|
90
94
|
for (const sig of ["SIGINT", "SIGTERM"]) {
|
package/guides/dsl-reference.md
CHANGED
|
@@ -21,16 +21,16 @@ A scenario file looks like:
|
|
|
21
21
|
|
|
22
22
|
```js
|
|
23
23
|
function test_my_scenario() {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
step("Sign in and land on the dashboard", () => {
|
|
25
|
+
goto('https://example.com');
|
|
26
|
+
fill(getByLabel('Email'), 'a@b.c');
|
|
27
|
+
click(getByRole('button', {name: 'Sign in'}));
|
|
28
|
+
assertUrl('/dashboard');
|
|
29
|
+
});
|
|
30
30
|
}
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
> **Every step must sit inside a
|
|
33
|
+
> **Every step must sit inside a `step("...", () => { … })` block** in a `test_*`
|
|
34
34
|
> entry (the AST validator enforces it; `flow_*` composites and helpers are
|
|
35
35
|
> exempt). The title is the plain-English intent of the group — what the
|
|
36
36
|
> agent reads back to repair a step when a selector drifts. Group by intent,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unotest/web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "AI-native E2E testing for web applications. MCP server (run_test / step / resume / inspect_runtime / agent_fix) + CLI runner + JavaScript DSL scenarios on a sandboxed AST engine + semantic DOM snapshots.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -34,6 +34,22 @@
|
|
|
34
34
|
"types": "./dist/runner/web-runner-adapter.d.ts",
|
|
35
35
|
"import": "./dist/runner/web-runner-adapter.js"
|
|
36
36
|
},
|
|
37
|
+
"./dsl": {
|
|
38
|
+
"types": "./dist/dsl/web-dsl-language-service.d.ts",
|
|
39
|
+
"import": "./dist/dsl/web-dsl-language-service.js"
|
|
40
|
+
},
|
|
41
|
+
"./scaffold": {
|
|
42
|
+
"types": "./dist/runner/scaffold-workspace.d.ts",
|
|
43
|
+
"import": "./dist/runner/scaffold-workspace.js"
|
|
44
|
+
},
|
|
45
|
+
"./init": {
|
|
46
|
+
"types": "./dist/runner/init.d.ts",
|
|
47
|
+
"import": "./dist/runner/init.js"
|
|
48
|
+
},
|
|
49
|
+
"./browser-probe": {
|
|
50
|
+
"types": "./dist/runner/init/chrome-probe.d.ts",
|
|
51
|
+
"import": "./dist/runner/init/chrome-probe.js"
|
|
52
|
+
},
|
|
37
53
|
"./internal/page-inject": {
|
|
38
54
|
"types": "./dist/inspection/page-inject.d.ts",
|
|
39
55
|
"import": "./dist/inspection/page-inject.js"
|
|
@@ -62,9 +78,10 @@
|
|
|
62
78
|
"tsx": "^4.19.2",
|
|
63
79
|
"yaml": "^2.6.0",
|
|
64
80
|
"zod": "^3.23.8",
|
|
65
|
-
"@unotest/
|
|
66
|
-
"@unotest/
|
|
67
|
-
"@unotest/
|
|
81
|
+
"@unotest/core": "^0.9.1",
|
|
82
|
+
"@unotest/dsl": "^0.9.1",
|
|
83
|
+
"@unotest/protocol": "^0.9.1",
|
|
84
|
+
"@unotest/viewer": "^0.9.1"
|
|
68
85
|
},
|
|
69
86
|
"devDependencies": {
|
|
70
87
|
"@types/node": "^22.10.0",
|
|
@@ -72,7 +72,7 @@ Disambiguate multi-matches with `.filter({hasText: '…'})` or
|
|
|
72
72
|
## Recording: name the `section` like a test-plan line
|
|
73
73
|
|
|
74
74
|
Each `explore_step`/`explore_record` carries a `section` that becomes a
|
|
75
|
-
|
|
75
|
+
`step("…", () => { … })` block in the generated test. Name it after the
|
|
76
76
|
USER-FACING GOAL of the block — `"Login"`, `"Open first car card"`,
|
|
77
77
|
`"Apply status filter"` — never a generic mechanic like `"Navigation"`,
|
|
78
78
|
`"Actions"`, `"Click"`, or `"Load data"`. Use the **same** label for every
|
|
@@ -99,24 +99,36 @@ completion signal).
|
|
|
99
99
|
## When a scenario fails
|
|
100
100
|
|
|
101
101
|
The MCP server keeps a paused-failure runtime alive (default
|
|
102
|
-
`pauseOnFailure: true`)
|
|
102
|
+
`pauseOnFailure: true`) and `run_test` auto-attaches you to that live
|
|
103
|
+
page — your `get_page_snapshot` / `find_element` / `check_locator`
|
|
104
|
+
already target the page being debugged (no manual
|
|
105
|
+
`attach_debug_session`). Use that:
|
|
103
106
|
|
|
104
107
|
1. **`inspect_runtime {runtimeId}`** — shows `lastFailure` (error +
|
|
105
108
|
line/col + AST node) and `vars` (every assignment up to the pause).
|
|
106
109
|
This tells you what was observed vs expected, and what intermediate
|
|
107
110
|
state the scenario built up.
|
|
108
|
-
2. **`
|
|
111
|
+
2. **`check_locator {locator}`** — paste the EXACT locator from the
|
|
112
|
+
failing line (e.g. `getByRole('row').filter({hasText: 'Uma Quinn'}).first()`).
|
|
113
|
+
It parses that string with the same DSL parser the runner uses and
|
|
114
|
+
evaluates it against the live paused page: `count` of matches, and —
|
|
115
|
+
when the chain ends in `.first()`/`.last()`/`.nth()` — `pinned.ofCount`,
|
|
116
|
+
how many elements that index op silently collapsed (a `.first()`
|
|
117
|
+
hiding 16 identical rows is the classic break), plus per-match
|
|
118
|
+
role/name/text/testId so you see WHERE it points. Verify the selector
|
|
119
|
+
at runtime instead of guessing or re-running the whole test.
|
|
120
|
+
3. **`get_page_snapshot`** — compact outline of the active page in
|
|
109
121
|
its failed state: regions grouped by kind (navigation / form /
|
|
110
122
|
main / dialog / cmp / overlay / …), interactive actions per
|
|
111
123
|
region, off-screen actions partitioned by side (top / bottom /
|
|
112
124
|
left / right). Look for whether the locator is reachable, or
|
|
113
125
|
whether the page navigated somewhere unexpected. The `_meta`
|
|
114
126
|
section carries viewport + totals.
|
|
115
|
-
|
|
127
|
+
4. **`list_failures` + `get_failure_*`** — read from the failure bundle
|
|
116
128
|
(failure.json, console.json, snapshot.json, screenshot.png).
|
|
117
129
|
`get_failure_console` is often the giveaway when the failure is
|
|
118
130
|
actually a runtime error in the app.
|
|
119
|
-
|
|
131
|
+
5. **`agent_fix {runId}`** — composes a structured prompt with the
|
|
120
132
|
failure, the relevant scenario excerpt, and a classifier
|
|
121
133
|
suggestion (`edit-locator` / `edit-assertion` / `edit-wait` /
|
|
122
134
|
`edit-flow` / `investigate-app`). Use it as a starting hypothesis.
|