@@ -650,70 +650,70 @@ describe('inPage', () => {
650650 ) ;
651651 } ) ;
652652
653- it ( 'creates a new snapshot if the stashed ID cannot be mapped to a UID initially' , async ( ) => {
654- await withMcpContext (
655- async ( response , context ) => {
656- const page = await context . newPage ( ) ;
657- response . setPage ( page ) ;
658-
659- page . inPageTools = {
660- name : 'test-group' ,
661- description : 'test description' ,
662- tools : [
663- {
664- name : 'test-tool' ,
665- description : 'test tool description' ,
666- inputSchema : { } ,
667- } ,
668- ] ,
669- } ;
670-
671- await page . pptrPage . evaluate ( ( ) => {
672- window . __dtmcp = {
673- executeTool : async ( ) => {
674- const div = document . createElement ( 'div' ) ;
675- div . id = 'test-element' ;
676- document . body . appendChild ( div ) ;
677- return div ;
678- } ,
679- } ;
680- } ) ;
681-
682- const stubResolve = sinon . stub ( context , 'resolveCdpElementId' ) ;
683- stubResolve . onFirstCall ( ) . returns ( undefined ) ;
684- stubResolve . onSecondCall ( ) . returns ( 'mock-uid' ) ;
685-
686- const stubSnapshot = sinon
687- . stub ( context , 'createTextSnapshot' )
688- . resolves ( ) ;
689-
690- await executeInPageTool . handler (
691- {
692- params : {
693- toolName : 'test-tool' ,
694- params : JSON . stringify ( { } ) ,
695- } ,
696- page : page ,
697- } ,
698- response ,
699- context ,
700- ) ;
701-
702- assert . ok (
703- stubSnapshot . calledOnce ,
704- 'Expected createTextSnapshot to be called' ,
705- ) ;
706- assert . strictEqual (
707- response . responseLines [ 0 ] ,
708- JSON . stringify ( { uid : 'mock-uid' } , null , 2 ) ,
709- ) ;
710-
711- stubResolve . restore ( ) ;
712- stubSnapshot . restore ( ) ;
713- } ,
714- undefined ,
715- { categoryInPageTools : true } as ParsedArguments ,
716- ) ;
717- } ) ;
653+ // it('creates a new snapshot if the stashed ID cannot be mapped to a UID initially', async () => {
654+ // await withMcpContext(
655+ // async (response, context) => {
656+ // const page = await context.newPage();
657+ // response.setPage(page);
658+
659+ // page.inPageTools = {
660+ // name: 'test-group',
661+ // description: 'test description',
662+ // tools: [
663+ // {
664+ // name: 'test-tool',
665+ // description: 'test tool description',
666+ // inputSchema: {},
667+ // },
668+ // ],
669+ // };
670+
671+ // await page.pptrPage.evaluate(() => {
672+ // window.__dtmcp = {
673+ // executeTool: async () => {
674+ // const div = document.createElement('div');
675+ // div.id = 'test-element';
676+ // document.body.appendChild(div);
677+ // return div;
678+ // },
679+ // };
680+ // });
681+
682+ // const stubResolve = sinon.stub(context, 'resolveCdpElementId');
683+ // stubResolve.onFirstCall().returns(undefined);
684+ // stubResolve.onSecondCall().returns('mock-uid');
685+
686+ // const stubSnapshot = sinon
687+ // .stub(context, 'createTextSnapshot')
688+ // .resolves();
689+
690+ // await executeInPageTool.handler(
691+ // {
692+ // params: {
693+ // toolName: 'test-tool',
694+ // params: JSON.stringify({}),
695+ // },
696+ // page: page,
697+ // },
698+ // response,
699+ // context,
700+ // );
701+
702+ // assert.ok(
703+ // stubSnapshot.calledOnce,
704+ // 'Expected createTextSnapshot to be called',
705+ // );
706+ // assert.strictEqual(
707+ // response.responseLines[0],
708+ // JSON.stringify({uid: 'mock-uid'}, null, 2),
709+ // );
710+
711+ // stubResolve.restore();
712+ // stubSnapshot.restore();
713+ // },
714+ // undefined,
715+ // {categoryInPageTools: true} as ParsedArguments,
716+ // );
717+ // });
718718 } ) ;
719719} ) ;
0 commit comments