@unotest/web 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/write-e2e-test/SKILL.md +136 -44
- package/.claude/skills/write-e2e-test-ground/SKILL.md +784 -0
- package/CHANGELOG.md +210 -0
- package/dist/config/schema.d.ts +104 -14
- package/dist/config/schema.js +1 -1
- package/dist/driver/index.d.ts +5 -2
- package/dist/driver/index.js +1 -1
- package/dist/dsl/index.d.ts +36 -106
- package/dist/dsl/index.js +1 -1
- package/dist/dsl/web-dsl-language-service.js +1 -1
- package/dist/inspection/page-inject.d.ts +11 -35
- package/dist/inspection/page-inject.js +173 -1032
- package/dist/{interfaces-dbZG10RS.d.ts → interfaces-BxviHxnr.d.ts} +42 -3
- package/dist/mcp/server.js +1 -1
- package/dist/runner/cli.d.ts +1 -13
- package/dist/runner/cli.js +1 -1
- package/dist/runner/init/chrome-probe.js +1 -1
- 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.js +1 -1
- package/dist/runner/serve-fixture.js +1 -1
- package/dist/runner/web-runner-adapter.js +1 -1
- package/examples/fixtures/break-fix-app/serve.mjs +6 -2
- package/guides/agent-integration.md +103 -2
- package/guides/dsl-reference.md +139 -13
- package/package.json +18 -8
- package/src/mcp/prompts/agent-test-author.md +75 -4
package/dist/driver/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x296b36=_0x5f64;(function(_0x1acf4e,_0x1dbb8d){const _0x429dc7={_0x40bd21:0x1b4,_0x43c267:0x1bf,_0x502089:0x1a3,_0x4648b1:0x1a2,_0x52b286:0x1cb,_0x5aab0b:0x1aa},_0x5f2dfa=_0x5f64,_0x1f5773=_0x1acf4e();while(!![]){try{const _0x33f5e3=parseInt(_0x5f2dfa(0x19e))/0x1*(-parseInt(_0x5f2dfa(_0x429dc7._0x40bd21))/0x2)+-parseInt(_0x5f2dfa(_0x429dc7._0x43c267))/0x3*(parseInt(_0x5f2dfa(_0x429dc7._0x502089))/0x4)+parseInt(_0x5f2dfa(0x179))/0x5*(parseInt(_0x5f2dfa(_0x429dc7._0x4648b1))/0x6)+parseInt(_0x5f2dfa(0x1c7))/0x7*(parseInt(_0x5f2dfa(0x1c1))/0x8)+parseInt(_0x5f2dfa(_0x429dc7._0x52b286))/0x9+-parseInt(_0x5f2dfa(0x1e0))/0xa*(-parseInt(_0x5f2dfa(0x1ab))/0xb)+parseInt(_0x5f2dfa(_0x429dc7._0x5aab0b))/0xc;if(_0x33f5e3===_0x1dbb8d)break;else _0x1f5773['push'](_0x1f5773['shift']());}catch(_0x4574e7){_0x1f5773['push'](_0x1f5773['shift']());}}}(_0x1962,0xea106));function _0x1962(){const _0x1c9380=['ywn0AxzLswr4','y2fSBhngB3i','D2fPDezVCLrLEhq','CMvJB3jKzxi','m0nQwKj3qW','y29VA2LLCW','mZKYofzbtuPXDW','DgL0Bgu','y2XVC2u','Aw5ZCgvJDevSzw1LBNq','zMLSBa','CgfNzsbPBMrLEcbVDxqGB2yGCMfUz2u','mJG4nfLRu0f0Ca','zhjPDMvY','zNjHBwvezxb0Aa','y3r4','ndCXntK2ngzLwLvuBG','Bg9JywXtDg9YywDLu3rHDgu','pgrPDJ48l2rPDJ4','zMfRzs1WBMC','y291BNq','CMvSB2fK','y29UC29SzuvUDhjPzxm','DxbSB2fKrMLSzq','D2fPDezVCG','Bwv0Ag9K','AxnwAxnPyMXL','BMv0D29YA0vUDhjPzxm','z2v0tg9JywXtDg9YywDL','rMfRzunVBNrLEhq','C2f2zvn0B3jHz2vtDgf0zq','yMvOyxzPB3i','Cg9WDxbpBKnSAwnR','Cg9W','lNbHz2uW','zxzHBhvHDgu','zg91yMXLq2XPy2S','mtyZmeftC3DmwG','ywrK','C2nYB2XSsw50B1zPzxC','BMfTzq','y3vYCMvUDfvYBa','y2fSBhm','y29UDgv4Da','Aw5PDgLHBfvYBa','yxr0ywnOrxHPC3rPBMC','BM8Gywn0AxzLihbHz2uGAw4Gy29UDgv4Da','zw50zxjgCMfTzsbJywXSzwqGD2L0AcbLBxb0EsbSB2nHDg9Y','C2v0qwn0AxzLugfNzq','C2v0tg9JywXtDg9YywDL','zxHPDezYyw1L','CMvM','z290BW','Bwf5yMvuAhjVDW','zNjVBq','zhjHz0fUzerYB3a','C2nVCgu','ntiZnteWDez1CMDT','Bgf1BMnOzwq','Bg9JywXtDg9YywDL','CMvJB3jK','zwXLBwvUDeHPBNrcEvjLzG','z2v0q29VA2LL','BMv3q29UDgv4Da','B25bzNrLCKnSAwnR','zxHPDezYyw1LignHBgXLzcb3AxrOig5VigzYyw1Lig9UihrOzsbZDgfJAW','C2v0q29VA2LL','zxzHBhvHDgvpBKXVy2f0B3i','vw5VDgvZDevYCM9Y','B3v0zxjive1m','D3nfBMrWB2LUDa','Dw5JAgvJAW','zgvSzxrL','Aw5WDxrwywX1zq','Bgf1BMnO','y2XPCgjVyxjKugfZDgu','zxjYB3jpBK5LEhrby3rPB24','z29gB3j3yxjK','A2LUza','C3rLChm','iJ48l2rPDJ4','y29UBMvJDfnOyxjLzcbUB3qGC3vWCg9YDgvKigj5iezHA2vxzwjeCML2zxi','ywjVDxq6yMXHBMS','y29VA2LLu3rHDgu','D2fPDezVCK5HDMLNyxrPB24','CgfNzuXPC3q','C2vSzwn0t3b0Aw9U','y2fWDhvYzvn0ywnRvhjHy2u','Dgv4DenVBNrLBNq','DxjS','C2nYzwvUC2HVDa','B25ozxDqywDL','z29cywnR','B3v0zxjiDg1SqNLszwy','mLfWALngtG','Dgv4DenVBNrLBNrcEurLzMf1Bhq','D2fPDezVCLvYBa','pgrPDIbKyxrHlxvUB3rLC3qTCMvMpsi','mJreCgf0yw4','mtq0mtmWofPMCgTMtq','y2XPy2S','ChjLC3m','zNjHBwvtDgfJAW','rhjPDMvYrxjYB3i','AxnwAxnPyMXLqNLezwzHDwX0','zMLSDgvY','mtGWotK2nZj5y3byBum','mJy5mtD4ze14DwK','Ag92zxi','z2v0qxr0CMLIDxrL','ChvZAa','BMv3ugfNzuXPC3rLBMvYCW','zNvUy3rPB24','zMfRzsb0AxrSzq','BgvUz3rO','lNbHz2u','mtCZmZiXmfbwEKL1Da','ywn0AxzLugfNzq','zgvMAw5LuhjVCgvYDhK','yxr0CMLIDxrLC0j5rgvMyxvSDa','y29UDgv4Dhm','CgfNzxm','BMv3q29UDgv4DcbJywXSzwqGyMvMB3jLigXHDw5JAcGP'];_0x1962=function(){return _0x1c9380;};return _0x1962();}var __defProp=Object[_0x296b36(0x1b6)],__name=(_0x100bd0,_0x539b66)=>__defProp(_0x100bd0,_0x296b36(0x1e3),{'value':_0x539b66,'configurable':!![]}),UnotestError=class extends Error{static{__name(this,_0x296b36(0x184));}[_0x296b36(0x1e6)];constructor(_0x201fea,_0xd99b6c={}){const _0x153cac={_0x45f7d5:0x1e6},_0x3083bd=_0x296b36;super(_0x201fea),this['name']=new.target.name,this[_0x3083bd(_0x153cac._0x45f7d5)]=Object['freeze']({..._0xd99b6c}),typeof Error[_0x3083bd(0x197)]===_0x3083bd(0x1b0)&&Error['captureStackTrace'](this,new.target);}},DriverError=class extends UnotestError{static{__name(this,_0x296b36(0x1a7));}},LocatorError=class extends UnotestError{static{__name(this,'LocatorError');}};function createRecorder(){const _0x4a79d3={_0x901da9:0x1ae,_0x430069:0x1e5},_0x5d68a9=_0x296b36,_0x1e1827=[];let _0xf6002d=0x0;return{'push':__name(_0x3b25b0=>_0x1e1827[_0x5d68a9(0x1ae)]({..._0x3b25b0,'seq':_0xf6002d++}),_0x5d68a9(_0x4a79d3._0x901da9)),'calls':__name(()=>_0x1e1827,_0x5d68a9(_0x4a79d3._0x430069))};}function _0x5f64(_0x510958,_0x4716c0){_0x510958=_0x510958-0x175;const _0x1962fd=_0x1962();let _0x5f6484=_0x1962fd[_0x510958];if(_0x5f64['fvghhS']===undefined){var _0x19966e=function(_0x432983){const _0x5e3af4='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x100bd0='',_0x539b66='';for(let _0x201fea=0x0,_0xd99b6c,_0x1e1827,_0xf6002d=0x0;_0x1e1827=_0x432983['charAt'](_0xf6002d++);~_0x1e1827&&(_0xd99b6c=_0x201fea%0x4?_0xd99b6c*0x40+_0x1e1827:_0x1e1827,_0x201fea++%0x4)?_0x100bd0+=String['fromCharCode'](0xff&_0xd99b6c>>(-0x2*_0x201fea&0x6)):0x0){_0x1e1827=_0x5e3af4['indexOf'](_0x1e1827);}for(let _0x3b25b0=0x0,_0x5dfd92=_0x100bd0['length'];_0x3b25b0<_0x5dfd92;_0x3b25b0++){_0x539b66+='%'+('00'+_0x100bd0['charCodeAt'](_0x3b25b0)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x539b66);};_0x5f64['IxKrmA']=_0x19966e,_0x5f64['CSvVAV']={},_0x5f64['fvghhS']=!![];}const _0x5c3678=_0x1962fd[0x0],_0x1a31b8=_0x510958+_0x5c3678,_0x5483b0=_0x5f64['CSvVAV'][_0x1a31b8];return!_0x5483b0?(_0x5f6484=_0x5f64['IxKrmA'](_0x5f6484),_0x5f64['CSvVAV'][_0x1a31b8]=_0x5f6484):_0x5f6484=_0x5483b0,_0x5f6484;}__name(createRecorder,'createRecorder');var FakePage=class{constructor(_0x5dfd92,_0xc540e5,_0x5bd9b6,_0x4ef2d2){const _0x84c8b=_0x296b36;this[_0x84c8b(0x1be)]=_0x5dfd92,this['behavior']=_0xc540e5,this[_0x84c8b(0x178)]=_0x5bd9b6,this[_0x84c8b(0x1e4)]=_0x4ef2d2;}[_0x296b36(0x1be)];[_0x296b36(0x1da)];[_0x296b36(0x178)];static{__name(this,'FakePage');}['currentUrl'];[_0x296b36(0x180)];['record'](_0x28f14c,_0x11c42f){const _0x25a7f0={_0x4b65d1:0x1be,_0x3f3045:0x1ae,_0x396219:0x178},_0x1425fe=_0x296b36;this[_0x1425fe(_0x25a7f0._0x4b65d1)][_0x1425fe(_0x25a7f0._0x3f3045)]({'scope':this[_0x1425fe(_0x25a7f0._0x396219)],'method':_0x28f14c,'args':_0x11c42f});}[_0x296b36(0x175)](){const _0x118dbb={_0x4871da:0x18c,_0x4de42c:0x18c},_0x5a0851=_0x296b36;if(this['behavior'][_0x5a0851(_0x118dbb._0x4871da)]){const _0xea31f3=this[_0x5a0851(0x1da)][_0x5a0851(0x18c)];this[_0x5a0851(0x1da)][_0x5a0851(_0x118dbb._0x4de42c)]=void 0x0;throw _0xea31f3;}}[_0x296b36(0x199)](){const _0x362662={_0x3da611:0x1e4},_0x7870ae=_0x296b36;return this[_0x7870ae(_0x362662._0x3da611)];}async[_0x296b36(0x1c2)](){const _0x2837f5={_0x3071dc:0x1b1},_0x18b9a7=_0x296b36;return this[_0x18b9a7(0x17c)](_0x18b9a7(0x1c2),[]),_0x18b9a7(_0x2837f5._0x3071dc);}async[_0x296b36(0x1a4)](_0x568efa,_0x2342f0){const _0xfde242={_0x489ee8:0x17c,_0x298864:0x175},_0x3b618e=_0x296b36;this[_0x3b618e(_0xfde242._0x489ee8)]('click',[_0x568efa,_0x2342f0]),this[_0x3b618e(_0xfde242._0x298864)](),this[_0x3b618e(0x180)]?.();}async[_0x296b36(0x1df)](_0x69c3b,_0x533caa){this['record']('doubleClick',[_0x69c3b,_0x533caa]),this['maybeThrow']();}async[_0x296b36(0x1c5)](_0x504844,_0xd775e7,_0x5ba254){const _0x40a8ea=_0x296b36;this['record'](_0x40a8ea(0x1c5),[_0x504844,_0xd775e7,_0x5ba254]),this[_0x40a8ea(0x175)]();}async['press'](_0x2c3ed1,_0x30ed20,_0x5353bd){const _0x111a76=_0x296b36;this[_0x111a76(0x17c)](_0x111a76(0x1a5),[_0x2c3ed1,_0x30ed20,_0x5353bd]),this['maybeThrow']();}async['check'](_0x525b87,_0x4d7eb6){const _0x3ae924=_0x296b36;this['record']('check',[_0x525b87,_0x4d7eb6]),this[_0x3ae924(0x175)]();}async[_0x296b36(0x187)](_0x20014c,_0x9e8840){const _0x536ac1=_0x296b36;this[_0x536ac1(0x17c)](_0x536ac1(0x187),[_0x20014c,_0x9e8840]),this['maybeThrow']();}async['selectOption'](_0x51dc2e,_0x24c528,_0x4659cd){const _0x3f0818={_0x2e65fd:0x196},_0x55cfcc=_0x296b36;this[_0x55cfcc(0x17c)](_0x55cfcc(_0x3f0818._0x2e65fd),[_0x51dc2e,_0x24c528,_0x4659cd]),this[_0x55cfcc(0x175)]();}async[_0x296b36(0x1ac)](_0x2d604c,_0x3562e5){const _0x4aaaf9={_0x520562:0x17c,_0x52e862:0x1ac},_0x5ad5e7=_0x296b36;this[_0x5ad5e7(_0x4aaaf9._0x520562)](_0x5ad5e7(_0x4aaaf9._0x52e862),[_0x2d604c,_0x3562e5]),this['maybeThrow']();}async[_0x296b36(0x1e2)](_0x46b31b){const _0x29ae1f={_0x588760:0x1e2,_0x4da923:0x175},_0x2d1c5f=_0x296b36;this['record'](_0x2d1c5f(_0x29ae1f._0x588760),[_0x46b31b]),this[_0x2d1c5f(_0x29ae1f._0x4da923)]();}async[_0x296b36(0x177)](_0x1c08e1,_0xdd2ed2,_0x34aaaa){const _0x472dc8=_0x296b36;this['record']('dragAndDrop',[_0x1c08e1,_0xdd2ed2,_0x34aaaa]),this[_0x472dc8(0x175)]();}async[_0x296b36(0x1d2)](_0x1e6e05,_0x20e4ea){const _0x4695f6=_0x296b36;this[_0x4695f6(0x17c)](_0x4695f6(0x1d2),[_0x1e6e05,_0x20e4ea]),this[_0x4695f6(0x175)]();}async[_0x296b36(0x18b)](_0x3a5090,_0xb228eb){const _0x2156f0={_0x3be53b:0x17c},_0x464b95=_0x296b36;this[_0x464b95(_0x2156f0._0x3be53b)]('clipboardPaste',[_0x3a5090,_0xb228eb]),this['maybeThrow']();}async[_0x296b36(0x1cf)](_0x520a71){const _0x3f75e4={_0x20a857:0x1cf},_0x61c2ee=_0x296b36;return this[_0x61c2ee(0x17c)](_0x61c2ee(_0x3f75e4._0x20a857),[_0x520a71]),this[_0x61c2ee(0x1da)]['countByDefault']??0x1;}async[_0x296b36(0x198)](_0x4f1e0e){const _0x209b1f={_0x546a1e:0x17c},_0x1e1630=_0x296b36;return this[_0x1e1630(_0x209b1f._0x546a1e)](_0x1e1630(0x198),[_0x4f1e0e]),this[_0x1e1630(0x1da)][_0x1e1630(0x19f)]??'';}async[_0x296b36(0x189)](_0x5f0556){const _0x83daa7={_0x220816:0x189},_0x48837e=_0x296b36;return this[_0x48837e(0x17c)](_0x48837e(_0x83daa7._0x220816),[_0x5f0556]),this[_0x48837e(0x1da)]['inputValueByDefault']??'';}async[_0x296b36(0x1d5)](_0x170409){const _0x342ecd={_0x12dee5:0x1a8},_0x686a1c=_0x296b36;return this[_0x686a1c(0x17c)]('isVisible',[_0x170409]),this['behavior'][_0x686a1c(_0x342ecd._0x12dee5)]??!![];}async[_0x296b36(0x1ad)](_0x46c2ff,_0x419d99){const _0x53e140={_0x8b585d:0x1ad},_0x4d8d6a=_0x296b36;return this['record'](_0x4d8d6a(_0x53e140._0x8b585d),[_0x46c2ff,_0x419d99]),this['behavior'][_0x4d8d6a(0x1b7)]?.[_0x419d99]??null;}async['waitFor'](_0x4d57c3,_0x465eba){const _0x42565a=_0x296b36;this[_0x42565a(0x17c)](_0x42565a(0x1d3),[_0x4d57c3,_0x465eba]);}async[_0x296b36(0x1a0)](_0x17a56e,_0x1fdb1d){const _0x40042a={_0x1d2d0b:0x1a0},_0x505a9d=_0x296b36;this[_0x505a9d(0x17c)](_0x505a9d(_0x40042a._0x1d2d0b),[_0x17a56e,_0x1fdb1d]);}async[_0x296b36(0x1bd)](_0x417253,_0x4895d6){const _0x36f643=_0x296b36;this[_0x36f643(0x17c)](_0x36f643(0x1bd),[_0x417253,_0x4895d6]);}async[_0x296b36(0x194)](_0x265f32){const _0x166b94={_0x339d8c:0x17c,_0x5d92a9:0x194},_0x4c5e34=_0x296b36;this[_0x4c5e34(_0x166b94._0x339d8c)](_0x4c5e34(_0x166b94._0x5d92a9),[_0x265f32]);}async[_0x296b36(0x1ef)](_0x234efd,_0x2e2032){const _0x17bb70={_0xf3f622:0x1e4},_0x249e99=_0x296b36;this[_0x249e99(0x17c)]('goto',[_0x234efd,_0x2e2032]),this[_0x249e99(_0x17bb70._0xf3f622)]=_0x234efd;}async[_0x296b36(0x1d0)](_0x261dc2){const _0x4b4af0={_0x261f4a:0x1d0},_0xd75d65=_0x296b36;this[_0xd75d65(0x17c)](_0xd75d65(_0x4b4af0._0x261f4a),[_0x261dc2]);}async['goBack'](_0x13c9e1){const _0x227cf={_0x4aef97:0x17c,_0x40422d:0x19c},_0xc91637=_0x296b36;this[_0xc91637(_0x227cf._0x4aef97)](_0xc91637(_0x227cf._0x40422d),[_0x13c9e1]);}async[_0x296b36(0x18d)](_0x4b99be){const _0x5716d6=_0x296b36;this[_0x5716d6(0x17c)](_0x5716d6(0x18d),[_0x4b99be]);}async[_0x296b36(0x1de)](_0x3601ef){const _0x5c6dcc={_0x67dbd3:0x1de},_0x50f6a3=_0x296b36;return this['record'](_0x50f6a3(_0x5c6dcc._0x67dbd3),[_0x3601ef]),void 0x0;}async[_0x296b36(0x183)](_0x1432c4,_0x933df1){const _0x64e510={_0x137d10:0x17c},_0x1507f3=_0x296b36;return this[_0x1507f3(_0x64e510._0x137d10)](_0x1507f3(0x183),[_0x1432c4,_0x933df1]),void 0x0;}async[_0x296b36(0x1c4)](_0x44dfed){const _0x479838={_0x4c1a42:0x17c},_0x361d00=_0x296b36;this[_0x361d00(_0x479838._0x4c1a42)]('inspectElement',[_0x44dfed]);if(_0x44dfed['steps'][_0x361d00(0x1b2)]!==0x1||_0x44dfed['steps'][0x0]['kind']!==_0x361d00(0x1ee))return null;const _0xc99efe=_0x44dfed[_0x361d00(0x18f)][0x0]['ref'],_0x12d4ce=this[_0x361d00(0x1da)][_0x361d00(0x17d)]?.[_0xc99efe];return _0x12d4ce??null;}async[_0x296b36(0x19a)](_0x250a65){const _0xa5b0d7={_0x2e9505:0x19a,_0x5f1dea:0x1ce},_0x2a4e66=_0x296b36;return this['record'](_0x2a4e66(_0xa5b0d7._0x2e9505),[_0x250a65]),Buffer[_0x2a4e66(0x176)](_0x2a4e66(_0xa5b0d7._0x5f1dea));}async[_0x296b36(0x185)](_0x2b19ef){const _0x13a361={_0xa02dc9:0x18e,_0x100be7:0x1ee,_0x25a25c:0x19d,_0x335ec6:0x1a1,_0x11d2ba:0x1cd},_0x51417a=_0x296b36;this[_0x51417a(0x17c)](_0x51417a(0x185),[_0x2b19ef]);if(_0x2b19ef[_0x51417a(0x18f)][_0x51417a(0x1b2)]===0x1&&_0x2b19ef['steps'][0x0][_0x51417a(_0x13a361._0xa02dc9)]==='ref'){const _0x1faaa5=_0x2b19ef['steps'][0x0][_0x51417a(_0x13a361._0x100be7)];return this[_0x51417a(0x1da)][_0x51417a(_0x13a361._0x25a25c)]?.[_0x1faaa5]??_0x51417a(_0x13a361._0x335ec6)+_0x1faaa5+_0x51417a(0x190);}return _0x51417a(_0x13a361._0x11d2ba);}},FakeContext=class{constructor(_0x596efe,_0x460b56,_0xb2bcaa){const _0x33e95b={_0xe3b909:0x1be,_0x2b8a29:0x1dd,_0x1d36b3:0x180,_0x3158e6:0x193},_0x5a2aba=_0x296b36;this[_0x5a2aba(_0x33e95b._0xe3b909)]=_0x596efe,this[_0x5a2aba(0x1da)]=_0x460b56,this[_0x5a2aba(0x178)]=_0xb2bcaa;const _0x5bbc2b=new FakePage(_0x596efe,_0x460b56,_0xb2bcaa+_0x5a2aba(_0x33e95b._0x2b8a29),_0x460b56[_0x5a2aba(0x1e7)]??_0x5a2aba(0x192));_0x460b56['popupOnClick']&&(_0x5bbc2b[_0x5a2aba(_0x33e95b._0x1d36b3)]=()=>{const _0x2dba7b=_0x5a2aba;this['emitFakePopup'](_0x460b56[_0x2dba7b(0x1db)]);}),this[_0x5a2aba(0x195)]=[_0x5bbc2b],this['localStorageState']={..._0x460b56[_0x5a2aba(0x17b)]??{}},this[_0x5a2aba(_0x33e95b._0x3158e6)]={..._0x460b56[_0x5a2aba(0x1c0)]??{}};}[_0x296b36(0x1be)];[_0x296b36(0x1da)];[_0x296b36(0x178)];static{__name(this,_0x296b36(0x1d8));}[_0x296b36(0x195)];[_0x296b36(0x1bb)]=0x0;[_0x296b36(0x1a6)]=[];['localStorageState'];[_0x296b36(0x193)];[_0x296b36(0x1af)]=new Set();[_0x296b36(0x17c)](_0x121ef5,_0x4f9530){const _0x38ae7f={_0x47f092:0x1be,_0x504274:0x1ae,_0x43990d:0x178},_0x3b036a=_0x296b36;this[_0x3b036a(_0x38ae7f._0x47f092)][_0x3b036a(_0x38ae7f._0x504274)]({'scope':this[_0x3b036a(_0x38ae7f._0x43990d)],'method':_0x121ef5,'args':_0x4f9530});}[_0x296b36(0x1b9)](){const _0x31b768={_0x45bf90:0x195},_0x854c43=_0x296b36;return this[_0x854c43(_0x31b768._0x45bf90)];}[_0x296b36(0x1b5)](){const _0x3a144c={_0x48ad9c:0x1bb},_0xaba19a=_0x296b36,_0x3defbe=this[_0xaba19a(0x195)][this[_0xaba19a(_0x3a144c._0x48ad9c)]];if(!_0x3defbe)throw new DriverError(_0xaba19a(0x1e9),{'activeIdx':this['activeIdx']});return _0x3defbe;}[_0x296b36(0x1d1)](){const _0x5cb641={_0x11725c:0x1da},_0x5af691=_0x296b36;return this[_0x5af691(_0x5cb641._0x11725c)]['consoleEntries']??[];}[_0x296b36(0x1d6)](){const _0xdd7713={_0x3980a0:0x1d6},_0x5dbd2a=_0x296b36;return this[_0x5dbd2a(0x1da)][_0x5dbd2a(_0xdd7713._0x3980a0)]??[];}async[_0x296b36(0x1eb)](_0x1174e0){const _0x589e17={_0x5dfc8d:0x1eb,_0x592cb2:0x195,_0x531c40:0x1b2},_0x1d2645=_0x296b36;this[_0x1d2645(0x17c)](_0x1d2645(_0x589e17._0x5dfc8d),[_0x1174e0]);if(_0x1174e0<0x0||_0x1174e0>=this[_0x1d2645(_0x589e17._0x592cb2)][_0x1d2645(0x1b2)])throw new DriverError(_0x1d2645(0x1c6),{'index':_0x1174e0,'available':this[_0x1d2645(_0x589e17._0x592cb2)][_0x1d2645(0x1b2)]});this[_0x1d2645(0x1bb)]=_0x1174e0,this[_0x1d2645(0x1a6)][_0x1d2645(_0x589e17._0x531c40)]=0x0;}[_0x296b36(0x19b)](_0x17b6e6){const _0x54a300={_0xb71e22:0x1af,_0x5c1a39:0x1e1},_0x64d341={_0x526a32:0x188},_0x2038d9=_0x296b36;return this[_0x2038d9(_0x54a300._0xb71e22)][_0x2038d9(_0x54a300._0x5c1a39)](_0x17b6e6),()=>{const _0xf5414f=_0x2038d9;this['newPageListeners'][_0xf5414f(_0x64d341._0x526a32)](_0x17b6e6);};}['emitFakePopup'](_0x57d7aa){const _0x2d2b35={_0x5830dd:0x1b2,_0x46ad67:0x195,_0x39d5f5:0x195},_0x33b49a=_0x296b36,_0x342457=this['scope']+_0x33b49a(0x1b3)+this['pageList'][_0x33b49a(_0x2d2b35._0x5830dd)],_0x55984f=new FakePage(this['recorder'],this[_0x33b49a(0x1da)],_0x342457,_0x57d7aa);this[_0x33b49a(_0x2d2b35._0x46ad67)]['push'](_0x55984f);const _0x22f01c=this[_0x33b49a(_0x2d2b35._0x39d5f5)]['length']-0x1;for(const _0x55433c of this['newPageListeners']){try{_0x55433c({'index':_0x22f01c,'url':_0x57d7aa});}catch{}}return _0x22f01c;}async['enterFrame'](_0x540d0d){const _0x540a7e={_0x2d741a:0x18f},_0x236a28=_0x296b36;this[_0x236a28(0x17c)]('enterFrame',[_0x540d0d]);if(!_0x540d0d[_0x236a28(_0x540a7e._0x2d741a)][_0x236a28(0x1b2)])throw new LocatorError(_0x236a28(0x1ea),{'locator':_0x540d0d});this[_0x236a28(0x1a6)]['push'](_0x540d0d);}async[_0x296b36(0x1ed)](){const _0x5028d8={_0x32d1a3:0x1a6,_0x41528f:0x1dc},_0x24b79a=_0x296b36;this['record'](_0x24b79a(0x1ed),[]);if(this[_0x24b79a(0x1a6)][_0x24b79a(0x1b2)]===0x0)throw new DriverError(_0x24b79a(0x181),{});this[_0x24b79a(_0x5028d8._0x32d1a3)][_0x24b79a(_0x5028d8._0x41528f)]();}async[_0x296b36(0x1ec)](_0x46cff9,_0x32fa7f){const _0x1c64f8=_0x296b36;this['record']('setLocalStorage',[_0x46cff9,_0x32fa7f]),this[_0x1c64f8(0x1cc)][_0x46cff9]=_0x32fa7f;}async['getLocalStorage'](_0x29108d){const _0x5cb508={_0x58c12d:0x1d7,_0x230543:0x1cc},_0x44b3ea=_0x296b36;return this['record'](_0x44b3ea(_0x5cb508._0x58c12d),[_0x29108d]),this[_0x44b3ea(_0x5cb508._0x230543)][_0x29108d]??null;}async[_0x296b36(0x182)](_0x4b2941,_0x4705d0,_0x57ad57){const _0x1220a6=_0x296b36;this[_0x1220a6(0x17c)]('setCookie',[_0x4b2941,_0x4705d0,_0x57ad57]),this[_0x1220a6(0x193)][_0x4b2941]=_0x4705d0;}async[_0x296b36(0x17e)](_0x1e30dd){const _0x2258c1=_0x296b36;return this[_0x2258c1(0x17c)](_0x2258c1(0x17e),[_0x1e30dd]),this['cookieState'][_0x1e30dd]??null;}async[_0x296b36(0x1d9)](_0x302e58){const _0x1a6c3d={_0x5d5cf7:0x17c},_0x2bdd07=_0x296b36;this[_0x2bdd07(_0x1a6c3d._0x5d5cf7)](_0x2bdd07(0x1d9),[_0x302e58]);}async[_0x296b36(0x1de)](_0x5804b1){const _0x54319f={_0x3cf509:0x17c,_0x16bdac:0x1de},_0x40504b=_0x296b36;return this[_0x40504b(_0x54319f._0x3cf509)](_0x40504b(_0x54319f._0x16bdac),[_0x5804b1]),void 0x0;}async[_0x296b36(0x1c3)](){const _0x16a2a2={_0x1c041e:0x17c},_0x2f6356=_0x296b36;this[_0x2f6356(_0x16a2a2._0x1c041e)](_0x2f6356(0x1c3),[]);}[_0x296b36(0x1c9)](){return this['frameStack']['length'];}},FakeWebDriver=class{constructor(_0x43bffb={}){const _0x4fc00d=_0x296b36;this['behavior']=_0x43bffb,this[_0x4fc00d(0x1be)]=createRecorder();}[_0x296b36(0x1da)];static{__name(this,'FakeWebDriver');}['launched']=![];[_0x296b36(0x1be)];['contexts']=[];async[_0x296b36(0x18a)](_0xf1bb92){const _0x5d92ca={_0x2e0b32:0x1ae,_0x2b6e4e:0x1c8},_0x4378ca=_0x296b36;this[_0x4378ca(0x1be)][_0x4378ca(_0x5d92ca._0x2e0b32)]({'scope':_0x4378ca(_0x5d92ca._0x2b6e4e),'method':_0x4378ca(0x18a),'args':[_0xf1bb92]}),this[_0x4378ca(0x17a)]=!![];}async[_0x296b36(0x17f)](_0x29b9bb){const _0x1797b5={_0x4cea79:0x1be,_0x3fd0c2:0x1c8,_0x60ae0d:0x1ba,_0x46b381:0x1da,_0x235707:0x1ca},_0x490369=_0x296b36;this[_0x490369(_0x1797b5._0x4cea79)][_0x490369(0x1ae)]({'scope':_0x490369(_0x1797b5._0x3fd0c2),'method':'newContext','args':[_0x29b9bb]});if(!this[_0x490369(0x17a)])throw new DriverError(_0x490369(_0x1797b5._0x60ae0d),{});const _0x3beb02=new FakeContext(this[_0x490369(0x1be)],this[_0x490369(_0x1797b5._0x46b381)],_0x490369(_0x1797b5._0x235707)+this[_0x490369(0x1b8)][_0x490369(0x1b2)]);return this[_0x490369(0x1b8)]['push'](_0x3beb02),_0x3beb02;}async[_0x296b36(0x1c3)](){const _0xcf2792={_0xe3ffd4:0x1be,_0xfaa763:0x1ae},_0x470f06=_0x296b36;this[_0x470f06(_0xcf2792._0xe3ffd4)][_0x470f06(_0xcf2792._0xfaa763)]({'scope':'driver','method':_0x470f06(0x1c3),'args':[]}),this[_0x470f06(0x17a)]=![];}[_0x296b36(0x186)](){return void 0x0;}async['connectShared'](){const _0x5cc900={_0x7e6102:0x191},_0x153802=_0x296b36;throw new DriverError(_0x153802(_0x5cc900._0x7e6102),{});}[_0x296b36(0x1e8)](){throw new DriverError('attachExisting\x20not\x20supported\x20by\x20FakeWebDriver',{});}[_0x296b36(0x1e5)](){const _0x2b8c09=_0x296b36;return this[_0x2b8c09(0x1be)]['calls']();}[_0x296b36(0x1bc)](_0x93af25){const _0x14e683=_0x296b36;return this['recorder'][_0x14e683(0x1e5)]()[_0x14e683(0x1a9)](_0x52133d=>_0x52133d[_0x14e683(0x1d4)]===_0x93af25);}};export{FakeWebDriver};
|
|
1
|
+
const _0x442b96=_0x1ca0;function _0x1ca0(_0x4c67ac,_0xf4652e){_0x4c67ac=_0x4c67ac-0x9a;const _0x4293ca=_0x4293();let _0x1ca095=_0x4293ca[_0x4c67ac];if(_0x1ca0['oaAEoG']===undefined){var _0x2b836e=function(_0x15d77b){const _0x38ab5d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x548e83='',_0x3c0340='';for(let _0x3950d8=0x0,_0xbbaf3c,_0x52dacf,_0x16f176=0x0;_0x52dacf=_0x15d77b['charAt'](_0x16f176++);~_0x52dacf&&(_0xbbaf3c=_0x3950d8%0x4?_0xbbaf3c*0x40+_0x52dacf:_0x52dacf,_0x3950d8++%0x4)?_0x548e83+=String['fromCharCode'](0xff&_0xbbaf3c>>(-0x2*_0x3950d8&0x6)):0x0){_0x52dacf=_0x38ab5d['indexOf'](_0x52dacf);}for(let _0x3d9fc2=0x0,_0x41df41=_0x548e83['length'];_0x3d9fc2<_0x41df41;_0x3d9fc2++){_0x3c0340+='%'+('00'+_0x548e83['charCodeAt'](_0x3d9fc2)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3c0340);};_0x1ca0['cUKaDl']=_0x2b836e,_0x1ca0['YJBGVf']={},_0x1ca0['oaAEoG']=!![];}const _0x572062=_0x4293ca[0x0],_0x5af799=_0x4c67ac+_0x572062,_0x49e0e2=_0x1ca0['YJBGVf'][_0x5af799];return!_0x49e0e2?(_0x1ca095=_0x1ca0['cUKaDl'](_0x1ca095),_0x1ca0['YJBGVf'][_0x5af799]=_0x1ca095):_0x1ca095=_0x49e0e2,_0x1ca095;}(function(_0x4cac83,_0x3a3398){const _0x1f8176={_0x276f79:0xb5,_0x35bb1b:0xe2,_0x2888b3:0xa7},_0x476a80=_0x1ca0,_0x136243=_0x4cac83();while(!![]){try{const _0x469d31=-parseInt(_0x476a80(0xab))/0x1*(-parseInt(_0x476a80(_0x1f8176._0x276f79))/0x2)+parseInt(_0x476a80(0x100))/0x3+parseInt(_0x476a80(0xe4))/0x4*(parseInt(_0x476a80(_0x1f8176._0x35bb1b))/0x5)+-parseInt(_0x476a80(_0x1f8176._0x2888b3))/0x6+parseInt(_0x476a80(0xe1))/0x7+parseInt(_0x476a80(0xcb))/0x8*(-parseInt(_0x476a80(0x9b))/0x9)+parseInt(_0x476a80(0xf9))/0xa;if(_0x469d31===_0x3a3398)break;else _0x136243['push'](_0x136243['shift']());}catch(_0x98c45){_0x136243['push'](_0x136243['shift']());}}}(_0x4293,0xbad03));var __defProp=Object[_0x442b96(0xff)],__name=(_0x548e83,_0x3c0340)=>__defProp(_0x548e83,'name',{'value':_0x3c0340,'configurable':!![]});function subscribe(_0x3950d8,_0xbbaf3c){return _0x3950d8['add'](_0xbbaf3c),()=>{_0x3950d8['delete'](_0xbbaf3c);};}__name(subscribe,_0x442b96(0xf5));var UnotestError=class extends Error{static{__name(this,'UnotestError');}[_0x442b96(0xb3)];constructor(_0x52dacf,_0x16f176={}){const _0x4ff5f4={_0x1fb49f:0xb3,_0x383792:0xb0},_0xc9b417=_0x442b96;super(_0x52dacf),this[_0xc9b417(0x10e)]=new.target.name,this[_0xc9b417(_0x4ff5f4._0x1fb49f)]=Object['freeze']({..._0x16f176}),typeof Error[_0xc9b417(_0x4ff5f4._0x383792)]===_0xc9b417(0xec)&&Error[_0xc9b417(_0x4ff5f4._0x383792)](this,new.target);}},DriverError=class extends UnotestError{static{__name(this,'DriverError');}},LocatorError=class extends UnotestError{static{__name(this,'LocatorError');}};function _0x4293(){const _0x193b16=['ywn0AxzLswr4','zw1PDezHA2vqB3b1Ca','zMLSDgvY','Cg9WDxbpBKnSAwnR','oteYnZq0meLbqKHpBW','C2nYzwvUC2HVDa','Bg9JywXtDg9YywDLu3rHDgu','zg91yMXLq2XPy2S','ntKWmdu2yLbyrxfA','BMv3q29UDgv4Da','CMvJB3jK','zxzHBhvHDgvpBKXVy2f0B3i','y3vYCMvUDfvYBa','y2fWDhvYzvn0ywnRvhjHy2u','y2fSBhm','zxjYB3jpBK5LEhrby3rPB24','y29UDgv4Da','Dgv4DenVBNrLBNrcEurLzMf1Bhq','nhjIu2zPsq','BgvUz3rO','C2v0qwn0AxzLugfNzq','y29UBMvJDfnOyxjLza','BM8Gywn0AxzLihbHz2uGAw4Gy29UDgv4Da','CMvM','Bgf1BMnOzwq','ywn0AxzLugfNzq','y29VA2LLCW','Aw5ZCgvJDevSzw1LBNq','y2XVC2u','zNjVBq','BMv3ugfNzuXPC3rLBMvYCW','z29cywnR','CgfNzxm','ChjLC3m','DgL0Bgu','CMvJB3jKzxi','D2fPDezVCG','ChvZAa','z29gB3j3yxjK','CgfNzsbPBMrLEcbVDxqGB2yGCMfUz2u','mtiWEgXVywXJ','Dgv4DenVBNrLBNq','zhjPDMvY','y291BNrcEurLzMf1Bhq','Bgf1BMnO','Aw5WDxrwywX1zq','zxHPDezYyw1LignHBgXLzcb3AxrOig5VigzYyw1Lig9UihrOzsbZDgfJAW','A2LUza','y3r4','pgrPDIbKyxrHlxvUB3rLC3qTCMvMpsi','DxjS','Cg9W','zw50zxjgCMfTzsbJywXSzwqGD2L0AcbLBxb0EsbSB2nHDg9Y','lNbHz2u','y2XPy2S','z290BW','y29UBMvJDfnOyxjLzcbUB3qGC3vWCg9YDgvKigj5iezHA2vxzwjeCML2zxi','Ag92zxi','z2v0tg9JywXtDg9YywDL','Dw5JAgvJAW','BMv3q29UDgv4DcbJywXSzwqGyMvMB3jLigXHDw5JAcGP','C2v0tg9JywXtDg9YywDL','mtC3mtiZogHsD01JBG','mtGZndCZnvL3wfLXAq','C2v0q29VA2LL','mtjUzvvtBe4','BMv0D29YA0vUDhjPzxm','Aw5PDgLHBfvYBa','B3v0zxjive1m','C2nYB2XSsw50B1zPzxC','zxHPDezYyw1L','DxbSB2fKrMLSzq','D2fPDezVCK5HDMLNyxrPB24','zNvUy3rPB24','rMfRzvDLyKrYAxzLCG','y2HLy2TLzfn0yxrL','yxr0ywnOrxHPC3rPBMCGBM90ihn1ChbVCNrLzcbIEsbgywTLv2vIrhjPDMvY','pgrPDJ48l2rPDJ4','C3rLChm','y29UC29SzuvUDhjPzxm','zwXLBwvUDeHPBNrcEvjLzG','y2fSBhngB3i','C3vIC2nYAwjL','C2vSzwn0t3b0Aw9U','z2v0q29VA2LL','rMfRzvbHz2u','mJu4mtGZmezQEKDMsa','C2nVCgu','D2fPDezVCLvYBa','Bwf5yMvuAhjVDW','CgfNzuXPC3q','zNjHBwvezxb0Aa','zgvMAw5LuhjVCgvYDhK','mJK5ntqXnKTNA1nvEq','y2HLy2TLzfn0yxrLqNLezwzHDwX0','zNjHBwvtDgfJAW','z2v0qxr0CMLIDxrL','y2HLy2S','y29UDgv4Dhm','zxzHBhvHDgu','B25ozxDqywDL','zw50zxjgCMfTzq','y291BNq','zMLSBa','AxnwAxnPyMXL','D2fPDezVCLrLEhq','CMvSB2fK','BMfTzq','B25bzNrLCKnSAwnR','otaYnti5venOuxvl','y2XPCgjVyxjKugfZDgu','C3bSAwnL','y29VA2LLu3rHDgu','Bwv0Ag9K','zhjHz0fUzerYB3a','yMvOyxzPB3i','ywjVDxq6yMXHBMS'];_0x4293=function(){return _0x193b16;};return _0x4293();}function createRecorder(){const _0x42bbbc={_0x157d95:0xc8,_0x58ae6d:0xb1},_0x4dfcc6=_0x442b96,_0x3d9fc2=[];let _0x41df41=0x0;return{'push':__name(_0x2b2ccf=>_0x3d9fc2[_0x4dfcc6(0xc8)]({..._0x2b2ccf,'seq':_0x41df41++}),_0x4dfcc6(_0x42bbbc._0x157d95)),'calls':__name(()=>_0x3d9fc2,_0x4dfcc6(_0x42bbbc._0x58ae6d))};}__name(createRecorder,'createRecorder');var FakePage=class{constructor(_0x337133,_0x5959ee,_0x11e08c,_0x6b17d8){const _0x4c0424=_0x442b96;this[_0x4c0424(0xc6)]=_0x337133,this['behavior']=_0x5959ee,this['scope']=_0x11e08c,this[_0x4c0424(0xaf)]=_0x6b17d8;}[_0x442b96(0xc6)];[_0x442b96(0xa1)];['scope'];static{__name(this,_0x442b96(0xf8));}['currentUrl'];[_0x442b96(0x9a)];[_0x442b96(0xad)](_0x2ccb05,_0x16fb64){this['recorder']['push']({'scope':this['scope'],'method':_0x2ccb05,'args':_0x16fb64});}[_0x442b96(0xfc)](){const _0x4757bf={_0x3a5537:0xa1,_0x1751ad:0xb2},_0x5636ac=_0x442b96;if(this['behavior'][_0x5636ac(0xb2)]){const _0x15606b=this[_0x5636ac(_0x4757bf._0x3a5537)]['errorOnNextAction'];this[_0x5636ac(0xa1)][_0x5636ac(_0x4757bf._0x1751ad)]=void 0x0;throw _0x15606b;}}[_0x442b96(0xd5)](){return this['currentUrl'];}async['title'](){const _0x2c6740={_0x4104e3:0xc5},_0x55ee46=_0x442b96;return this['record'](_0x55ee46(_0x2c6740._0x4104e3),[]),'fake\x20title';}async[_0x442b96(0xd9)](_0x982d91,_0x595535){const _0x223ca6={_0x12e34a:0xad},_0x12fcc2=_0x442b96;this[_0x12fcc2(_0x223ca6._0x12e34a)](_0x12fcc2(0xd9),[_0x982d91,_0x595535]),this[_0x12fcc2(0xfc)](),this['onAfterClick']?.();}async[_0x442b96(0xaa)](_0x3a7bc3,_0x11988c){const _0x137570=_0x442b96;this[_0x137570(0xad)]('doubleClick',[_0x3a7bc3,_0x11988c]),this['maybeThrow']();}async[_0x442b96(0x10a)](_0xd0dfef,_0x5733c1,_0x1adfce){const _0x127b6a=_0x442b96;this[_0x127b6a(0xad)](_0x127b6a(0x10a),[_0xd0dfef,_0x5733c1,_0x1adfce]),this[_0x127b6a(0xfc)]();}async[_0x442b96(0xc4)](_0x437bac,_0x455b8b,_0x37caf0){const _0x5d5cc6={_0x7597c8:0xc4,_0xd7413e:0xfc},_0x1f9a92=_0x442b96;this[_0x1f9a92(0xad)](_0x1f9a92(_0x5d5cc6._0x7597c8),[_0x437bac,_0x455b8b,_0x37caf0]),this[_0x1f9a92(_0x5d5cc6._0xd7413e)]();}async[_0x442b96(0x104)](_0x4cdd8c,_0x527f6c){const _0x2fd57f={_0x49635e:0x104},_0x63ad2c=_0x442b96;this[_0x63ad2c(0xad)](_0x63ad2c(_0x2fd57f._0x49635e),[_0x4cdd8c,_0x527f6c]),this['maybeThrow']();}async['uncheck'](_0x27b900,_0x3b3f73){const _0x1a416={_0x143eeb:0xde},_0x2f0bd0=_0x442b96;this['record'](_0x2f0bd0(_0x1a416._0x143eeb),[_0x27b900,_0x3b3f73]),this[_0x2f0bd0(0xfc)]();}async[_0x442b96(0xf6)](_0x1da901,_0x20b266,_0x5c322c){const _0x4dd22b=_0x442b96;this['record'](_0x4dd22b(0xf6),[_0x1da901,_0x20b266,_0x5c322c]),this['maybeThrow']();}async['hover'](_0x4982cc,_0x574e61){const _0x2513b3={_0x34c26a:0xdc},_0x450c8d=_0x442b96;this[_0x450c8d(0xad)](_0x450c8d(_0x2513b3._0x34c26a),[_0x4982cc,_0x574e61]),this[_0x450c8d(0xfc)]();}async[_0x442b96(0xe8)](_0x654da6){const _0x3ccca9={_0x10e92a:0xad},_0x5e69a8=_0x442b96;this[_0x5e69a8(_0x3ccca9._0x10e92a)](_0x5e69a8(0xe8),[_0x654da6]),this['maybeThrow']();}async['dragAndDrop'](_0x5a0b0d,_0x7f58c1,_0x24c545){const _0x1778d7={_0x4eef09:0xad},_0x41179a=_0x442b96;this[_0x41179a(_0x1778d7._0x4eef09)](_0x41179a(0xa0),[_0x5a0b0d,_0x7f58c1,_0x24c545]),this[_0x41179a(0xfc)]();}async['uploadFile'](_0x41da81,_0x32669d){const _0x441ce7={_0x4a7528:0xad,_0x45a8f7:0xea,_0x1441f1:0xfc},_0x5eb79c=_0x442b96;this[_0x5eb79c(_0x441ce7._0x4a7528)](_0x5eb79c(_0x441ce7._0x45a8f7),[_0x41da81,_0x32669d]),this[_0x5eb79c(_0x441ce7._0x1441f1)]();}async[_0x442b96(0x9c)](_0x275c4d,_0x35434e){const _0x36df49={_0x32fb5c:0xad},_0x47557e=_0x442b96;this[_0x47557e(_0x36df49._0x32fb5c)](_0x47557e(0x9c),[_0x275c4d,_0x35434e]),this[_0x47557e(0xfc)]();}async[_0x442b96(0x109)](_0x2f6a47){const _0x4103fd={_0x7a13e8:0xce},_0x38107f=_0x442b96;return this[_0x38107f(0xad)]('count',[_0x2f6a47]),this[_0x38107f(0xa1)][_0x38107f(_0x4103fd._0x7a13e8)]??0x1;}async[_0x442b96(0xcc)](_0x2ed2){const _0x5be3ce={_0x4c4551:0xad,_0x536b36:0xcc,_0x13cdae:0xa1,_0x1670d1:0xb4},_0x1f5fab=_0x442b96;return this[_0x1f5fab(_0x5be3ce._0x4c4551)](_0x1f5fab(_0x5be3ce._0x536b36),[_0x2ed2]),this[_0x1f5fab(_0x5be3ce._0x13cdae)][_0x1f5fab(_0x5be3ce._0x1670d1)]??'';}async[_0x442b96(0xd0)](_0x5669dd){const _0x4fd2d9={_0x1a1711:0xa1},_0x1b174a=_0x442b96;return this['record'](_0x1b174a(0xd0),[_0x5669dd]),this[_0x1b174a(_0x4fd2d9._0x1a1711)]['inputValueByDefault']??'';}async[_0x442b96(0xee)](_0x2fb0db){const _0x360cf2={_0x3c44cc:0xee},_0xf6e2db=_0x442b96;return this[_0xf6e2db(0xad)](_0xf6e2db(_0x360cf2._0x3c44cc),[_0x2fb0db]),this['behavior'][_0xf6e2db(0x101)]??null;}async['isVisible'](_0x27009d){const _0x25f355=_0x442b96;return this['record'](_0x25f355(0x10b),[_0x27009d]),this['behavior']['isVisibleByDefault']??!![];}async[_0x442b96(0x103)](_0x17fe83,_0x49e651){const _0x3fe916={_0x319aa9:0xa1},_0x426b34=_0x442b96;return this['record'](_0x426b34(0x103),[_0x17fe83,_0x49e651]),this[_0x426b34(_0x3fe916._0x319aa9)]['attributesByDefault']?.[_0x49e651]??null;}async[_0x442b96(0xc7)](_0x3cd8e2,_0x49a353){const _0x4676f7=_0x442b96;this[_0x4676f7(0xad)]('waitFor',[_0x3cd8e2,_0x49a353]);}async[_0x442b96(0xfb)](_0x4a5f77,_0x5a23bb){const _0x5ac838={_0x4d2117:0xfb},_0x3e6397=_0x442b96;this['record'](_0x3e6397(_0x5ac838._0x4d2117),[_0x4a5f77,_0x5a23bb]);}async[_0x442b96(0x10c)](_0x35b9f7,_0x4e2ba6){const _0x5dd6eb={_0x532f69:0x10c},_0x1173b9=_0x442b96;this[_0x1173b9(0xad)](_0x1173b9(_0x5dd6eb._0x532f69),[_0x35b9f7,_0x4e2ba6]);}async[_0x442b96(0xeb)](_0x224e30){const _0x5b0227=_0x442b96;this[_0x5b0227(0xad)](_0x5b0227(0xeb),[_0x224e30]);}async[_0x442b96(0xda)](_0x369079,_0x106896){this['record']('goto',[_0x369079,_0x106896]),this['currentUrl']=_0x369079;}async['reload'](_0x5488d4){const _0x4d94b6={_0x537847:0xad},_0x528d50=_0x442b96;this[_0x528d50(_0x4d94b6._0x537847)](_0x528d50(0x10d),[_0x5488d4]);}async[_0x442b96(0xc2)](_0x4f6dc1){const _0x3fb08b={_0x139dc6:0xc2},_0xc46f5f=_0x442b96;this[_0xc46f5f(0xad)](_0xc46f5f(_0x3fb08b._0x139dc6),[_0x4f6dc1]);}async['goForward'](_0x523861){const _0x495e43={_0x18fec4:0xc9},_0x313078=_0x442b96;this[_0x313078(0xad)](_0x313078(_0x495e43._0x18fec4),[_0x523861]);}async[_0x442b96(0x106)](_0x3daaf7){const _0x806ecb={_0x599e89:0xad},_0x253501=_0x442b96;return this[_0x253501(_0x806ecb._0x599e89)]('evaluate',[_0x3daaf7]),void 0x0;}async[_0x442b96(0xae)](_0x3d223e,_0x4eb7e9){const _0x52dcd2=_0x442b96;return this[_0x52dcd2(0xad)](_0x52dcd2(0xae),[_0x3d223e,_0x4eb7e9]),void 0x0;}async[_0x442b96(0xbe)](_0x3d8321){const _0x6f89f6={_0x29a8a3:0xbe,_0x2ac812:0xf1,_0x2f64fb:0xba,_0x3b76dd:0xf3},_0x3273ee=_0x442b96;this[_0x3273ee(0xad)](_0x3273ee(_0x6f89f6._0x29a8a3),[_0x3d8321]);if(_0x3d8321[_0x3273ee(0xf1)][_0x3273ee(0xb6)]!==0x1||_0x3d8321[_0x3273ee(_0x6f89f6._0x2ac812)][0x0][_0x3273ee(0xd2)]!==_0x3273ee(_0x6f89f6._0x2f64fb))return null;const _0x193d59=_0x3d8321[_0x3273ee(0xf1)][0x0][_0x3273ee(0xba)],_0x3ecf5f=this['behavior'][_0x3273ee(_0x6f89f6._0x3b76dd)]?.[_0x193d59];return _0x3ecf5f??null;}async[_0x442b96(0xa8)](_0x38d712){const _0x22b570={_0x490888:0xad,_0x509d43:0xc0},_0x57a71d=_0x442b96;return this[_0x57a71d(_0x22b570._0x490888)]('screenshot',[_0x38d712]),Buffer[_0x57a71d(_0x22b570._0x509d43)]('fake-png');}async['outerHTML'](_0x1d2a39){const _0x39abd8={_0x30353f:0xe7,_0x4a3196:0xf1,_0xf6647:0xb6,_0x454dd7:0xd2,_0x436af9:0xf1,_0x1d1f3c:0xd4,_0x4891f3:0xf0},_0x532fbd=_0x442b96;this[_0x532fbd(0xad)](_0x532fbd(_0x39abd8._0x30353f),[_0x1d2a39]);if(_0x1d2a39[_0x532fbd(_0x39abd8._0x4a3196)][_0x532fbd(_0x39abd8._0xf6647)]===0x1&&_0x1d2a39[_0x532fbd(_0x39abd8._0x4a3196)][0x0][_0x532fbd(_0x39abd8._0x454dd7)]==='ref'){const _0x18a26a=_0x1d2a39[_0x532fbd(_0x39abd8._0x436af9)][0x0][_0x532fbd(0xba)];return this['behavior']['outerHtmlByRef']?.[_0x18a26a]??_0x532fbd(_0x39abd8._0x1d1f3c)+_0x18a26a+'\x22></div>';}return _0x532fbd(_0x39abd8._0x4891f3);}},FakeContext=class{constructor(_0x2969b8,_0x199975,_0xb5316a){const _0x4d69e0={_0xb91334:0xfa,_0x2c0aa7:0x9e,_0x4a62a5:0xbd},_0x2377e2={_0xbb6b99:0xa4,_0x4f7a17:0xa6},_0x46717e=_0x442b96;this['recorder']=_0x2969b8,this['behavior']=_0x199975,this[_0x46717e(_0x4d69e0._0xb91334)]=_0xb5316a;const _0x3ba0a6=new FakePage(_0x2969b8,_0x199975,_0xb5316a+'.page0',_0x199975[_0x46717e(0xe6)]??_0x46717e(0xa2));_0x199975[_0x46717e(0xa6)]&&(_0x3ba0a6['onAfterClick']=()=>{const _0x3dda51=_0x46717e;this[_0x3dda51(_0x2377e2._0xbb6b99)](_0x199975[_0x3dda51(_0x2377e2._0x4f7a17)]);}),this['pageList']=[_0x3ba0a6],this[_0x46717e(0xa9)]={..._0x199975['localStorage']??{}},this[_0x46717e(_0x4d69e0._0x2c0aa7)]={..._0x199975[_0x46717e(_0x4d69e0._0x4a62a5)]??{}};}[_0x442b96(0xc6)];[_0x442b96(0xa1)];[_0x442b96(0xfa)];static{__name(this,'FakeContext');}[_0x442b96(0xfd)];[_0x442b96(0xa3)]=0x0;[_0x442b96(0x102)]=[];['localStorageState'];[_0x442b96(0x9e)];['newPageListeners']=new Set();[_0x442b96(0xad)](_0x289687,_0x30a23f){const _0xa6f363={_0x3e50c7:0xc8},_0x5a8303=_0x442b96;this[_0x5a8303(0xc6)][_0x5a8303(_0xa6f363._0x3e50c7)]({'scope':this[_0x5a8303(0xfa)],'method':_0x289687,'args':_0x30a23f});}[_0x442b96(0xc3)](){const _0x2adea5={_0x39a73c:0xfd},_0x4f9727=_0x442b96;return this[_0x4f9727(_0x2adea5._0x39a73c)];}[_0x442b96(0xbc)](){const _0x54df14={_0x25abd1:0xfd},_0x3bb225=_0x442b96,_0x2cdaae=this[_0x3bb225(_0x54df14._0x25abd1)][this['activeIdx']];if(!_0x2cdaae)throw new DriverError(_0x3bb225(0xb9),{'activeIdx':this[_0x3bb225(0xa3)]});return _0x2cdaae;}[_0x442b96(0xf2)](){return this['behavior']['consoleEntries']??[];}['networkEntries'](){const _0x4264aa={_0x2954e4:0xe5},_0x2fbe57=_0x442b96;return this[_0x2fbe57(0xa1)][_0x2fbe57(_0x4264aa._0x2954e4)]??[];}async['setActivePage'](_0x49d6bf){const _0x127f54={_0x4418e7:0xfd},_0x264e09=_0x442b96;this['record'](_0x264e09(0xb7),[_0x49d6bf]);if(_0x49d6bf<0x0||_0x49d6bf>=this[_0x264e09(_0x127f54._0x4418e7)][_0x264e09(0xb6)])throw new DriverError(_0x264e09(0xca),{'index':_0x49d6bf,'available':this['pageList']['length']});this[_0x264e09(0xa3)]=_0x49d6bf,this[_0x264e09(0x102)][_0x264e09(0xb6)]=0x0;}[_0x442b96(0x107)](_0x19e550){const _0x49dce1={_0x3c8dce:0xc1},_0x4d4e28=_0x442b96;return subscribe(this[_0x4d4e28(_0x49dce1._0x3c8dce)],_0x19e550);}[_0x442b96(0xa4)](_0x203f2a){const _0x5e5020={_0xe3e221:0xfa,_0x11662a:0xfd,_0x369247:0xc6,_0x206c88:0xa1},_0x1ce683=_0x442b96,_0x3be129=this[_0x1ce683(_0x5e5020._0xe3e221)]+_0x1ce683(0xd8)+this[_0x1ce683(_0x5e5020._0x11662a)]['length'],_0x3db6b6=new FakePage(this[_0x1ce683(_0x5e5020._0x369247)],this[_0x1ce683(_0x5e5020._0x206c88)],_0x3be129,_0x203f2a);this[_0x1ce683(0xfd)][_0x1ce683(0xc8)](_0x3db6b6);const _0x542868=this[_0x1ce683(0xfd)][_0x1ce683(0xb6)]-0x1;for(const _0x56dff4 of this['newPageListeners']){try{_0x56dff4({'index':_0x542868,'url':_0x203f2a});}catch{}}return _0x542868;}['closeFakePage'](_0x3f1eb0){const _0x4ea336={_0x4ea873:0xfd,_0x562ec3:0xfd},_0x7b73b9=_0x442b96;if(_0x3f1eb0<0x0||_0x3f1eb0>=this[_0x7b73b9(0xfd)][_0x7b73b9(0xb6)])throw new DriverError(_0x7b73b9(0xca),{'index':_0x3f1eb0,'available':this[_0x7b73b9(_0x4ea336._0x4ea873)][_0x7b73b9(0xb6)]});this[_0x7b73b9(_0x4ea336._0x562ec3)][_0x7b73b9(0x9d)](_0x3f1eb0,0x1);}async[_0x442b96(0x108)](_0xf5c29a){const _0x5eefcd={_0x444db4:0xad,_0x39c238:0x108,_0x53aa06:0xf1,_0x2e8f1c:0xb6,_0x3cbaec:0x102},_0x67f5fe=_0x442b96;this[_0x67f5fe(_0x5eefcd._0x444db4)](_0x67f5fe(_0x5eefcd._0x39c238),[_0xf5c29a]);if(!_0xf5c29a[_0x67f5fe(_0x5eefcd._0x53aa06)][_0x67f5fe(_0x5eefcd._0x2e8f1c)])throw new LocatorError(_0x67f5fe(0xd7),{'locator':_0xf5c29a});this[_0x67f5fe(_0x5eefcd._0x3cbaec)]['push'](_0xf5c29a);}async['exitFrame'](){const _0x420652={_0x3e0903:0xe9,_0x19f2a8:0x102},_0xa047c8=_0x442b96;this[_0xa047c8(0xad)](_0xa047c8(_0x420652._0x3e0903),[]);if(this[_0xa047c8(_0x420652._0x19f2a8)]['length']===0x0)throw new DriverError(_0xa047c8(0xd1),{});this['frameStack'][_0xa047c8(0xd6)]();}async['setLocalStorage'](_0x327218,_0x6c2f51){const _0xd1e745={_0x4466b5:0xa9},_0x1b7c19=_0x442b96;this[_0x1b7c19(0xad)](_0x1b7c19(0xe0),[_0x327218,_0x6c2f51]),this[_0x1b7c19(_0xd1e745._0x4466b5)][_0x327218]=_0x6c2f51;}async[_0x442b96(0xdd)](_0x2bd207){const _0x3e468a={_0xb652ac:0xdd},_0x380c30=_0x442b96;return this[_0x380c30(0xad)](_0x380c30(_0x3e468a._0xb652ac),[_0x2bd207]),this[_0x380c30(0xa9)][_0x2bd207]??null;}async[_0x442b96(0xe3)](_0x167f70,_0x310cba,_0x554419){const _0x3bde5f=_0x442b96;this[_0x3bde5f(0xad)](_0x3bde5f(0xe3),[_0x167f70,_0x310cba,_0x554419]),this[_0x3bde5f(0x9e)][_0x167f70]=_0x310cba;}async[_0x442b96(0xf7)](_0x317f53){const _0x3fb3c9=_0x442b96;return this[_0x3fb3c9(0xad)]('getCookie',[_0x317f53]),this[_0x3fb3c9(0x9e)][_0x317f53]??null;}async['saveStorageState'](_0x384034){this['record']('saveStorageState',[_0x384034]);}async[_0x442b96(0x106)](_0x52e2fa){const _0x6bb0c5={_0x36e143:0xad},_0x42e5cf=_0x442b96;return this[_0x42e5cf(_0x6bb0c5._0x36e143)](_0x42e5cf(0x106),[_0x52e2fa]),void 0x0;}async[_0x442b96(0xbf)](){const _0x1ae1ca=_0x442b96;this[_0x1ae1ca(0xad)]('close',[]);}[_0x442b96(0xfe)](){const _0x48c408={_0x5a0338:0x102,_0x1059f0:0xb6},_0x1eaaf8=_0x442b96;return this[_0x1eaaf8(_0x48c408._0x5a0338)][_0x1eaaf8(_0x48c408._0x1059f0)];}},FakeWebDriver=class{constructor(_0x3ec4ed={}){const _0x2a83e4={_0x242ce2:0xc6},_0x342a77=_0x442b96;this['behavior']=_0x3ec4ed,this[_0x342a77(_0x2a83e4._0x242ce2)]=createRecorder();}['behavior'];static{__name(this,_0x442b96(0xed));}['launched']=![];['recorder'];[_0x442b96(0x105)]=[];async['launch'](_0x3a3af9){const _0x27e4cb={_0x33877c:0xc6,_0x2bb819:0xcf},_0x3ca96a=_0x442b96;this[_0x3ca96a(_0x27e4cb._0x33877c)][_0x3ca96a(0xc8)]({'scope':_0x3ca96a(0xcd),'method':_0x3ca96a(_0x27e4cb._0x2bb819),'args':[_0x3a3af9]}),this['launched']=!![];}async[_0x442b96(0xac)](_0x56a71a){const _0x33e6fb={_0x27a9bb:0xc8,_0x5543b8:0xc6,_0x300189:0xa1,_0x24d1a4:0xd3,_0x5c5b69:0x105,_0x448ad9:0xb6},_0x338192=_0x442b96;this[_0x338192(0xc6)][_0x338192(_0x33e6fb._0x27a9bb)]({'scope':'driver','method':'newContext','args':[_0x56a71a]});if(!this[_0x338192(0xbb)])throw new DriverError(_0x338192(0xdf),{});const _0x40f3a9=new FakeContext(this[_0x338192(_0x33e6fb._0x5543b8)],this[_0x338192(_0x33e6fb._0x300189)],_0x338192(_0x33e6fb._0x24d1a4)+this[_0x338192(_0x33e6fb._0x5c5b69)][_0x338192(_0x33e6fb._0x448ad9)]);return this['contexts']['push'](_0x40f3a9),_0x40f3a9;}async[_0x442b96(0xbf)](){const _0x12deb7={_0x29a58d:0xbb},_0x5cac2e=_0x442b96;this[_0x5cac2e(0xc6)]['push']({'scope':'driver','method':_0x5cac2e(0xbf),'args':[]}),this[_0x5cac2e(_0x12deb7._0x29a58d)]=![];}['wsEndpoint'](){return void 0x0;}async[_0x442b96(0xb8)](){const _0x114b6f=_0x442b96;throw new DriverError(_0x114b6f(0xdb),{});}['attachExisting'](){const _0x1fe38d=_0x442b96;throw new DriverError(_0x1fe38d(0xef),{});}[_0x442b96(0xb1)](){const _0x1b7742=_0x442b96;return this[_0x1b7742(0xc6)]['calls']();}[_0x442b96(0xf4)](_0x1474bf){const _0x2a3a2d={_0x12a23d:0xa5},_0x2bce50=_0x442b96;return this[_0x2bce50(0xc6)]['calls']()[_0x2bce50(_0x2a3a2d._0x12a23d)](_0x4f65b7=>_0x4f65b7[_0x2bce50(0x9f)]===_0x1474bf);}};export{FakeWebDriver};
|
package/dist/dsl/index.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { i as LocatorValue, W as WebDriver, D as DriverContext, d as DriverPage } from '../interfaces-
|
|
2
|
-
export { j as LocatorStep, k as appendStep, l as describeLocator, m as isLocatorValue, r as rootedAt } from '../interfaces-
|
|
1
|
+
import { i as LocatorValue, W as WebDriver, D as DriverContext, d as DriverPage } from '../interfaces-BxviHxnr.js';
|
|
2
|
+
export { j as LocatorStep, k as appendStep, l as describeLocator, m as isLocatorValue, r as rootedAt } from '../interfaces-BxviHxnr.js';
|
|
3
3
|
import { Matcher, RegexLiteral } from '@unotest/protocol';
|
|
4
|
-
import {
|
|
4
|
+
import { ExecutionWalker, ExecutionEvent, RunResult, RunOptions } from '@unotest/dsl/executor';
|
|
5
|
+
export { ExecutionError, ExecutionEvent, RunOptions, RunResult } from '@unotest/dsl/executor';
|
|
5
6
|
import { SandboxConfig } from '../config/schema.js';
|
|
7
|
+
import { RuntimeExecState } from '@unotest/core';
|
|
6
8
|
export { L as LintDiagnostic, b as LintOptions, a as LintSeverity, l as lintAst } from '../linter-CM2CpIyW.js';
|
|
7
9
|
import 'zod';
|
|
10
|
+
import '@unotest/dsl';
|
|
8
11
|
|
|
9
12
|
/** Test/codegen convenience: build a RegexLiteral inline. The DSL
|
|
10
13
|
* parser produces these for `/pattern/flags` literals at runtime;
|
|
@@ -43,6 +46,7 @@ declare function filter(loc: LocatorValue, options: {
|
|
|
43
46
|
declare function first(loc: LocatorValue): LocatorValue;
|
|
44
47
|
declare function last(loc: LocatorValue): LocatorValue;
|
|
45
48
|
declare function nth(loc: LocatorValue, index: number): LocatorValue;
|
|
49
|
+
declare function randomNth(loc: LocatorValue): LocatorValue;
|
|
46
50
|
declare function contentFrame(loc: LocatorValue): LocatorValue;
|
|
47
51
|
declare function chainGetByRole(loc: LocatorValue, role: string, options?: {
|
|
48
52
|
name?: Matcher;
|
|
@@ -65,83 +69,6 @@ declare function chainGetByTitle(loc: LocatorValue, text: Matcher, options?: {
|
|
|
65
69
|
exact?: boolean;
|
|
66
70
|
}): LocatorValue;
|
|
67
71
|
|
|
68
|
-
interface ExecutionError {
|
|
69
|
-
message: string;
|
|
70
|
-
/** Error class name (e.g. "AssertionError", "LocatorError"). Lets consumers
|
|
71
|
-
* classify failure vs. infra error without parsing the message. */
|
|
72
|
-
name?: string;
|
|
73
|
-
stack?: string;
|
|
74
|
-
/** Path to a screenshot saved on failure (driver-side). */
|
|
75
|
-
screenshotPath?: string;
|
|
76
|
-
/** Path to the a11y / semantic-dom snapshot saved on failure. */
|
|
77
|
-
snapshotPath?: string;
|
|
78
|
-
/** Optional rich detail (top-3 NearMisses, etc.). Free-form for the explainer. */
|
|
79
|
-
details?: unknown;
|
|
80
|
-
}
|
|
81
|
-
type ExecutionEvent = {
|
|
82
|
-
kind: 'step-start';
|
|
83
|
-
node: Statement;
|
|
84
|
-
file: string;
|
|
85
|
-
line: number;
|
|
86
|
-
col: number;
|
|
87
|
-
callStack?: readonly string[];
|
|
88
|
-
} | {
|
|
89
|
-
kind: 'step-end';
|
|
90
|
-
node: Statement;
|
|
91
|
-
file: string;
|
|
92
|
-
line: number;
|
|
93
|
-
col: number;
|
|
94
|
-
ok: true;
|
|
95
|
-
callStack?: readonly string[];
|
|
96
|
-
} | {
|
|
97
|
-
kind: 'step-end';
|
|
98
|
-
node: Statement;
|
|
99
|
-
file: string;
|
|
100
|
-
line: number;
|
|
101
|
-
col: number;
|
|
102
|
-
ok: false;
|
|
103
|
-
error: ExecutionError;
|
|
104
|
-
callStack?: readonly string[];
|
|
105
|
-
} | {
|
|
106
|
-
kind: 'paused';
|
|
107
|
-
reason: 'step' | 'failure' | 'breakpoint';
|
|
108
|
-
file: string;
|
|
109
|
-
line: number;
|
|
110
|
-
col: number;
|
|
111
|
-
};
|
|
112
|
-
interface RunOptions {
|
|
113
|
-
/** "auto" = run until completion / failure. "step" = pause after each statement. */
|
|
114
|
-
mode: 'auto' | 'step';
|
|
115
|
-
/** When true, on uncaught error we emit `paused: 'failure'` instead of throwing. */
|
|
116
|
-
pauseOnFailure: boolean;
|
|
117
|
-
/** Safety budget — abort with synthetic failure if exceeded. */
|
|
118
|
-
maxSteps?: number;
|
|
119
|
-
/** Wall-clock budget — same semantics. */
|
|
120
|
-
maxDurationMs?: number;
|
|
121
|
-
/** Maximum user-function nesting depth. Default 32. Guards against runaway
|
|
122
|
-
* recursion that wouldn't trip `maxSteps` (deep expression-tree calls). */
|
|
123
|
-
maxCallDepth?: number;
|
|
124
|
-
/** Mutable set of "line:col" keys. Executor checks membership before each
|
|
125
|
-
* statement; on hit, emits `paused: 'breakpoint'`. set-bp/clear-bp commands
|
|
126
|
-
* from the debug-commands-watcher mutate this set in place — same instance
|
|
127
|
-
* reference is shared with the watcher. */
|
|
128
|
-
breakpoints?: Set<string>;
|
|
129
|
-
/** Ref-object atomic flag for "pause on next statement". The pause-command
|
|
130
|
-
* watcher sets `value = true`; the executor reads it at every step-start,
|
|
131
|
-
* yields `paused: 'step'` if set, and resets to false. Ref-object (not raw
|
|
132
|
-
* boolean) so the watcher's mutation is visible to the executor without
|
|
133
|
-
* re-passing options. */
|
|
134
|
-
pauseRequested?: {
|
|
135
|
-
value: boolean;
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
interface RunResult {
|
|
139
|
-
outcome: 'completed' | 'failed' | 'aborted';
|
|
140
|
-
stepsExecuted: number;
|
|
141
|
-
durationMs: number;
|
|
142
|
-
error?: ExecutionError;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
72
|
/** Read-only lookup over external scenario variables. */
|
|
146
73
|
interface VariableStore {
|
|
147
74
|
has(name: string): boolean;
|
|
@@ -157,6 +84,12 @@ interface Logger {
|
|
|
157
84
|
child(prefix: string): Logger;
|
|
158
85
|
}
|
|
159
86
|
|
|
87
|
+
interface ScreenshotSink {
|
|
88
|
+
/** Persist one PNG capture. Returns the project-relative path the
|
|
89
|
+
* artifact landed at. */
|
|
90
|
+
save(name: string, png: Buffer): Promise<string>;
|
|
91
|
+
}
|
|
92
|
+
|
|
160
93
|
type DslPrimitive = string | number | boolean | null;
|
|
161
94
|
type DslObject = {
|
|
162
95
|
readonly [key: string]: DslValue;
|
|
@@ -181,6 +114,10 @@ interface TestRuntimeDeps {
|
|
|
181
114
|
readonly baseUrl?: string;
|
|
182
115
|
/** Injectable clock — defaults to Date.now. Tests pass a fake. */
|
|
183
116
|
readonly nowFn?: () => number;
|
|
117
|
+
/** Sink for on-demand `screenshot()` captures. Wired by the CLI runner
|
|
118
|
+
* to the run dir; absent in ad-hoc / explore runtimes (the DSL
|
|
119
|
+
* function then logs and skips). */
|
|
120
|
+
readonly screenshots?: ScreenshotSink;
|
|
184
121
|
}
|
|
185
122
|
declare class TestRuntime {
|
|
186
123
|
readonly runId: string;
|
|
@@ -189,6 +126,7 @@ declare class TestRuntime {
|
|
|
189
126
|
readonly logger: Logger;
|
|
190
127
|
readonly sandbox: SandboxConfig;
|
|
191
128
|
readonly baseUrl?: string;
|
|
129
|
+
readonly screenshots?: ScreenshotSink;
|
|
192
130
|
private readonly variables;
|
|
193
131
|
private readonly nowFn;
|
|
194
132
|
private readonly scope;
|
|
@@ -237,34 +175,11 @@ declare class FunctionRegistry {
|
|
|
237
175
|
names(): string[];
|
|
238
176
|
}
|
|
239
177
|
|
|
240
|
-
declare class AstExecutor {
|
|
241
|
-
private readonly registry;
|
|
178
|
+
declare class AstExecutor extends ExecutionWalker<TestRuntime> {
|
|
242
179
|
constructor(registry: FunctionRegistry);
|
|
243
|
-
private entryFile;
|
|
244
|
-
private fnFile;
|
|
245
|
-
/** Project-root-relative posix file the current step lives in: origin of
|
|
246
|
-
* the innermost user-function frame, else the entry file. `callStack`
|
|
247
|
-
* only ever holds user-function names (pushed in callUserFunction), so
|
|
248
|
-
* every frame has a `fnFile` entry; the `?? entryFile` is a defensive
|
|
249
|
-
* fallback, not a normal path. */
|
|
250
|
-
private fileForStack;
|
|
251
|
-
run(program: BlockStatement, testName: string, runtime: TestRuntime, opts: RunOptions, helpers?: BlockStatement[], entryFile?: string, fnFile?: ReadonlyMap<string, string>): AsyncGenerator<ExecutionEvent, RunResult>;
|
|
252
|
-
private runBlock;
|
|
253
|
-
private runStatement;
|
|
254
|
-
private execStatement;
|
|
255
|
-
private evalExpression;
|
|
256
|
-
private callUserFunction;
|
|
257
|
-
private runLoop;
|
|
258
|
-
/** Run one loop-body pass. Returns `true` if a `break` fired (caller stops
|
|
259
|
-
* the loop), `false` for normal completion or `continue` (both end this
|
|
260
|
-
* iteration the same way). Each pass counts as a step so an empty-bodied
|
|
261
|
-
* infinite loop still trips `maxSteps`; `checkBudgets` enforces wall-clock. */
|
|
262
|
-
private runLoopIteration;
|
|
263
|
-
private applyIncrement;
|
|
264
|
-
private checkBudgets;
|
|
265
180
|
}
|
|
266
181
|
|
|
267
|
-
type RuntimeState =
|
|
182
|
+
type RuntimeState = RuntimeExecState;
|
|
268
183
|
interface ActiveRuntime {
|
|
269
184
|
id: string;
|
|
270
185
|
scenarioName: string;
|
|
@@ -322,6 +237,14 @@ interface TestRuntimeManagerDeps {
|
|
|
322
237
|
declare class TestRuntimeManager {
|
|
323
238
|
private readonly deps;
|
|
324
239
|
private readonly runtimes;
|
|
240
|
+
/** Final snapshot of recently-aborted runtimes. `abort()` removes the live
|
|
241
|
+
* runtime from `runtimes`, so a trailing `inspect()` (the runtime-state
|
|
242
|
+
* writer's final flush, or the agent reading after `abort_runtime`) would
|
|
243
|
+
* otherwise miss the terminal `aborted` state and report the stale pre-abort
|
|
244
|
+
* `paused-*`. We keep the captured terminal snapshot here so inspect reflects
|
|
245
|
+
* `aborted`. Bounded — only the last few matter (a writer flushes once). */
|
|
246
|
+
private readonly terminalTombstones;
|
|
247
|
+
private static readonly MAX_TOMBSTONES;
|
|
325
248
|
private nextId;
|
|
326
249
|
constructor(deps: TestRuntimeManagerDeps);
|
|
327
250
|
register(opts: {
|
|
@@ -335,11 +258,18 @@ declare class TestRuntimeManager {
|
|
|
335
258
|
step(id: string): Promise<ExecutionEvent | RunResult>;
|
|
336
259
|
resume(id: string): Promise<ExecutionEvent | RunResult>;
|
|
337
260
|
abort(id: string): Promise<void>;
|
|
261
|
+
/** Snapshot a just-aborted (still-live) runtime into the tombstone map so a
|
|
262
|
+
* later inspect() reflects `aborted`. Bounded LRU; best-effort. */
|
|
263
|
+
private rememberTombstone;
|
|
338
264
|
inspect(id: string): RuntimeSnapshot;
|
|
339
265
|
/** The live active page of a runtime — used by the locator picker to
|
|
340
266
|
* attach its overlay to the page held open during a debug pause.
|
|
341
267
|
* Returns null when the runtime is gone or has no page yet. */
|
|
342
268
|
currentPage(id: string): DriverPage | null;
|
|
269
|
+
/** Every open page of the runtime's context (debug picker arms its overlay
|
|
270
|
+
* on all of them at once, Playwright-codegen style). Empty when the runtime
|
|
271
|
+
* is gone or has no context yet. */
|
|
272
|
+
pages(id: string): readonly DriverPage[];
|
|
343
273
|
/** The runtime's driver context (for capture artifacts — console/network).
|
|
344
274
|
* Null when the runtime isn't registered. */
|
|
345
275
|
currentContext(id: string): DriverContext | null;
|
|
@@ -352,4 +282,4 @@ declare class TestRuntimeManager {
|
|
|
352
282
|
/** Build a fully-populated FunctionRegistry. */
|
|
353
283
|
declare function buildDefaultRegistry(): FunctionRegistry;
|
|
354
284
|
|
|
355
|
-
export { AstExecutor, type DslArg, type DslArray, type DslFunction, type DslObject, type DslValue,
|
|
285
|
+
export { AstExecutor, type DslArg, type DslArray, type DslFunction, type DslObject, type DslValue, FunctionRegistry, LocatorValue, TestRuntime, TestRuntimeManager, buildDefaultRegistry, chainGetByAltText, chainGetByLabel, chainGetByPlaceholder, chainGetByRole, chainGetByTestId, chainGetByText, chainGetByTitle, contentFrame, filter, first, getByAltText, getByLabel, getByPlaceholder, getByRole, getByTestId, getByText, getByTitle, last, locator, nth, randomNth, re };
|