@checksum-ai/runtime 1.2.1 → 1.2.2
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/.env +1 -1
- package/README.md +4 -1
- package/checksum-root/tsconfig.json +3 -2
- package/checksumlib.js +43 -43
- package/cli.js +1 -1
- package/index.js +179 -179
- package/mock-auto-heal-agent.js +32 -0
- package/package.json +1 -1
- package/pw-report-template.html +8 -8
- package/vtg-pw-bridge-runner.js +1 -1
package/cli.js
CHANGED
|
@@ -1631,7 +1631,7 @@ ${a.map(u=>[u.type,u.nestedLevel,this.getText(u.body)]).join(`,
|
|
|
1631
1631
|
} finally {
|
|
1632
1632
|
globalThis.console = originalConsole;
|
|
1633
1633
|
}
|
|
1634
|
-
`}};e(_VtgEvaluatorService,"VtgEvaluatorService");var Ugr=_VtgEvaluatorService;var Ygi={Playwright:[{type:"File",value:["node_modules/playwright-core/types/types.d.ts","node_modules/@playwright/test/node_modules/playwright-core/types/types.d.ts"],moduleName:"playwright-core"}],PlaywrightTest:[{type:"File",value:["node_modules/playwright/types/test.d.ts","node_modules/@playwright/test/node_modules/playwright/types/test.d.ts"],moduleName:"@playwright/test"}],Checksum:[{type:"File",value:"node_modules/@checksum-ai/runtime/index.d.ts",moduleName:"@checksum-ai/runtime"},{type:"Inline",value:"import type { IChecksumPage as CSPage, IChecksumExpect as CSExpect, ChecksumAI, IVariableStore, getLogin } from '@checksum-ai/runtime';declare global {interface IChecksumPage extends CSPage {};const page:IChecksumPage;const expect: CSExpect;const checksumAI: ChecksumAI;const login: ReturnType<typeof getLogin>}"}]};var X3e=class X3e{constructor(){this.cache=new Map}static getInstance(){return X3e.instance||(X3e.instance=new X3e),X3e.instance}get(n){return this.cache.get(n)}set(n,a){this.cache.set(n,a)}delete(n){this.cache.delete(n)}clear(){this.cache.clear()}};e(X3e,"InMemoryCache");var qgr=X3e;d3t();gan();Ean();_me();var avr="vtg";var ovr=class ovr{constructor(n,a,u,f,g,A,E){this.newStoryId=n;this.editedFilePath=a;this.isLegacyMode=u;this.internalE2ETest=f;this.restoreFromAutoSave=g;this.checksumRoot=A;this.isEditMode=!!this.editedFilePath,this.vtgInternalFilesDir=(0,Qle.join)(E,avr),(0,e$.mkdirSync)(this.vtgInternalFilesDir,{recursive:!0}),this.vtgSettingsService=new pXe(this.checksumRoot,this.vtgInternalFilesDir)}async initAndUpdateEnvAndPlaywrightArgs(n,a){if(n.CHECKSUM_VTG_INTERNAL_FILES_DIR=this.vtgInternalFilesDir,this.draftsFolderPath=(0,Qle.join)(this.vtgInternalFilesDir,this.internalE2ETest?"e2e":"drafts"),this.createFolderIfNotExists(this.draftsFolderPath),n.CHECKSUM_DRAFT_FOLDER_PATH=this.draftsFolderPath,this.isLegacyMode)return;a.unshift("--reporter=line"),n.CHECKSUM_VTG_TEST_FILE_MODE="true",this.isEditMode?n.CHECKSUM_VTG_TEST_FILE_EDIT_MODE="true":n.CHECKSUM_VTG_STORY_ID=this.newStoryId,n.PW_TEST_HTML_REPORT_OPEN="never";let u;this.isEditMode||((0,e$.writeFileSync)(this.getSavePathForNewChecksumSpec(),await g$r({body:"",testFunctionParams:["page","vs"],storyId:this.newStoryId})),this.editedFilePath=this.getSavePathForNewChecksumSpec()),this.copyCustomerEngUtils();let f=this.loadVtgTestFileMirror(this.editedFilePath);this.isEditMode&&!this.restoreFromAutoSave&&this.createActionJsonFileForExistingChecksumSpec(f,this.editedFilePath),await this.createEvalFileForExistingChecksumSpec(f,this.editedFilePath),u={mode:this.isEditMode?"edit":"start",actionsJsonFilePath:this.isEditMode&&!this.restoreFromAutoSave?this.getActionJsonFilePath(this.editedFilePath):void 0,title:f.testMirrors[0].title,internalTestId:f.testMirrors[0].internalTestId,storyId:f.testMirrors[0].storyId,evalFilePath:this.getEvalFilePath(this.editedFilePath),sourceFilePath:this.editedFilePath,restoreFromAutoSave:this.restoreFromAutoSave},n.CHECKSUM_VTG_TEST_FILE_RUN_CONFIG=JSON.stringify(u),a.push(this.getEvalFilePath(this.isEditMode?this.editedFilePath:void 0))}copyCustomerEngUtils(){let n=pxt(this.checksumRoot,10);if(!n){console.warn("Customer engineering repository was not found, using REPL will not be possible.");return}let a=(0,Qle.join)(n,uv.vtg.customerEngRepoInternalUtilsRelativePath);if(!(0,e$.existsSync)(a)){console.warn(`Internal utils file not found: ${a}, skipping copy.`);return}(0,e$.copyFileSync)(a,this.checksumAiInternalUtilsPath)}get checksumAiInternalUtilsPath(){return(0,Qle.join)(this.vtgInternalFilesDir,"checksum-ai-utils.ts")}async createEvalFileForExistingChecksumSpec(n,a){let u=new JKe(n.sourceFile),f=Z_r();u.transformSourceFile([new eYe(a,f,{filterOutChecksumImports:!0}),new TKe(a),new ZKe(a,f,{newRequireIdentifier:"checksumHotRequire",extraImportArguments:[svr.default.factory.createIdentifier("__filename")]}),new kKe(n.sourceFile,n.testMirrors.map(E=>E.testBody),X_r(this.internalE2ETest?HVr:$Vr),["page","vs","vtg"]),new S7t(svr.default.NodeFlags.Let,!0)]);let g=this.getEvalFilePath(a);(0,e$.mkdirSync)((0,Qle.dirname)(g),{recursive:!0});let A=(0,e$.existsSync)(this.checksumAiInternalUtilsPath)?`globalThis.repl = require("${this.checksumAiInternalUtilsPath}").repl;`:"";(0,e$.writeFileSync)(g,`${this.internalE2ETest?'import { testingFunc } from "
|
|
1634
|
+
`}};e(_VtgEvaluatorService,"VtgEvaluatorService");var Ugr=_VtgEvaluatorService;var Ygi={Playwright:[{type:"File",value:["node_modules/playwright-core/types/types.d.ts","node_modules/@playwright/test/node_modules/playwright-core/types/types.d.ts"],moduleName:"playwright-core"}],PlaywrightTest:[{type:"File",value:["node_modules/playwright/types/test.d.ts","node_modules/@playwright/test/node_modules/playwright/types/test.d.ts"],moduleName:"@playwright/test"}],Checksum:[{type:"File",value:"node_modules/@checksum-ai/runtime/index.d.ts",moduleName:"@checksum-ai/runtime"},{type:"Inline",value:"import type { IChecksumPage as CSPage, IChecksumExpect as CSExpect, ChecksumAI, IVariableStore, getLogin } from '@checksum-ai/runtime';declare global {interface IChecksumPage extends CSPage {};const page:IChecksumPage;const expect: CSExpect;const checksumAI: ChecksumAI;const login: ReturnType<typeof getLogin>}"}]};var X3e=class X3e{constructor(){this.cache=new Map}static getInstance(){return X3e.instance||(X3e.instance=new X3e),X3e.instance}get(n){return this.cache.get(n)}set(n,a){this.cache.set(n,a)}delete(n){this.cache.delete(n)}clear(){this.cache.clear()}};e(X3e,"InMemoryCache");var qgr=X3e;d3t();gan();Ean();_me();var avr="vtg";var ovr=class ovr{constructor(n,a,u,f,g,A,E){this.newStoryId=n;this.editedFilePath=a;this.isLegacyMode=u;this.internalE2ETest=f;this.restoreFromAutoSave=g;this.checksumRoot=A;this.isEditMode=!!this.editedFilePath,this.vtgInternalFilesDir=(0,Qle.join)(E,avr),(0,e$.mkdirSync)(this.vtgInternalFilesDir,{recursive:!0}),this.vtgSettingsService=new pXe(this.checksumRoot,this.vtgInternalFilesDir)}async initAndUpdateEnvAndPlaywrightArgs(n,a){if(n.CHECKSUM_VTG_INTERNAL_FILES_DIR=this.vtgInternalFilesDir,this.draftsFolderPath=(0,Qle.join)(this.vtgInternalFilesDir,this.internalE2ETest?"e2e":"drafts"),this.createFolderIfNotExists(this.draftsFolderPath),n.CHECKSUM_DRAFT_FOLDER_PATH=this.draftsFolderPath,this.isLegacyMode)return;a.unshift("--reporter=line"),n.CHECKSUM_VTG_TEST_FILE_MODE="true",this.isEditMode?n.CHECKSUM_VTG_TEST_FILE_EDIT_MODE="true":n.CHECKSUM_VTG_STORY_ID=this.newStoryId,n.PW_TEST_HTML_REPORT_OPEN="never";let u;this.isEditMode||((0,e$.writeFileSync)(this.getSavePathForNewChecksumSpec(),await g$r({body:"",testFunctionParams:["page","vs"],storyId:this.newStoryId})),this.editedFilePath=this.getSavePathForNewChecksumSpec()),this.copyCustomerEngUtils();let f=this.loadVtgTestFileMirror(this.editedFilePath);this.isEditMode&&!this.restoreFromAutoSave&&this.createActionJsonFileForExistingChecksumSpec(f,this.editedFilePath),await this.createEvalFileForExistingChecksumSpec(f,this.editedFilePath),u={mode:this.isEditMode?"edit":"start",actionsJsonFilePath:this.isEditMode&&!this.restoreFromAutoSave?this.getActionJsonFilePath(this.editedFilePath):void 0,title:f.testMirrors[0].title,internalTestId:f.testMirrors[0].internalTestId,storyId:f.testMirrors[0].storyId,evalFilePath:this.getEvalFilePath(this.editedFilePath),sourceFilePath:this.editedFilePath,restoreFromAutoSave:this.restoreFromAutoSave},n.CHECKSUM_VTG_TEST_FILE_RUN_CONFIG=JSON.stringify(u),a.push(this.getEvalFilePath(this.isEditMode?this.editedFilePath:void 0))}copyCustomerEngUtils(){let n=pxt(this.checksumRoot,10);if(!n){console.warn("Customer engineering repository was not found, using REPL will not be possible.");return}let a=(0,Qle.join)(n,uv.vtg.customerEngRepoInternalUtilsRelativePath);if(!(0,e$.existsSync)(a)){console.warn(`Internal utils file not found: ${a}, skipping copy.`);return}(0,e$.copyFileSync)(a,this.checksumAiInternalUtilsPath)}get checksumAiInternalUtilsPath(){return(0,Qle.join)(this.vtgInternalFilesDir,"checksum-ai-utils.ts")}async createEvalFileForExistingChecksumSpec(n,a){let u=new JKe(n.sourceFile),f=Z_r();u.transformSourceFile([new eYe(a,f,{filterOutChecksumImports:!0}),new TKe(a),new ZKe(a,f,{newRequireIdentifier:"checksumHotRequire",extraImportArguments:[svr.default.factory.createIdentifier("__filename")]}),new kKe(n.sourceFile,n.testMirrors.map(E=>E.testBody),X_r(this.internalE2ETest?HVr:$Vr),["page","vs","vtg"]),new S7t(svr.default.NodeFlags.Let,!0)]);let g=this.getEvalFilePath(a);(0,e$.mkdirSync)((0,Qle.dirname)(g),{recursive:!0});let A=(0,e$.existsSync)(this.checksumAiInternalUtilsPath)?`globalThis.repl = require("${this.checksumAiInternalUtilsPath}").repl;`:"";(0,e$.writeFileSync)(g,`${this.internalE2ETest?'import { testingFunc } from "../../../../../e2e/test.ts";':""}
|
|
1635
1635
|
${zVr}
|
|
1636
1636
|
${A}
|
|
1637
1637
|
${KVr}
|